Skip to content

Commit 838784b

Browse files
authored
Merge pull request #60333 from daledah/fix/60097
fix: show correct amount text when unapprove expense
2 parents 28fd6af + cc785d2 commit 838784b

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/components/ReportActionItem/MoneyRequestView.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,10 @@ function MoneyRequestView({report, shouldShowAnimatedBackground, readonly = fals
279279
if (!isDistanceRequest && !isPerDiemRequest) {
280280
amountDescription += ` ${CONST.DOT_SEPARATOR} ${translate('iou.cash')}`;
281281
}
282-
if (isApproved) {
283-
amountDescription += ` ${CONST.DOT_SEPARATOR} ${translate('iou.approved')}`;
284-
} else if (isCancelled) {
282+
if (isCancelled) {
285283
amountDescription += ` ${CONST.DOT_SEPARATOR} ${translate('iou.canceled')}`;
284+
} else if (isApproved) {
285+
amountDescription += ` ${CONST.DOT_SEPARATOR} ${translate('iou.approved')}`;
286286
} else if (isSettled) {
287287
amountDescription += ` ${CONST.DOT_SEPARATOR} ${translate('iou.settledExpensify')}`;
288288
}

src/libs/actions/IOU.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9070,6 +9070,7 @@ function unapproveExpenseReport(expenseReport: OnyxEntry<OnyxTypes.Report>) {
90709070
pendingFields: {
90719071
partial: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE,
90729072
},
9073+
isCancelledIOU: false,
90739074
},
90749075
};
90759076

@@ -9117,6 +9118,16 @@ function unapproveExpenseReport(expenseReport: OnyxEntry<OnyxTypes.Report>) {
91179118
key: `${ONYXKEYS.COLLECTION.NEXT_STEP}${expenseReport.reportID}`,
91189119
value: currentNextStep,
91199120
},
9121+
{
9122+
onyxMethod: Onyx.METHOD.MERGE,
9123+
key: `${ONYXKEYS.COLLECTION.REPORT}${expenseReport.reportID}`,
9124+
value: {
9125+
pendingFields: {
9126+
partial: null,
9127+
},
9128+
isCancelledIOU: true,
9129+
},
9130+
},
91209131
];
91219132

91229133
if (expenseReport.parentReportID && expenseReport.parentReportActionID) {
@@ -9329,6 +9340,7 @@ function cancelPayment(expenseReport: OnyxEntry<OnyxTypes.Report>, chatReport: O
93299340
lastMessageHtml: getReportActionHtml(optimisticReportAction),
93309341
stateNum,
93319342
statusNum,
9343+
isCancelledIOU: true,
93329344
},
93339345
},
93349346
];
@@ -9367,6 +9379,7 @@ function cancelPayment(expenseReport: OnyxEntry<OnyxTypes.Report>, chatReport: O
93679379
value: {
93689380
statusNum: CONST.REPORT.STATUS_NUM.REIMBURSED,
93699381
isWaitingOnBankAccount: expenseReport.isWaitingOnBankAccount,
9382+
isCancelledIOU: false,
93709383
},
93719384
},
93729385
];

0 commit comments

Comments
 (0)