-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Add the ability to configure tax rates on distance rates #42141
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please use UpdateDistanceTaxClaimableValue
here and UpdateDistanceTaxRate
where we update tax rate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not critical: I think we can safely remove this <View>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eVoloshchak Updated.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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