From 6461753d6cfce680501401dca05c843b1102db85 Mon Sep 17 00:00:00 2001 From: Youssef Lourayad Date: Mon, 16 Oct 2023 17:51:44 +0800 Subject: [PATCH] Fix error when keeping default date when splitting --- src/libs/actions/IOU.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js index 4c1f24698655..4e3fc91fc4d9 100644 --- a/src/libs/actions/IOU.js +++ b/src/libs/actions/IOU.js @@ -1699,15 +1699,23 @@ function completeSplitBill(chatReportID, reportAction, updatedTransaction, sessi failureData.push(...oneOnOneFailureData); }); + const { + amount: transactionAmount, + currency: transactionCurrency, + created: transactionCreated, + merchant: transactionMerchant, + comment: transactionComment, + } = ReportUtils.getTransactionDetails(updatedTransaction); + API.write( 'CompleteSplitBill', { transactionID, - amount: updatedTransaction.modifiedAmount, - currency: updatedTransaction.modifiedCurrency, - created: updatedTransaction.modifiedCreated, - merchant: updatedTransaction.modifiedMerchant, - comment: updatedTransaction.comment.comment, + amount: transactionAmount, + currency: transactionCurrency, + created: transactionCreated, + merchant: transactionMerchant, + comment: transactionComment, splits: JSON.stringify(splits), }, {optimisticData, successData, failureData},