-
Notifications
You must be signed in to change notification settings - Fork 3.7k
fix: revert revert taxes field #78358
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
Merged
cristipaval
merged 24 commits into
Expensify:main
from
callstack-internal:feat/72238-taxes-field-v3
Jan 21, 2026
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
0370977
fix: revert revert tsxes field
koko57 358c956
fix: recalculate the taxAmount when currency changes
koko57 be5ec78
fix: resolve conflicts
koko57 4c331ea
fix: remove the fix for the currency
koko57 b2fe60e
fix: resolve conflicts
koko57 e05ff24
fix: recalculate tax amount
koko57 a949f54
fix: resolve conflicts
koko57 b565775
fix: resolve conflicts
koko57 9eb8d7b
Merge branch 'main' into feat/72238-taxes-field-v3
koko57 398f0a1
fix: change and recalculate tax rate on currency change
koko57 11ad644
fix: resolve conflicts
koko57 9d3be2b
fix: resolve conflicts
koko57 875ea8c
Merge branch 'main' into feat/72238-taxes-field-v3
koko57 7f4396a
Merge branch 'main' into feat/72238-taxes-field-v3
koko57 ab592f0
fix: add policyID to track expense params
koko57 297f468
fix: prettier
koko57 3c66205
fix: fallback to tax value when names not match
koko57 6c9280c
fix: resolve conflicts
koko57 384f30d
fix: resolve conflicts
koko57 1c4c39b
fix: update taxValue according to new taxRate
koko57 1f6fac4
fix: show tax rate name when created offline
koko57 8575e03
fix: tests
koko57 0778490
fix: only check if tax rate matches when taxCode on the transaction o…
koko57 9ac724f
fix: resolve conflicts
koko57 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import type {OnyxEntry} from 'react-native-onyx'; | ||
| import {isExpenseUnreported} from '@libs/TransactionUtils'; | ||
| import CONST from '@src/CONST'; | ||
| import ONYXKEYS from '@src/ONYXKEYS'; | ||
| import type {Policy, Report, Transaction} from '@src/types/onyx'; | ||
| import useOnyx from './useOnyx'; | ||
| import usePolicyForMovingExpenses from './usePolicyForMovingExpenses'; | ||
|
|
||
| type UsePolicyForTransactionParams = { | ||
| /** The transaction to determine the policy for */ | ||
| transaction: OnyxEntry<Transaction>; | ||
|
|
||
| /** The report associated with the transaction */ | ||
| report: OnyxEntry<Report>; | ||
|
|
||
| /** The current action being performed */ | ||
| action: string; | ||
|
|
||
| /** The type of IOU (split, track, submit, etc.) */ | ||
| iouType: string; | ||
| }; | ||
|
|
||
| type UsePolicyForTransactionResult = { | ||
| /** The policy to use for the transaction */ | ||
| policy: OnyxEntry<Policy>; | ||
| }; | ||
|
|
||
| function usePolicyForTransaction({transaction, report, action, iouType}: UsePolicyForTransactionParams): UsePolicyForTransactionResult { | ||
| const {policyForMovingExpenses} = usePolicyForMovingExpenses(); | ||
| const isUnreportedExpense = isExpenseUnreported(transaction); | ||
| const isCreatingTrackExpense = action === CONST.IOU.ACTION.CREATE && iouType === CONST.IOU.TYPE.TRACK; | ||
|
|
||
| const [reportPolicy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`, {canBeMissing: true}); | ||
| const policy = isUnreportedExpense || isCreatingTrackExpense ? policyForMovingExpenses : reportPolicy; | ||
|
|
||
| return {policy}; | ||
| } | ||
|
|
||
| export default usePolicyForTransaction; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why are we doing this?
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.
because in some cases the amount was negative. We need to send only positive value
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.
https://expensify.slack.com/archives/C09CD19HXFA/p1765279004474739