Skip to content

Commit

Permalink
Merge pull request Expensify#30802 from abdel-h66/30454-fix-billable
Browse files Browse the repository at this point in the history
fix: correctly setting up the billable value of IOU
  • Loading branch information
MariaHCD authored Nov 10, 2023
2 parents 99dd643 + 668e0b7 commit d4a97bc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/pages/iou/steps/MoneyRequestConfirmPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,13 @@ function MoneyRequestConfirmPage(props) {
if (policyExpenseChat) {
Policy.openDraftWorkspaceRequest(policyExpenseChat.policyID);
}
// Verification to reset billable with a default value, when value in IOU was changed
if (typeof props.iou.billable !== 'boolean') {
IOU.setMoneyRequestBillable(lodashGet(props.policy, 'defaultBillable', false));
}
}, [isOffline, participants, props.iou.billable, props.policy]);

const defaultBillable = lodashGet(props.policy, 'defaultBillable', false);
useEffect(() => {
IOU.setMoneyRequestBillable(defaultBillable);
}, [defaultBillable, isOffline]);

useEffect(() => {
if (!props.iou.receiptPath || !props.iou.receiptFilename) {
return;
Expand Down

0 comments on commit d4a97bc

Please sign in to comment.