From 9035aa825de22d65553d61f0909febb20cb395bb Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 12 Oct 2012 14:51:06 +0530 Subject: [PATCH] fix in bank reconciliation --- .../doctype/bank_reconciliation/bank_reconciliation.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/accounts/doctype/bank_reconciliation/bank_reconciliation.py index def2525223..f9127793e3 100644 --- a/accounts/doctype/bank_reconciliation/bank_reconciliation.py +++ b/accounts/doctype/bank_reconciliation/bank_reconciliation.py @@ -62,12 +62,14 @@ class DocType: def update_details(self): vouchers = [] for d in getlist(self.doclist, 'entries'): - if d.clearance_date and d.cheque_date: - if getdate(d.clearance_date) < getdate(d.cheque_date): + if d.clearance_date: + if d.cheque_date and getdate(d.clearance_date) < getdate(d.cheque_date): msgprint("Clearance Date can not be before Cheque Date (Row #%s)" % d.idx, raise_exception=1) - sql("update `tabJournal Voucher` set clearance_date = %s, modified = %s where name=%s", (d.clearance_date, nowdate(), d.voucher_id)) + sql("""update `tabJournal Voucher` + set clearance_date = %s, modified = %s where name=%s""", + (d.clearance_date, nowdate(), d.voucher_id)) vouchers.append(d.voucher_id) if vouchers: