mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 15:39:20 +00:00
chore: consider currency precision
This commit is contained in:
@@ -48,6 +48,7 @@ class BankClearance(Document):
|
|||||||
entries = []
|
entries = []
|
||||||
|
|
||||||
# get entries from all the apps
|
# 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"):
|
for method_name in frappe.get_hooks("get_payment_entries_for_bank_clearance"):
|
||||||
entries += (
|
entries += (
|
||||||
frappe.get_attr(method_name)(
|
frappe.get_attr(method_name)(
|
||||||
@@ -77,7 +78,7 @@ class BankClearance(Document):
|
|||||||
if not d.get("account_currency"):
|
if not d.get("account_currency"):
|
||||||
d.account_currency = default_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.amount = formatted_amount + " " + (_("Dr") if amount > 0 else _("Cr"))
|
||||||
d.posting_date = getdate(d.posting_date)
|
d.posting_date = getdate(d.posting_date)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user