Update bank_reconciliation.py

set to null if clearance_date is blank because if not it will set it just 0000-00-00.
This commit is contained in:
Chris Ian Fiel 2016-02-04 22:10:36 +08:00
parent cb66d3a8c9
commit af667f77e6

View File

@ -52,6 +52,8 @@ class BankReconciliation(Document):
frappe.throw(_("Clearance date cannot be before check date in row {0}").format(d.idx))
if d.clearance_date or self.include_reconciled_entries:
if not d.clearance_date:
d.clearance_date = None
frappe.db.set_value("Journal Entry", d.voucher_id, "clearance_date", d.clearance_date)
frappe.db.sql("""update `tabJournal Entry` set clearance_date = %s, modified = %s
where name=%s""", (d.clearance_date, nowdate(), d.voucher_id))