Skip to content

Commit

Permalink
Merge pull request #35141 from s-alves10/fix/issue-34526
Browse files Browse the repository at this point in the history
fix: include created parameter in split bill API calls
  • Loading branch information
aldo-expensify authored Feb 15, 2024
2 parents 6914b13 + ada4847 commit 98a51b3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/libs/API/parameters/SplitBillParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ type SplitBillParams = {
comment: string;
currency: string;
merchant: string;
created: string;
category: string;
tag: string;
billable: boolean;
Expand Down
14 changes: 11 additions & 3 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1489,6 +1489,7 @@ function createSplitsAndOnyxData(
comment: string,
currency: string,
merchant: string,
created: string,
category: string,
tag: string,
existingSplitChatReportID = '',
Expand All @@ -1508,7 +1509,7 @@ function createSplitsAndOnyxData(
currency,
CONST.REPORT.SPLIT_REPORTID,
comment,
'',
created,
'',
'',
merchant || Localize.translateLocal('iou.request'),
Expand Down Expand Up @@ -1720,7 +1721,7 @@ function createSplitsAndOnyxData(
currency,
oneOnOneIOUReport.reportID,
comment,
'',
created,
CONST.IOU.TYPE.SPLIT,
splitTransaction.transactionID,
merchant || Localize.translateLocal('iou.request'),
Expand Down Expand Up @@ -1850,11 +1851,13 @@ function splitBill(
comment: string,
currency: string,
merchant: string,
created: string,
category: string,
tag: string,
existingSplitChatReportID = '',
billable = false,
) {
const currentCreated = DateUtils.enrichMoneyRequestTimestamp(created);
const {splitData, splits, onyxData} = createSplitsAndOnyxData(
participants,
currentUserLogin,
Expand All @@ -1863,6 +1866,7 @@ function splitBill(
comment,
currency,
merchant,
currentCreated,
category,
tag,
existingSplitChatReportID,
Expand All @@ -1877,6 +1881,7 @@ function splitBill(
comment,
category,
merchant,
created: currentCreated,
tag,
billable,
transactionID: splitData.transactionID,
Expand All @@ -1903,18 +1908,21 @@ function splitBillAndOpenReport(
comment: string,
currency: string,
merchant: string,
created: string,
category: string,
tag: string,
billable: boolean,
) {
const {splitData, splits, onyxData} = createSplitsAndOnyxData(participants, currentUserLogin, currentUserAccountID, amount, comment, currency, merchant, category, tag);
const currentCreated = DateUtils.enrichMoneyRequestTimestamp(created);
const {splitData, splits, onyxData} = createSplitsAndOnyxData(participants, currentUserLogin, currentUserAccountID, amount, comment, currency, merchant, currentCreated, category, tag);

const parameters: SplitBillParams = {
reportID: splitData.chatReportID,
amount,
splits: JSON.stringify(splits),
currency,
merchant,
created: currentCreated,
comment,
category,
tag,
Expand Down
2 changes: 2 additions & 0 deletions src/pages/iou/request/step/IOURequestStepConfirmation.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ function IOURequestStepConfirmation({
trimmedComment,
transaction.currency,
transaction.merchant,
transaction.created,
transaction.category,
transaction.tag,
report.reportID,
Expand All @@ -303,6 +304,7 @@ function IOURequestStepConfirmation({
trimmedComment,
transaction.currency,
transaction.merchant,
transaction.created,
transaction.category,
transaction.tag,
transaction.billable,
Expand Down

0 comments on commit 98a51b3

Please sign in to comment.