fix: bank reconcilliation showing multiple entries against one JV

This commit is contained in:
Rohit Waghchaure 2019-01-25 00:23:41 +05:30
parent 7e4cf62a15
commit e14cc8f2b6

View File

@ -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)