Open mark-omarov opened 8 months ago
The money library under the hood is : https://github.com/frappe/pesa
internalPrecision
maps to pesa precision
parameter, and displayPrecision
maps to display
in https://github.com/frappe/pesa#options-and-value
I would believe that setting internalPrecision to 0 should work
What if you open your book file with sqlite and try to update the settings like this
update SingleValue set value = 0 where (parent, fieldname) = ('SystemSettings', 'displayPrecision');
update SingleValue set value = 0 where (parent, fieldname) = ('SystemSettings', 'internalPrecision');
then reopen it in Books?
Always work on backup copies.
Apparently for tax calculation, the calculation is performed over integers with no decimals: https://docs.oracle.com/en/applications/jd-edwards/localizations/9.2/eoajp/what-you-should-know-about-tax-rounding-in-japan.html#u30184160
I since moved on and no longer have the app nor records. Maybe updating values in the DB would help, but I'd imagine this isn't something most users would do themselves.
Description
While working with JPY, I encountered an issue related to incorrect rounding of amounts. I've traced the problem, which appears to be related to how the system handles precision.
Expected behavior: 123.99 should be rounded down to 123 Current behavior: 123.99 rounded up to 124
JPY typically has no decimals, the minimal denominator is 1, and amounts with decimals are typically rounded down to the nearest whole yen.
Setting Display Precision does help hide decimals but does not resolve the incorrect amount.
It might have something to do with
countryInfo.json
andinternalPrecision
fields on theSystemSettings
schema. I haven't figured out how to fix it yet. Changingcurrency_fraction
andcurrency_fraction_units
in thecountryInfo.json
doesn't seem to do anything, even after creating a new Organization to instantiate a new DB. Tinkering withinternalPrecision
didn't help it either.Steps to Reproduce
Info
Version:
0.19.0
Platform:darwin
Path:/edit/SalesInvoice/New Sales Invoice 01
Language:-
Country:jp