chore: consider currency precision

This commit is contained in:
NIYAZ RAZAK
2025-01-13 18:53:59 +03:00
committed by GitHub
parent e529f82392
commit 83bb3926b1

View File

@@ -48,6 +48,7 @@ class BankClearance(Document):
entries = []
# get entries from all the apps
precision = cint(frappe.db.get_default("currency_precision")) or 2
for method_name in frappe.get_hooks("get_payment_entries_for_bank_clearance"):
entries += (
frappe.get_attr(method_name)(
@@ -76,8 +77,8 @@ class BankClearance(Document):
if not d.get("account_currency"):
d.account_currency = default_currency
formatted_amount = fmt_money(abs(amount), 2, d.account_currency)
formatted_amount = fmt_money(abs(amount), precision, d.account_currency)
d.amount = formatted_amount + " " + (_("Dr") if amount > 0 else _("Cr"))
d.posting_date = getdate(d.posting_date)