Repository navigation
Allow negative per diem amounts - #77974
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
trjExpensify
left a comment
There was a problem hiding this comment.
Yep, this should be allowed!
|
@nyomanjyotisa can you resolve conflicts please? |
|
@FitseTLT sure, I've merged with the latest main |
|
@nyomanjyotisa please give an example negative perdiem rate to create a negative perdiem expense. |
|
Got it, I’ve attached the rate file with a negative per diem rate in the PR description |
|
@nyomanjyotisa I meant the step, something similar to the issue's testing step
|
|
Oh, sorry about that, updated the test step accordingly |
| const perDiemAmountString = convertToFrontendAmountAsString(perDiemAmountInCents, iouCurrencyCode); | ||
| const decimals = getCurrencyDecimals(iouCurrencyCode); | ||
| return validateAmount(perDiemAmountString, decimals); | ||
| return validateAmount(perDiemAmountString, decimals, CONST.IOU.AMOUNT_MAX_LENGTH, true); |
There was a problem hiding this comment.
| return validateAmount(perDiemAmountString, decimals, CONST.IOU.AMOUNT_MAX_LENGTH, true); | |
| return validateAmount(perDiemAmountString, decimals, undefined, true); |
And also please add a unit test.
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2026-01-02.20-07-55.mp4Android: mWeb Chrome2026-01-02.22-30-59.mp4iOS: HybridApp2026-01-02.20-48-13.mp4iOS: mWeb SafariUploading 2026-01-02 22-23-24.mp4… MacOS: Chrome / Safari2026-01-02.22-22-51.mp4 |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/jasperhuangg in version: 9.2.93-0 🚀
|
|
🚀 Deployed to production by https://github.com/arosiclair in version: 9.2.93-1 🚀
|
Allow negative per diem amounts
Explanation of Change
Allow negative per diem amounts during validation by enabling
shouldAllowNegativeFixed Issues
$ #76900
PROPOSAL: #76900 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android-Native-2.mp4
Android: mWeb Chrome
Android-mWeb.Chrome-2.mp4
iOS: Native
iOS-Native-2.mp4
iOS: mWeb Safari
iOS-mWeb.Safari-2.mp4
MacOS: Chrome / Safari
MacOS-Chrome-2.mp4
PerDiem-2024-11-21 10_02_48.939.csv