From 67876d1026265e87819b30e7e8327bbaafab66ee Mon Sep 17 00:00:00 2001 From: Suraj Shetty Date: Fri, 22 Mar 2019 14:27:37 +0530 Subject: [PATCH] fix: Show amount of entry based on diff of credit and debit --- .../doctype/bank_reconciliation/bank_reconciliation.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py index 0aaed8f530..23e2518306 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py @@ -62,8 +62,12 @@ class BankReconciliation(Document): for d in entries: row = self.append('payment_entries', {}) - amount = d.debit if d.debit else d.credit - d.amount = fmt_money(amount, 2, d.account_currency) + " " + (_("Dr") if d.debit else _("Cr")) + + amount = d.get('debit', 0) - d.get('credit', 0) + + formatted_amount = fmt_money(abs(amount), 2, d.account_currency) + d.amount = formatted_amount + " " + (_("Dr") if amount > 0 else _("Cr")) + d.pop("credit") d.pop("debit") d.pop("account_currency")