Skip to content

Commit

Permalink
Merge pull request #35935 from tienifr/fix/35375
Browse files Browse the repository at this point in the history
fix: Copy to clipboard on the system message for paid expense copies negative amount
  • Loading branch information
grgia authored Feb 21, 2024
2 parents 86a91bb + 145f501 commit bb658c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3300,9 +3300,10 @@ function getSendMoneyParams(
}

function getPayMoneyRequestParams(chatReport: OnyxTypes.Report, iouReport: OnyxTypes.Report, recipient: Participant, paymentMethodType: PaymentMethodType): PayMoneyRequestData {
const total = iouReport.total ?? 0;
const optimisticIOUReportAction = ReportUtils.buildOptimisticIOUReportAction(
CONST.IOU.REPORT_ACTION_TYPE.PAY,
-(iouReport.total ?? 0),
ReportUtils.isExpenseReport(iouReport) ? -total : total,
iouReport.currency ?? '',
'',
[recipient],
Expand Down
2 changes: 1 addition & 1 deletion tests/actions/IOUTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1742,7 +1742,7 @@ describe('actions/IOU', () => {
}),
]),
originalMessage: expect.objectContaining({
amount: -amount,
amount,
paymentType: CONST.IOU.PAYMENT_TYPE.VBBA,
type: 'pay',
}),
Expand Down

0 comments on commit bb658c8

Please sign in to comment.