Skip to content
Merged
12 changes: 8 additions & 4 deletions src/libs/actions/IOU/SendInvoice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,8 @@ function getSendInvoiceInformation({
companyWebsite,
policyRecentlyUsedCategories,
policyRecentlyUsedTags,
}: SendInvoiceOptions): SendInvoiceInformation {
senderPolicyTags,
}: SendInvoiceOptions & {senderPolicyTags: OnyxTypes.PolicyTagLists}): SendInvoiceInformation {
const {amount = 0, currency = '', created = '', merchant = '', category = '', tag = '', taxCode = '', taxAmount = 0, taxValue, billable, comment, participants} = transaction ?? {};
const trimmedComment = (comment?.comment ?? '').trim();
const senderWorkspaceID = participants?.find((participant) => participant?.isSender)?.policyID;
Expand Down Expand Up @@ -654,9 +655,7 @@ function getSendInvoiceInformation({

const optimisticPolicyRecentlyUsedCategories = mergePolicyRecentlyUsedCategories(category, policyRecentlyUsedCategories);
const optimisticPolicyRecentlyUsedTags = buildOptimisticPolicyRecentlyUsedTags({
// TODO: remove `allPolicyTags` from this file https://github.com/Expensify/App/issues/80048
// eslint-disable-next-line @typescript-eslint/no-deprecated
policyTags: getPolicyTagsData(optimisticInvoiceReport.policyID),
policyTags: senderPolicyTags,
policyRecentlyUsedTags,
transactionTags: tag,
});
Expand Down Expand Up @@ -745,6 +744,10 @@ function sendInvoice({
policyRecentlyUsedTags,
isFromGlobalCreate,
}: SendInvoiceOptions) {
// TODO: remove `allPolicyTags` from this file https://github.com/Expensify/App/issues/80048
// eslint-disable-next-line @typescript-eslint/no-deprecated
Comment thread
jakubstec marked this conversation as resolved.
const senderPolicyTags = getPolicyTagsData(transaction?.participants?.find((p) => p?.isSender)?.policyID) ?? {};

const parsedComment = getParsedComment(transaction?.comment?.comment?.trim() ?? '');
if (transaction?.comment) {
// eslint-disable-next-line no-param-reassign
Expand Down Expand Up @@ -777,6 +780,7 @@ function sendInvoice({
companyWebsite,
policyRecentlyUsedCategories,
policyRecentlyUsedTags,
senderPolicyTags,
});

const parameters: SendInvoiceParams = {
Expand Down
Loading
Loading