Feature: Add the ability to configure tax rates on distance rates#42141
Feature: Add the ability to configure tax rates on distance rates#42141MonilBhavsar merged 48 commits intoExpensify:mainfrom
Conversation
|
The WebPR was deployed to staging if you want to resume on getting this merge ready! |
|
Is this ready for review? |
|
Mostly looks good. Looks like we need spanish translations here for some text entered in English |
|
@trjExpensify @MonilBhavsar I've completed bullets 1 and 2, but encountered some issues with the APIs in bullets 3 and 4. I've already raised the problem in the issue. |
|
@eVoloshchak 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] |
|
We need Spanish translations here for some text entered in English and asking in here |
| const currency = rate.currency ?? CONST.CURRENCY.USD; | ||
| const currentTaxReclaimableOnValue = rate.attributes?.taxClaimablePercentage && rate.rate ? (rate.attributes.taxClaimablePercentage * rate.rate) / 100 : ''; | ||
| const submitTaxReclaimableOn = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.POLICY_DISTANCE_RATE_TAX_RECLAIMABLE_ON_EDIT_FORM>) => { | ||
| Policy.updatePolicyDistanceRateValue(policyID, customUnit, [ |
There was a problem hiding this comment.
I think we should make it 1:1:1 since this function is for updating the rate value. I'll add a new API, which we can use with similar parameters.
There was a problem hiding this comment.
Can we please use UpdateDistanceTaxClaimableValue here and UpdateDistanceTaxRate where we update tax rate?
There was a problem hiding this comment.
I added 2 function UpdateDistanceTaxClaimableValue && UpdateDistanceTaxRate, its use the same parameters and the same API with function updatePolicyDistanceRateValue
When the new API is done, please let me know so I can fix here
|
@nkdengineer conflicts here. |
src/pages/workspace/distanceRates/PolicyDistanceRateDetailsPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/distanceRates/PolicyDistanceRateTaxRateSelectionModal.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/distanceRates/PolicyDistanceRateTaxRateSelectionModal.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/distanceRates/PolicyDistanceRatesSettingsPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/workspace/distanceRates/PolicyDistanceRateDetailsPage.tsx
Outdated
Show resolved
Hide resolved
@eVoloshchak Fixed these bug and update your suggestion. Ready for review again. |
| onToggle={toggleRate} | ||
| accessibilityLabel={translate('workspace.distanceRates.enableRate')} | ||
| <ScrollView contentContainerStyle={styles.flexGrow1}> | ||
| <View> |
There was a problem hiding this comment.
Not critical: I think we can safely remove this <View>
|
Bug: sometimes the amount is displayed as 0 when you try to edit it. I'm not sure what are the steps to reproduce this reliably, but I've hit this bug quite a few times just by updating the amount continuously. This might be a BE issue (did not verify this), but the responses look fine Screen.Recording.2024-06-05.at.18.26.18.movScreen.Recording.2024-06-05.at.18.22.05.mov |
|
Not able to reproduce this ^ Screen.Recording.2024-06-05.at.10.10.47.PM.mov |
|
Noticed a small bug, we can fix it as followup - |
|
I can reproduce this bug. Some time the |
|
Thanks for the quick fix @nkdengineer! Looks good to me. |
MonilBhavsar
left a comment
There was a problem hiding this comment.
Looks good! Let's ship it 🚀
|
Nice teamwork on this @nkdengineer @eVoloshchak @trjExpensify 🤝 |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
Wahoo! Nice work ❤️ |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.4.81-11 🚀
|
| <SelectionList | ||
| sections={[{data: taxRateItems}]} | ||
| ListItem={RadioListItem} | ||
| onSelectRow={onTaxRateChange} | ||
| initiallyFocusedOptionKey={taxRateItems.find((item) => item.isSelected)?.keyForList} |
There was a problem hiding this comment.
it's recommended to use TaxPicker component
More context here: #43613 (comment)
| /> | ||
| </OfflineWithFeedback> | ||
| {policy?.areCategoriesEnabled && OptionsListUtils.hasEnabledOptions(policyCategories ?? {}) && ( | ||
| <ScrollView contentContainerStyle={styles.flexGrow1}> |
There was a problem hiding this comment.
FYI, this bug: #48928 was missed in this PR. More details can be found in this proposal: #48928 (comment)
Details
Fixed Issues
$ #41574
PROPOSAL: #41574 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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.mov
Android: mWeb Chrome
android-mweb.mov
iOS: Native
ios.mov
iOS: mWeb Safari
ios-mweb.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov