Allow setting merchant for split bill#30721
Conversation
|
@aimane-chnaif Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
Please pull main as the branch is 1 week behind |
|
Done @aimane-chnaif |
|
bump @aimane-chnaif |
|
Custom merchant seems not working Screen.Recording.2023-11-14.at.9.08.06.PM.mov |
|
Should be fixed now @aimane-chnaif, sorry about that. I remember pushing this commit but I guess something went wrong and I didn't notice. |
| !_.isEmpty(requestMerchant) && !props.isBillSplit && requestMerchant !== CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT && requestMerchant !== CONST.TRANSACTION.DEFAULT_MERCHANT; | ||
| const shouldShowDescription = !_.isEmpty(description) && !shouldShowMerchant; | ||
| const shouldShowMerchant = !_.isEmpty(requestMerchant) && requestMerchant !== CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT && requestMerchant !== CONST.TRANSACTION.DEFAULT_MERCHANT; | ||
| const merchantOrDescription = shouldShowMerchant ? requestMerchant : description || ''; |
There was a problem hiding this comment.
Our design is we either show the merchant if it's not the default one or empty, otherwise we show the description.
There was a problem hiding this comment.
cc @trjExpensify @shawnborton this is going to fix the merchant having a small font size as well. How does this look like?
There was a problem hiding this comment.
That looks good to me, but I'll defer to Shawn.
There was a problem hiding this comment.
That looks good to me. Can you also take a look at this one while you are here? Thanks!
|
Please fix conflict when you're back |
|
@marcochavezf can you please check #30680 (comment)? |
|
#31604 is conflicting on MoneyRequestPreview |
|
Hmm if I understand correctly, this PR and #31604 are fixing the problem, correct? |
| {(shouldShowDescription || shouldShowMerchant) && <Text style={[styles.colorMuted]}>{merchantOrDescription}</Text>} | ||
| {!isCurrentUserManager && props.shouldShowPendingConversionMessage && ( | ||
| <Text style={[styles.textLabel, styles.colorMuted]}>{translate('iou.pendingConversionMessage')}</Text> | ||
| )} | ||
| {(shouldShowDescription || (shouldShowMerchant && props.isBillSplit)) && ( | ||
| <Text style={[styles.colorMuted]}>{shouldShowDescription ? description : requestMerchant}</Text> | ||
| )} |
There was a problem hiding this comment.
Updated, I think it doesn't look right, also removed muted style for the description or merchant
|
bump @aimane-chnaif, can we try and get this merged today please |
|
The major concern is still remaining |
|
Sorry I missed that, that's an intentional change in this PR. SmartScan should take care of those fields and not the user. |
|
bump @aimane-chnaif |
|
@youssef-lr please pull main. going to re-test now |
|
This maybe out of scope but manually updating split scan fields when offline is ignored Repro step:
Screen.Recording.2023-12-25.at.3.27.13.AM.mov |
|
Yeah it's out of scope. I'll look into that though. Thanks for catching this! |
| '', | ||
| '', | ||
| merchant, | ||
| merchant || Localize.translateLocal('iou.request'), |
There was a problem hiding this comment.
This causes regression when user language is Spanish and merchant is not set
Screen.Recording.2023-12-25.at.4.37.27.AM.mov
There was a problem hiding this comment.
It's okay, we're going to deprecate the Request merchant soon on P2P requests. Here's the plan from a private issue:
Make manual IOU expenses only have manually entered amount and description:
a. Don't show Merchant or Date fields in a hidden "detailed" section
b. Don't show Merchant: Request this is confusing and seems brokenShow Merchant and/or Date on SmartScanned IOU expenses only if they succeeded.
a. Don't show Merchant: Unknown
b. Don't show a RBR if the merchant isn't read
c. If the SmartScan fails to get one or the other, just hide that field -- exactly like a manual requestFor expenses on expense reports, however, require Merchant, Date, and Amount -- and show a RBR if any are missing, for both manual and SmartScanned expenses
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromemchrome.moviOS: Nativeios.moviOS: mWeb Safarimsafari.movMacOS: Chrome / Safariweb.movweb-scan.movMacOS: Desktopdesktop.mov |
|
✋ 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/youssef-lr in version: 1.4.17-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.17-8 🚀
|
| bankAccountRoute={ReportUtils.getBankAccountRoute(report)} | ||
| iouMerchant={transaction.merchant} | ||
| iouCreated={transaction.created} | ||
| isScanRequest={requestType === CONST.IOU.REQUEST_TYPE.SCAN} |


Details
Fixed Issues
$ #29732
$ #29691
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop