diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py index 03acc0af65d..4bf5e976e93 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py @@ -63,6 +63,13 @@ class DocType: vouchers = [] for d in getlist(self.doclist, 'entries'): if d.clearance_date: + if getdate(d.clearance_date) < getdate(d.cheque_date): + msgprint("Clearance Date can not be before Cheque Date (Row #%s)" % + d.idx, raise_exception=1) + if getdate(d.clearance_date) < getdate(d.posting_date): + msgprint("Clearance Date can not be before Posting 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)) vouchers.append(d.voucher_id)