Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1095,12 +1095,6 @@ const ROUTES = {
// eslint-disable-next-line no-restricted-syntax -- Legacy route generation
getUrlWithBackToParam(`${action as string}/${iouType as string}/participants/${transactionID}/${reportID}`, backTo),
},
MONEY_REQUEST_STEP_SPLIT_PAYER: {
route: ':action/:iouType/confirmation/:transactionID/:reportID/payer',
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string, reportID: string, backTo = '') =>
// eslint-disable-next-line no-restricted-syntax -- Legacy route generation
getUrlWithBackToParam(`${action as string}/${iouType as string}/confirmation/${transactionID}/${reportID}/payer`, backTo),
},
MONEY_REQUEST_STEP_SCAN: {
route: ':action/:iouType/scan/:transactionID/:reportID',
getRoute: (action: IOUAction, iouType: IOUType, transactionID: string | undefined, reportID: string | undefined, backTo = '') => {
Expand Down
1 change: 0 additions & 1 deletion src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ const SCREENS = {
STEP_TAX_AMOUNT: 'Money_Request_Step_Tax_Amount',
STEP_TAX_RATE: 'Money_Request_Step_Tax_Rate',
RECEIPT_VIEW: 'Money_Request_Receipt_View',
STEP_SPLIT_PAYER: 'Money_Request_Step_Split_Payer',
STEP_SEND_FROM: 'Money_Request_Step_Send_From',
STEP_COMPANY_INFO: 'Money_Request_Step_Company_Info',
CURRENCY: 'Money_Request_Currency',
Expand Down
1 change: 0 additions & 1 deletion src/libs/API/parameters/SplitBillParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ type SplitBillParams = {
createdReportActionID?: string;
policyID: string | undefined;
chatType: string | undefined;
splitPayerAccountIDs: number[];
taxCode: string;
taxAmount: number;
description?: string;
Expand Down
3 changes: 0 additions & 3 deletions src/libs/DebugUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,6 @@ function validateTransactionDraftProperty(key: keyof Transaction, value: string)
originalAmount: CONST.RED_BRICK_ROAD_PENDING_ACTION,
originalCurrency: CONST.RED_BRICK_ROAD_PENDING_ACTION,
splitShares: CONST.RED_BRICK_ROAD_PENDING_ACTION,
splitPayerAccountIDs: CONST.RED_BRICK_ROAD_PENDING_ACTION,
shouldShowOriginalAmount: CONST.RED_BRICK_ROAD_PENDING_ACTION,
actionableWhisperReportActionID: CONST.RED_BRICK_ROAD_PENDING_ACTION,
linkedTrackedExpenseReportAction: CONST.RED_BRICK_ROAD_PENDING_ACTION,
Expand Down Expand Up @@ -1179,8 +1178,6 @@ function validateTransactionDraftProperty(key: keyof Transaction, value: string)
},
'number',
);
case 'splitPayerAccountIDs':
return validateArray(value, 'number');
case 'linkedTrackedExpenseReportAction':
return validateObject<ReportAction>(value, {
accountID: 'number',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ const MoneyRequestModalStackNavigator = createModalStackNavigator<MoneyRequestNa
[SCREENS.MONEY_REQUEST.STEP_SCAN]: () => require<ReactComponentModule>('../../../../pages/iou/request/step/IOURequestStepScan').default,
[SCREENS.MONEY_REQUEST.STEP_TAG]: () => require<ReactComponentModule>('../../../../pages/iou/request/step/IOURequestStepTag').default,
[SCREENS.MONEY_REQUEST.STEP_WAYPOINT]: () => require<ReactComponentModule>('../../../../pages/iou/request/step/IOURequestStepWaypoint').default,
[SCREENS.MONEY_REQUEST.STEP_SPLIT_PAYER]: () => require<ReactComponentModule>('../../../../pages/iou/request/step/IOURequestStepSplitPayer').default,
[SCREENS.MONEY_REQUEST.STEP_SEND_FROM]: () => require<ReactComponentModule>('../../../../pages/iou/request/step/IOURequestStepSendFrom').default,
[SCREENS.MONEY_REQUEST.STEP_REPORT]: () => require<ReactComponentModule>('../../../../pages/iou/request/step/IOURequestStepReport').default,
[SCREENS.MONEY_REQUEST.STEP_COMPANY_INFO]: () => require<ReactComponentModule>('../../../../pages/iou/request/step/IOURequestStepCompanyInfo').default,
Expand Down
1 change: 0 additions & 1 deletion src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,6 @@ const config: LinkingOptions<RootNavigatorParamList>['config'] = {
path: ROUTES.MONEY_REQUEST_STATE_SELECTOR.route,
exact: true,
},
[SCREENS.MONEY_REQUEST.STEP_SPLIT_PAYER]: ROUTES.MONEY_REQUEST_STEP_SPLIT_PAYER.route,
[SCREENS.MONEY_REQUEST.STEP_ATTENDEES]: ROUTES.MONEY_REQUEST_ATTENDEE.route,
[SCREENS.MONEY_REQUEST.STEP_ACCOUNTANT]: ROUTES.MONEY_REQUEST_ACCOUNTANT.route,
[SCREENS.MONEY_REQUEST.STEP_UPGRADE]: ROUTES.MONEY_REQUEST_UPGRADE.route,
Expand Down
7 changes: 0 additions & 7 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1403,13 +1403,6 @@ type MoneyRequestNavigatorParamList = {
backTo: Routes;
reportActionID?: string;
};
[SCREENS.MONEY_REQUEST.STEP_SPLIT_PAYER]: {
action: ValueOf<typeof CONST.IOU.ACTION>;
iouType: ValueOf<typeof CONST.IOU.TYPE>;
transactionID: string;
reportID: string;
backTo: Routes;
};
[SCREENS.IOU_SEND.ENABLE_PAYMENTS]: undefined;
[SCREENS.IOU_SEND.ADD_BANK_ACCOUNT]: undefined;
[SCREENS.IOU_SEND.ADD_DEBIT_CARD]: undefined;
Expand Down
11 changes: 0 additions & 11 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@
};

let allPersonalDetails: OnyxTypes.PersonalDetailsList = {};
Onyx.connect({

Check warning on line 691 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => {
allPersonalDetails = value ?? {};
Expand Down Expand Up @@ -729,13 +729,13 @@
};

let allBetas: OnyxEntry<OnyxTypes.Beta[]>;
Onyx.connect({

Check warning on line 732 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.BETAS,
callback: (value) => (allBetas = value),
});

let allTransactions: NonNullable<OnyxCollection<OnyxTypes.Transaction>> = {};
Onyx.connect({

Check warning on line 738 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -749,7 +749,7 @@
});

let allTransactionDrafts: NonNullable<OnyxCollection<OnyxTypes.Transaction>> = {};
Onyx.connect({

Check warning on line 752 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION_DRAFT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -758,7 +758,7 @@
});

let allTransactionViolations: NonNullable<OnyxCollection<OnyxTypes.TransactionViolations>> = {};
Onyx.connect({

Check warning on line 761 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -772,7 +772,7 @@
});

let allDraftSplitTransactions: NonNullable<OnyxCollection<OnyxTypes.Transaction>> = {};
Onyx.connect({

Check warning on line 775 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.SPLIT_TRANSACTION_DRAFT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -781,7 +781,7 @@
});

let allNextSteps: NonNullable<OnyxCollection<OnyxTypes.ReportNextStep>> = {};
Onyx.connect({

Check warning on line 784 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.NEXT_STEP,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -790,14 +790,14 @@
});

let allPolicyCategories: OnyxCollection<OnyxTypes.PolicyCategories> = {};
Onyx.connect({

Check warning on line 793 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY_CATEGORIES,
waitForCollectionCallback: true,
callback: (val) => (allPolicyCategories = val),
});

const allPolicies: OnyxCollection<OnyxTypes.Policy> = {};
Onyx.connect({

Check warning on line 800 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY,
callback: (val, key) => {
if (!key) {
Expand Down Expand Up @@ -833,7 +833,7 @@
// `allRecentlyUsedTags` was moved here temporarily from `src/libs/actions/Policy/Tag.ts` during the `Deprecate Onyx.connect` refactor.
// All uses of this variable should be replaced with `useOnyx`.
let allRecentlyUsedTags: OnyxCollection<RecentlyUsedTags> = {};
Onyx.connect({

Check warning on line 836 in src/libs/actions/IOU.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.POLICY_RECENTLY_USED_TAGS,
waitForCollectionCallback: true,
callback: (val) => (allRecentlyUsedTags = val),
Expand Down Expand Up @@ -1071,7 +1071,6 @@
transactionID: newTransactionID,
isFromGlobalCreate,
merchant: CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT,
splitPayerAccountIDs: currentUserPersonalDetails ? [currentUserPersonalDetails.accountID] : undefined,
};

// Store the transaction in Onyx and mark it as not saved so it can be cleaned up later
Expand Down Expand Up @@ -1212,10 +1211,6 @@
});
}

function setSplitPayer(transactionID: string, payerAccountID: number) {
Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, {splitPayerAccountIDs: [payerAccountID]});
}

function setMoneyRequestReceipt(transactionID: string, source: string, filename: string, isDraft: boolean, type?: string, isTestReceipt = false, isTestDriveReceipt = false) {
Onyx.merge(`${isDraft ? ONYXKEYS.COLLECTION.TRANSACTION_DRAFT : ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {
// isTestReceipt = false and isTestDriveReceipt = false are being converted to null because we don't really need to store it in Onyx in those cases
Expand Down Expand Up @@ -6972,7 +6967,6 @@
iouRequestType?: IOURequestType;
existingSplitChatReportID?: string;
splitShares?: SplitShares;
splitPayerAccountIDs?: number[];
taxCode?: string;
taxAmount?: number;
isRetry?: boolean;
Expand All @@ -6998,7 +6992,6 @@
iouRequestType = CONST.IOU.REQUEST_TYPE.MANUAL,
existingSplitChatReportID,
splitShares = {},
splitPayerAccountIDs = [],
taxCode = '',
taxAmount = 0,
}: SplitBillActionsParams) {
Expand Down Expand Up @@ -7042,7 +7035,6 @@
createdReportActionID: splitData.createdReportActionID,
policyID: splitData.policyID,
chatType: splitData.chatType,
splitPayerAccountIDs,
taxCode,
taxAmount,
description: parsedComment,
Expand Down Expand Up @@ -7076,7 +7068,6 @@
reimbursable = false,
iouRequestType = CONST.IOU.REQUEST_TYPE.MANUAL,
splitShares = {},
splitPayerAccountIDs = [],
taxCode = '',
taxAmount = 0,
existingSplitChatReportID,
Expand Down Expand Up @@ -7121,7 +7112,6 @@
createdReportActionID: splitData.createdReportActionID,
policyID: splitData.policyID,
chatType: splitData.chatType,
splitPayerAccountIDs,
taxCode,
taxAmount,
description: parsedComment,
Expand Down Expand Up @@ -13657,7 +13647,6 @@
setMoneyRequestTag,
setMoneyRequestTaxAmount,
setMoneyRequestTaxRate,
setSplitPayer,
setSplitShares,
splitBill,
splitBillAndOpenReport,
Expand Down
3 changes: 1 addition & 2 deletions src/libs/actions/TransactionEdit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ type BuildOptimisticTransactionParams = {

function buildOptimisticTransactionAndCreateDraft({initialTransaction, currentUserPersonalDetails, reportID}: BuildOptimisticTransactionParams): Transaction {
const newTransactionID = generateTransactionID();
const {currency, iouRequestType, isFromGlobalCreate, splitPayerAccountIDs} = initialTransaction ?? {};
const {currency, iouRequestType, isFromGlobalCreate} = initialTransaction ?? {};
const newTransaction = {
amount: 0,
created: format(new Date(), 'yyyy-MM-dd'),
Expand All @@ -162,7 +162,6 @@ function buildOptimisticTransactionAndCreateDraft({initialTransaction, currentUs
transactionID: newTransactionID,
isFromGlobalCreate,
merchant: CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT,
splitPayerAccountIDs,
} as Transaction;
createDraftTransaction(newTransaction);
return newTransaction;
Expand Down
18 changes: 0 additions & 18 deletions src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -237,21 +237,6 @@ function IOURequestStepConfirmation({
const isCategorizingTrackExpense = action === CONST.IOU.ACTION.CATEGORIZE;
const isMovingTransactionFromTrackExpense = isMovingTransactionFromTrackExpenseIOUUtils(action);
const isTestTransaction = transaction?.participants?.some((participant) => isSelectedManagerMcTest(participant.login));
const payeePersonalDetails = useMemo(() => {
if (personalDetails?.[transaction?.splitPayerAccountIDs?.at(0) ?? -1]) {
return personalDetails?.[transaction?.splitPayerAccountIDs?.at(0) ?? -1];
}

const participant = transaction?.participants?.find((val) => val.accountID === (transaction?.splitPayerAccountIDs?.at(0) ?? -1));

return {
login: participant?.login ?? '',
accountID: participant?.accountID ?? CONST.DEFAULT_NUMBER_ID,
avatar: Expensicons.FallbackAvatar,
displayName: participant?.login ?? '',
isOptimisticPersonalDetail: true,
};
}, [personalDetails, transaction?.participants, transaction?.splitPayerAccountIDs]);

const gpsRequired = transaction?.amount === 0 && iouType !== CONST.IOU.TYPE.SPLIT && Object.values(receiptFiles).length && !isTestTransaction;
const [isConfirmed, setIsConfirmed] = useState(false);
Expand Down Expand Up @@ -847,7 +832,6 @@ function IOURequestStepConfirmation({
reimbursable: transaction.reimbursable,
iouRequestType: transaction.iouRequestType,
splitShares: transaction.splitShares,
splitPayerAccountIDs: transaction.splitPayerAccountIDs ?? [],
taxCode: transactionTaxCode,
taxAmount: transactionTaxAmount,
});
Expand All @@ -873,7 +857,6 @@ function IOURequestStepConfirmation({
reimbursable: !!transaction.reimbursable,
iouRequestType: transaction.iouRequestType,
splitShares: transaction.splitShares,
splitPayerAccountIDs: transaction.splitPayerAccountIDs,
taxCode: transactionTaxCode,
taxAmount: transactionTaxAmount,
});
Expand Down Expand Up @@ -1224,7 +1207,6 @@ function IOURequestStepConfirmation({
isPerDiemRequest={isPerDiemRequest}
shouldShowSmartScanFields={shouldShowSmartScanFields}
action={action}
payeePersonalDetails={payeePersonalDetails}
isConfirmed={isConfirmed}
isConfirming={isConfirming}
iouIsReimbursable={transaction?.reimbursable}
Expand Down
100 changes: 0 additions & 100 deletions src/pages/iou/request/step/IOURequestStepSplitPayer.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions src/types/form/DebugTransactionForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const INPUT_IDS = {
ORIGINAL_CURRENCY: 'originalCurrency',
IS_LOADING: 'isLoading',
SPLIT_SHARES: 'splitShares',
SPLIT_PAYER_ACCOUNT_I_DS: 'splitPayerAccountIDs',
SHOULD_SHOW_ORIGINAL_AMOUNT: 'shouldShowOriginalAmount',
ACTIONABLE_WHISPER_REPORT_ACTION_ID: 'actionableWhisperReportActionID',
LINKED_TRACKED_EXPENSE_REPORT_ACTION: 'linkedTrackedExpenseReportAction',
Expand Down Expand Up @@ -96,7 +95,6 @@ type DebugTransactionForm = Form<
[INPUT_IDS.ORIGINAL_CURRENCY]: string;
[INPUT_IDS.IS_LOADING]: boolean;
[INPUT_IDS.SPLIT_SHARES]: string;
[INPUT_IDS.SPLIT_PAYER_ACCOUNT_I_DS]: string;
[INPUT_IDS.SHOULD_SHOW_ORIGINAL_AMOUNT]: boolean;
[INPUT_IDS.ACTIONABLE_WHISPER_REPORT_ACTION_ID]: string;
[INPUT_IDS.LINKED_TRACKED_EXPENSE_REPORT_ACTION]: string;
Expand Down
3 changes: 0 additions & 3 deletions src/types/onyx/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,6 @@ type Transaction = OnyxCommon.OnyxValueWithOfflineFeedback<
/** Holds individual shares of a split keyed by accountID, only used locally */
splitShares?: SplitShares;

/** Holds the accountIDs of accounts who paid the split, for now only supports a single payer */
splitPayerAccountIDs?: number[];

/** Whether the user input should be kept */
shouldShowOriginalAmount?: boolean;

Expand Down
1 change: 0 additions & 1 deletion tests/actions/IOUTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6311,7 +6311,6 @@ describe('actions/IOU', () => {
transactionID: CONST.IOU.OPTIMISTIC_TRANSACTION_ID,
isFromGlobalCreate: true,
merchant: '(none)',
splitPayerAccountIDs: [3],
};

const currentDate = '2025-04-01';
Expand Down
1 change: 0 additions & 1 deletion tests/data/Invoice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ const transaction: OnyxEntry<OnyxTypes.Transaction> = {
transactionID: '1',
isFromGlobalCreate: true,
merchant: '(none)',
splitPayerAccountIDs: [32],
shouldShowOriginalAmount: true,
participants: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ const DEFAULT_SPLIT_TRANSACTION: Transaction = {
participantsAutoAssigned: true,
reimbursable: true,
reportID: REPORT_ID,
splitPayerAccountIDs: [ACCOUNT_ID],
transactionID: TRANSACTION_ID,
};

Expand Down
Loading