Custom money format: amount and currency code

I created a custom app to change money formatting from symbol-amount (e.g. $ 10,00) into amount-currency_code (e.g. 10,00 USD).

Installation:

bench get-app GitHub - Semiranis/custom_money_format: ERPNext app changing default money format (symbol and amount) into alternative format (amount and currency code)
bench --site [site_name] install-app custom_money_format

Note: replace [site_name] with your site name (e.g. site1.local)

Why I needed such feature?
Because in Poland we don’t use “zł” before amount - it looks foolish in front, and could be confusing in some cases, because “zł” can mean either “old” Polish Zloty (PLZ) or “new” Polish Zloty (PLN), and 1 PLN = 10000 PLZ.

Why I didn’t contribute such feature directly to frappe?
I tried over a year ago, but I was irritated by waiting a few days for a maintainer to verify a few short lines of code, so I gave up.

5 Likes

Nice one. I didn’t know that we can easily monkey patch such codes. Thank you.

Why does it not work for me?
I tried to override erpnext.controllers.taxes_and_totals.set_rounded_total

Under a customer app i wrote the new methods and used hook to replace the erpnext function

Sorry, it worked for me. Its erpnext.controllers.taxes_and_totals.calculate_taxes_and_totals.set_rounded_total and not erpnext.controllers.taxes_and_totals.set_rounded_total

Here the function is inside the class calculate_taxes_and_totals which is not a DocType class

Thank you so much! it worked for me