Skip to content
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

Currency format is hard coded #33

Open
volkswagner opened this issue Dec 9, 2024 · 1 comment
Open

Currency format is hard coded #33

volkswagner opened this issue Dec 9, 2024 · 1 comment

Comments

@volkswagner
Copy link

Shouldn't currency be dynamically displayed based on user or global settings?

frappe@f15:~/frappe-bench/apps/erpnext_shipping$ grep -rl "EUR" ./
./erpnext_shipping/public/js/shipment_service_selector.html
./erpnext_shipping/public/dist/js/shipping.bundle.QIZQZYU7.js.map
./erpnext_shipping/public/dist/js/shipping.bundle.QIZQZYU7.js

frappe@f15:~/frappe-bench/apps/erpnext_shipping$ grep -rl "currency" ./ ./.github/workflows/linters.yml ./.eslintrc ./erpnext_shipping/public/js/shipment_service_selector.html ./erpnext_shipping/public/dist/js/shipping.bundle.QIZQZYU7.js.map ./erpnext_shipping/public/dist/js/shipping.bundle.QIZQZYU7.js frappe@f15:~/frappe-bench/apps/erpnext_shipping$ less erpnext_shipping/public/js/shipment_service_selector.html frappe@f15:~/frappe-bench/apps/erpnext_shipping$ less erpnext_shipping/public/js/shipment_service_selector.html | grep "currency" <td class="service-info" style="width:20%;">{{ format_currency(data.preferred_services[i].total_price, "EUR", 2) }}</td> <td class="service-info" style="width:20%;">{{ format_currency(data.other_services[i].total_price, "EUR", 2) }}</td>

@volkswagner
Copy link
Author

volkswagner commented Dec 9, 2024

I'm interested in extending erpnext-shipping to include EasyPost.com.
How to best handle currency?
Should we change the hardcoded value "EUR" by creating a peferred_currency setting in
ERPNext-shipping settings or is there a more elegant solution using the company default currency?

If the currency is dependant on the service provider's output, perhaps we should have a 'currency' field in each shipper's docType?

EDIT-1
I tried editing the following files, changing "EUR" to "USD" but shipping rates are still displayed in Euros:
erpnext_shipping/erpnext_shipping/public/dist/js/shipping.bundle.QIZQZYU7.js.map
erpnext_shipping/erpnext_shipping/public/dist/js/shipping.bundle.QIZQZYU7.js.
erpnext_shipping/erpnext_shipping/public/js/shipment_service_selector.html

EDIT-2
There must have been some sort of caching going on. After enabling (was disabled) SendCloud, USD now shows in "Fetch Shipping Rates".

I'm still interested in best practice to make this more dynamic. Perhaps creating an erpnext-shippping settings doctype with preferred currency and perhaps metric vs SAE will be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant