-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix(pwa): multicurrency support in expense & advance forms #4083
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
ruchamahabal
merged 30 commits into
frappe:develop
from
iamkhanraheel:fix/v16_changes_pwa
Apr 6, 2026
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
c1bba6b
fix: update currency & exchange rate, update base & transaction field…
iamkhanraheel 370b469
fix: advance child table row selection as per the sanctioned amount i…
iamkhanraheel 2b0dc14
fix: update base fields value as per the exchange rate in real time
iamkhanraheel a767d69
fix(Link): reload link field options when filters change
ruchamahabal 0912671
fix: update currency in advance account filters, remove fetching defa…
iamkhanraheel cde96b3
fix: add currency filter in payable account of expense claim
iamkhanraheel f7ef13f
fix: set exchange rate to 0 if currency not set, correct typo
iamkhanraheel 1164ff8
fix: formatting
iamkhanraheel 604dc07
fix: currency not showing up in recent expenses
ruchamahabal 6972cea
fix(Link): new options don't populate when search term changes
ruchamahabal 3908367
fix: fetching exchange rate fails when expense currency changes from …
ruchamahabal 0f9ef2b
fix: don't pass currency in expense claim tables, use doc currency
ruchamahabal f18d124
fix: remove all basefield conversion & label update
iamkhanraheel 0874b5a
fix: watch for currency change only to update label, cleanup currency…
iamkhanraheel fd43c57
fix(expense_claim_pwa): fetch salary employee from employee master
iamkhanraheel 6457589
fix: don't pass currency in expense advances, use doc currency
ruchamahabal f7ecbfa
fix: set exchange rate first, clear advances table on API response
ruchamahabal c49a2fb
fix(Link): options not loading once value is set
ruchamahabal 26e5017
fix: move expenses table currency update call to onSuccess of table f…
ruchamahabal e6c66bb
chore: remove unused flt function
ruchamahabal e6dbfbd
fix: don't reload form fields on currency change
ruchamahabal 55ddf2a
refactor: use currency conversion as a composable instead of explicit…
ruchamahabal e57651a
fix: apply currency filter in employee advance account on currency ch…
ruchamahabal cdcc2e6
fix: show correct currency in expense preview
ruchamahabal 1a3754d
fix: pass expense claim ref to composable
ruchamahabal 2743cad
fix: wire currency conversion labels in expense taxes
ruchamahabal 378b0c2
fix: fields clipping in expense item entry
ruchamahabal 8cc9b68
fix: has permission check
ruchamahabal 7af1034
fix: Advance allocation function like before
ruchamahabal 021bf70
fix: retain unallocated advances cards & allocated advances selection…
ruchamahabal 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
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
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,41 @@ | ||
| import { watch } from "vue" | ||
|
|
||
| export function useCurrencyConversion(formFields, docRef, fieldsToConvert = []) { | ||
| /** | ||
| * Accepts a formFields resource, a doc ref and an array of fieldnames which are currency fields and need to have the currency in their label | ||
| * Watches and updates the labels of the currency fields to include the currency in labels | ||
| */ | ||
| const currencyFields = new Set([...fieldsToConvert]) | ||
|
|
||
| const updateLabels = () => { | ||
| formFields.data?.forEach((field) => { | ||
| if (!field?.fieldname) return | ||
| if (!currencyFields.has(field.fieldname)) return | ||
|
|
||
| if (!field._original_label && field.label) { | ||
| field._original_label = field.label.replace(/\([^\)]*\)/g, "").trim() | ||
| } | ||
| if (currencyFields.has(field.fieldname)) { | ||
| field.label = `${field._original_label} (${docRef.value.currency})` | ||
| } | ||
| }) | ||
| } | ||
|
|
||
| watch( | ||
| () => docRef.value?.currency, | ||
| () => { | ||
| updateLabels() | ||
| }, | ||
| { immediate: true } | ||
| ) | ||
|
|
||
| watch( | ||
| () => formFields.data, | ||
| () => { | ||
| updateLabels() | ||
| }, | ||
| { deep: true, immediate: true } | ||
| ) | ||
|
|
||
| return { updateLabels } | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.