mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 15:39:20 +00:00
Merge pull request #35521 from frappe/mergify/bp/version-14-hotfix/pr-35518
fix:higher precision causes ERR to misjudge zero bal acc as non-zero (backport #35518)
This commit is contained in:
@@ -12,6 +12,7 @@ from frappe.utils import flt, get_link_to_form
|
|||||||
|
|
||||||
import erpnext
|
import erpnext
|
||||||
from erpnext.accounts.doctype.journal_entry.journal_entry import get_balance_on
|
from erpnext.accounts.doctype.journal_entry.journal_entry import get_balance_on
|
||||||
|
from erpnext.accounts.utils import get_currency_precision
|
||||||
from erpnext.setup.utils import get_exchange_rate
|
from erpnext.setup.utils import get_exchange_rate
|
||||||
|
|
||||||
|
|
||||||
@@ -170,6 +171,15 @@ class ExchangeRateRevaluation(Document):
|
|||||||
.run(as_dict=True)
|
.run(as_dict=True)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# round off balance based on currency precision
|
||||||
|
currency_precision = get_currency_precision()
|
||||||
|
for acc in account_details:
|
||||||
|
acc.balance_in_account_currency = flt(acc.balance_in_account_currency, currency_precision)
|
||||||
|
acc.balance = flt(acc.balance, currency_precision)
|
||||||
|
acc.zero_balance = (
|
||||||
|
True if (acc.balance == 0 or acc.balance_in_account_currency == 0) else False
|
||||||
|
)
|
||||||
|
|
||||||
return account_details
|
return account_details
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user