@@ -668,6 +668,10 @@ type CreateTrackExpenseParams = {
668668 shouldPlaySound?: boolean;
669669 shouldHandleNavigation?: boolean;
670670 isASAPSubmitBetaEnabled: boolean;
671+ currentUserAccountIDParam: number;
672+ currentUserEmailParam: string;
673+ introSelected: OnyxEntry<OnyxTypes.IntroSelected>;
674+ activePolicyID: string | undefined;
671675 quickAction: OnyxEntry<OnyxTypes.QuickAction>;
672676};
673677
@@ -704,6 +708,10 @@ type GetTrackExpenseInformationParams = {
704708 transactionParams: GetTrackExpenseInformationTransactionParams;
705709 retryParams?: StartSplitBilActionParams | CreateTrackExpenseParams | RequestMoneyInformation | ReplaceReceipt;
706710 isASAPSubmitBetaEnabled: boolean;
711+ currentUserAccountIDParam: number;
712+ currentUserEmailParam: string;
713+ introSelected: OnyxEntry<OnyxTypes.IntroSelected>;
714+ activePolicyID: string | undefined;
707715 quickAction: OnyxEntry<OnyxTypes.QuickAction>;
708716};
709717
@@ -3541,6 +3549,10 @@ function getTrackExpenseInformation(params: GetTrackExpenseInformationParams): T
35413549 transactionParams,
35423550 retryParams,
35433551 isASAPSubmitBetaEnabled,
3552+ currentUserAccountIDParam,
3553+ currentUserEmailParam,
3554+ introSelected,
3555+ activePolicyID,
35443556 quickAction,
35453557 } = params;
35463558 const {payeeAccountID = userAccountID, payeeEmail = currentUserEmail, participant} = participantParams;
@@ -3654,6 +3666,10 @@ function getTrackExpenseInformation(params: GetTrackExpenseInformationParams): T
36543666 policyID: policy?.id,
36553667 expenseReportId: chatReport?.reportID,
36563668 engagementChoice: CONST.ONBOARDING_CHOICES.TRACK_WORKSPACE,
3669+ currentUserAccountIDParam,
3670+ currentUserEmailParam,
3671+ introSelected,
3672+ activePolicyID,
36573673 });
36583674 createdWorkspaceParams = workspaceData.params;
36593675 optimisticData.push(...workspaceData.optimisticData);
@@ -6091,6 +6107,10 @@ function trackExpense(params: CreateTrackExpenseParams) {
60916107 shouldHandleNavigation = true,
60926108 shouldPlaySound = true,
60936109 isASAPSubmitBetaEnabled,
6110+ currentUserAccountIDParam,
6111+ currentUserEmailParam,
6112+ introSelected,
6113+ activePolicyID,
60946114 quickAction,
60956115 } = params;
60966116 const {participant, payeeAccountID, payeeEmail} = participantParams;
@@ -6214,6 +6234,10 @@ function trackExpense(params: CreateTrackExpenseParams) {
62146234 },
62156235 retryParams,
62166236 isASAPSubmitBetaEnabled,
6237+ currentUserAccountIDParam,
6238+ currentUserEmailParam,
6239+ introSelected,
6240+ activePolicyID,
62176241 quickAction,
62186242 }) ?? {};
62196243 const activeReportID = isMoneyRequestReport ? report?.reportID : chatReport?.reportID;
@@ -6395,17 +6419,33 @@ function trackExpense(params: CreateTrackExpenseParams) {
63956419 notifyNewAction(activeReportID, payeeAccountID);
63966420}
63976421
6398- function duplicateExpenseTransaction(
6399- transaction: OnyxEntry<OnyxTypes.Transaction>,
6400- optimisticChatReportID: string,
6401- optimisticIOUReportID: string,
6402- isASAPSubmitBetaEnabled: boolean,
6403- quickAction: OnyxEntry<OnyxTypes.QuickAction>,
6404- policyRecentlyUsedCurrencies: string[],
6405- targetPolicy?: OnyxEntry<OnyxTypes.Policy>,
6406- targetPolicyCategories?: OnyxEntry<OnyxTypes.PolicyCategories>,
6407- targetReport?: OnyxTypes.Report,
6408- ) {
6422+ type DuplicateExpenseTransactionParams = {
6423+ transaction: OnyxEntry<OnyxTypes.Transaction>;
6424+ optimisticChatReportID: string;
6425+ optimisticIOUReportID: string;
6426+ isASAPSubmitBetaEnabled: boolean;
6427+ introSelected: OnyxEntry<OnyxTypes.IntroSelected>;
6428+ activePolicyID: string | undefined;
6429+ quickAction: OnyxEntry<OnyxTypes.QuickAction>;
6430+ policyRecentlyUsedCurrencies: string[];
6431+ targetPolicy?: OnyxEntry<OnyxTypes.Policy>;
6432+ targetPolicyCategories?: OnyxEntry<OnyxTypes.PolicyCategories>;
6433+ targetReport?: OnyxTypes.Report;
6434+ };
6435+
6436+ function duplicateExpenseTransaction({
6437+ transaction,
6438+ optimisticChatReportID,
6439+ optimisticIOUReportID,
6440+ isASAPSubmitBetaEnabled,
6441+ introSelected,
6442+ activePolicyID,
6443+ quickAction,
6444+ policyRecentlyUsedCurrencies,
6445+ targetPolicy,
6446+ targetPolicyCategories,
6447+ targetReport,
6448+ }: DuplicateExpenseTransactionParams) {
64096449 if (!transaction) {
64106450 return;
64116451 }
@@ -6464,6 +6504,8 @@ function duplicateExpenseTransaction(
64646504 },
64656505 report: undefined,
64666506 isDraftPolicy: false,
6507+ introSelected,
6508+ activePolicyID,
64676509 quickAction,
64686510 };
64696511 return trackExpense(trackExpenseParams);
@@ -9323,7 +9365,7 @@ function getPayMoneyRequestParams({
93239365 bankAccountID,
93249366 currentUserAccountIDParam,
93259367 currentUserEmailParam,
9326- introSelectedParam ,
9368+ introSelected ,
93279369 paymentPolicyID,
93289370 lastUsedPaymentMethod,
93299371 existingB2BInvoiceReport,
@@ -9343,7 +9385,7 @@ function getPayMoneyRequestParams({
93439385 activePolicy?: OnyxEntry<OnyxTypes.Policy>;
93449386 currentUserAccountIDParam?: number;
93459387 currentUserEmailParam?: string;
9346- introSelectedParam ?: OnyxEntry<OnyxTypes.IntroSelected>;
9388+ introSelected ?: OnyxEntry<OnyxTypes.IntroSelected>;
93479389}): PayMoneyRequestData {
93489390 const isInvoiceReport = isInvoiceReportReportUtils(iouReport);
93499391 let payerPolicyID = activePolicy?.id;
@@ -9365,10 +9407,10 @@ function getPayMoneyRequestParams({
93659407 policyOwnerEmail: currentUserEmail,
93669408 makeMeAdmin: true,
93679409 policyID: payerPolicyID,
9368- currentUserAccountIDParam,
9369- currentUserEmailParam,
9370- introSelectedParam ,
9371- activePolicyIDParam : activePolicy?.id,
9410+ currentUserAccountIDParam: currentUserAccountIDParam ?? CONST.DEFAULT_NUMBER_ID ,
9411+ currentUserEmailParam: currentUserEmailParam ?? '' ,
9412+ introSelected ,
9413+ activePolicyID : activePolicy?.id,
93729414 });
93739415 const {adminsChatReportID, adminsCreatedReportActionID, expenseChatReportID, expenseCreatedReportActionID, customUnitRateID, customUnitID, ownerEmail, policyName} = params;
93749416
@@ -11081,7 +11123,7 @@ function payInvoice({
1108111123 activePolicy,
1108211124 currentUserAccountIDParam,
1108311125 currentUserEmailParam,
11084- introSelectedParam: introSelected,
11126+ introSelected,
1108511127 });
1108611128
1108711129 const paymentSelected = paymentMethodType === CONST.IOU.PAYMENT_TYPE.VBBA ? CONST.IOU.PAYMENT_SELECTED.BBA : CONST.IOU.PAYMENT_SELECTED.PBA;
0 commit comments