From 52c595dbf1fd2d0d15edccd1e221c29502ad90cf Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 19 Sep 2012 11:45:59 +0530 Subject: [PATCH 1/3] pull all entry of bank where clearance date not mentioned in bank reconciliation --- .../accounts/doctype/bank_reconciliation/bank_reconciliation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py index 7ac603ba1f..8a468369f7 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py @@ -43,7 +43,7 @@ class DocType: msgprint("Bank Account, From Date and To Date are Mandatory") return - dl = sql("select t1.name, t1.cheque_no, t1.cheque_date, t2.debit, t2.credit, t1.posting_date, t2.against_account from `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 where t2.parent = t1.name and t2.account = %s and (clearance_date is null or clearance_date = '0000-00-00' or clearance_date = '') and (t1.cheque_no is not null or t1.cheque_no != '') and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1", (self.doc.bank_account, self.doc.from_date, self.doc.to_date)) + dl = sql("select t1.name, t1.cheque_no, t1.cheque_date, t2.debit, t2.credit, t1.posting_date, t2.against_account from `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 where t2.parent = t1.name and t2.account = %s and (clearance_date is null or clearance_date = '0000-00-00' or clearance_date = '') and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1", (self.doc.bank_account, self.doc.from_date, self.doc.to_date)) self.doclist = self.doc.clear_table(self.doclist, 'entries') self.doc.total_amount = 0.0 From 6e9f1469d94dca692f438bf2e81fa425882d9157 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 19 Sep 2012 11:55:44 +0530 Subject: [PATCH 2/3] pull all entry of bank where clearance date not mentioned in bank reconciliation --- .../doctype/bank_reconciliation/bank_reconciliation.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py index 8a468369f7..9d3b1f0b4f 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py @@ -50,13 +50,13 @@ class DocType: for d in dl: nl = addchild(self.doc, 'entries', 'Bank Reconciliation Detail', 1, self.doclist) - nl.posting_date = str(d[5]) - nl.voucher_id = str(d[0]) - nl.cheque_number = str(d[1]) - nl.cheque_date = str(d[2]) + nl.posting_date = cstr(d[5]) + nl.voucher_id = cstr(d[0]) + nl.cheque_number = cstr(d[1]) + nl.cheque_date = cstr(d[2]) nl.debit = flt(d[3]) nl.credit = flt(d[4]) - nl.against_account = d[6] + nl.against_account = cstr(d[6]) self.doc.total_amount += flt(flt(d[4]) - flt(d[3])) def update_details(self): From 27ec8f1e2657bb6dce0a65601e29f6ae46d52930 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 19 Sep 2012 12:00:11 +0530 Subject: [PATCH 3/3] pull all entry of bank where clearance date not mentioned in bank reconciliation --- .../doctype/bank_reconciliation/bank_reconciliation.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py index 9d3b1f0b4f..03acc0af65 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py @@ -60,7 +60,13 @@ class DocType: self.doc.total_amount += flt(flt(d[4]) - flt(d[3])) def update_details(self): + vouchers = [] for d in getlist(self.doclist, 'entries'): if d.clearance_date: sql("update `tabJournal Voucher` set clearance_date = %s, modified = %s where name=%s", (d.clearance_date, nowdate(), d.voucher_id)) - msgprint("Updated") + vouchers.append(d.voucher_id) + + if vouchers: + msgprint("Clearance Date updated in %s" % vouchers) + else: + msgprint("Clearance Date not mentioned") \ No newline at end of file