From e14cc8f2b67393c23f7c6e6f087670369bb0e446 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 25 Jan 2019 00:23:41 +0530 Subject: [PATCH] fix: bank reconcilliation showing multiple entries against one JV --- .../doctype/bank_reconciliation/bank_reconciliation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py index 7814b0883d..917276293d 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py @@ -26,7 +26,7 @@ class BankReconciliation(Document): select "Journal Entry" as payment_document, t1.name as payment_entry, t1.cheque_no as cheque_number, t1.cheque_date, - t2.debit_in_account_currency as debit, t2.credit_in_account_currency as credit, + sum(t2.debit_in_account_currency) as debit, sum(t2.credit_in_account_currency) as credit, t1.posting_date, t2.against_account, t1.clearance_date, t2.account_currency from `tabJournal Entry` t1, `tabJournal Entry Account` t2 @@ -34,6 +34,7 @@ class BankReconciliation(Document): t2.parent = t1.name and t2.account = %s and t1.docstatus=1 and t1.posting_date >= %s and t1.posting_date <= %s and ifnull(t1.is_opening, 'No') = 'No' {0} + group by t2.account, t1.name order by t1.posting_date ASC, t1.name DESC """.format(condition), (self.bank_account, self.from_date, self.to_date), as_dict=1)