Skip to content

Commit

Permalink
Merge pull request Expensify#45319 from nkdengineer/fix/44920
Browse files Browse the repository at this point in the history
fix billable on scan split bill
  • Loading branch information
NikkiWines authored Jul 18, 2024
2 parents 0b778a7 + 7b5ddce commit d4aebb3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/libs/API/parameters/CompleteSplitBillParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type CompleteSplitBillParams = {
splits: string;
taxCode?: string;
taxAmount?: number;
billable?: boolean;
};

export default CompleteSplitBillParams;
2 changes: 2 additions & 0 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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});
Expand Down
3 changes: 3 additions & 0 deletions src/pages/iou/SplitBillDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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});
}}
/>
)}
</View>
Expand Down

0 comments on commit d4aebb3

Please sign in to comment.