diff --git a/src/libs/API/parameters/CompleteSplitBillParams.ts b/src/libs/API/parameters/CompleteSplitBillParams.ts index a1731d32fcc..67ca011b70d 100644 --- a/src/libs/API/parameters/CompleteSplitBillParams.ts +++ b/src/libs/API/parameters/CompleteSplitBillParams.ts @@ -10,6 +10,7 @@ type CompleteSplitBillParams = { splits: string; taxCode?: string; taxAmount?: number; + billable?: boolean; }; export default CompleteSplitBillParams; diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 1e3f8e10eb7..d1f987b33bd 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -4961,6 +4961,7 @@ function completeSplitBill(chatReportID: string, reportAction: OnyxTypes.ReportA tag: transactionTag, taxCode: transactionTaxCode, taxAmount: transactionTaxAmount, + billable: transactionBillable, } = ReportUtils.getTransactionDetails(updatedTransaction) ?? {}; const parameters: CompleteSplitBillParams = { @@ -4975,6 +4976,7 @@ function completeSplitBill(chatReportID: string, reportAction: OnyxTypes.ReportA splits: JSON.stringify(splits), taxCode: transactionTaxCode, taxAmount: transactionTaxAmount, + billable: transactionBillable, }; API.write(WRITE_COMMANDS.COMPLETE_SPLIT_BILL, parameters, {optimisticData, successData, failureData}); diff --git a/src/pages/iou/SplitBillDetailsPage.tsx b/src/pages/iou/SplitBillDetailsPage.tsx index d31c67624bd..24bac1a0dde 100644 --- a/src/pages/iou/SplitBillDetailsPage.tsx +++ b/src/pages/iou/SplitBillDetailsPage.tsx @@ -146,6 +146,9 @@ function SplitBillDetailsPage({personalDetails, report, route, reportActions, tr isPolicyExpenseChat={ReportUtils.isPolicyExpenseChat(report)} policyID={ReportUtils.isPolicyExpenseChat(report) ? report?.policyID : undefined} action={isEditingSplitBill ? CONST.IOU.ACTION.EDIT : CONST.IOU.ACTION.CREATE} + onToggleBillable={(billable) => { + IOU.setDraftSplitTransaction(transaction?.transactionID ?? '-1', {billable}); + }} /> )}