From 995d79421dab2084f86e03d87c6b616673622543 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 1 Mar 2012 15:51:33 +0530 Subject: [PATCH 1/4] error fixed in patch --- erpnext/patches/jan_mar_2012/label_cleanup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/patches/jan_mar_2012/label_cleanup.py b/erpnext/patches/jan_mar_2012/label_cleanup.py index 93536fa2b9..b40f36f855 100644 --- a/erpnext/patches/jan_mar_2012/label_cleanup.py +++ b/erpnext/patches/jan_mar_2012/label_cleanup.py @@ -33,10 +33,10 @@ def execute(): } for d in del_flds: - webnotes.conn.sql("delete from `tabDocField` where fieldname in (%s) and parent = %s", (del_flds[d], d)) + webnotes.conn.sql("delete from `tabDocField` where fieldname in (%s) and parent = '%s'"% (del_flds[d], d)) for d in del_labels: - webnotes.conn.sql("delete from `tabDocField` where label in (%s) and parent = %s", (del_labels[d], d)) + webnotes.conn.sql("delete from `tabDocField` where label in (%s) and parent = '%s'"% (del_labels[d], d)) delete_doc('DocType', 'Update Delivery Date Detail') From 7807c6f1737e7d13848e88cb65bf4b64475ce329 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 1 Mar 2012 15:58:30 +0530 Subject: [PATCH 2/4] clear cache patch --- erpnext/patches/jan_mar_2012/clear_session_cache.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/erpnext/patches/jan_mar_2012/clear_session_cache.py b/erpnext/patches/jan_mar_2012/clear_session_cache.py index 2071ae567c..5ba2104322 100644 --- a/erpnext/patches/jan_mar_2012/clear_session_cache.py +++ b/erpnext/patches/jan_mar_2012/clear_session_cache.py @@ -16,6 +16,4 @@ def execute(): import webnotes - webnotes.conn.sql(""" - delete from __SessionCache - """) + webnotes.clear_cache() From be0b090d276dae633821bbd2401bcb227e3b4c96 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 1 Mar 2012 17:31:51 +0530 Subject: [PATCH 3/4] voucher date removal issue fixed --- erpnext/accounts/doctype/gl_control/gl_control.py | 1 - .../accounts/doctype/receivable_voucher/receivable_voucher.py | 2 +- .../search_criteria/collection_report/collection_report.py | 4 ++-- .../accounts/search_criteria/payment_report/payment_report.py | 4 ++-- .../search_criteria/variance_report/variance_report.py | 4 ++-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/erpnext/accounts/doctype/gl_control/gl_control.py b/erpnext/accounts/doctype/gl_control/gl_control.py index c64d64e41f..87f7960aa4 100644 --- a/erpnext/accounts/doctype/gl_control/gl_control.py +++ b/erpnext/accounts/doctype/gl_control/gl_control.py @@ -536,7 +536,6 @@ def create_new_invoice(prev_rv): # update new rv - new_rv.doc.voucher_date = new_rv.doc.next_date new_rv.doc.posting_date = new_rv.doc.next_date new_rv.doc.aging_date = new_rv.doc.next_date new_rv.doc.due_date = add_days(new_rv.doc.next_date, cint(date_diff(prev_rv.doc.due_date, prev_rv.doc.posting_date))) diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py index d09adc2e64..acbd72cce0 100644 --- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py +++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py @@ -533,7 +533,7 @@ class DocType(TransactionBase): self.values.append({ 'item_code' : d.item_code, 'warehouse' : wh, - 'transaction_date' : self.doc.voucher_date, + 'transaction_date' : getdate(self.doc.modified).strftime('%Y-%m-%d'), 'posting_date' : self.doc.posting_date, 'posting_time' : self.doc.posting_time, 'voucher_type' : 'Receivable Voucher', diff --git a/erpnext/accounts/search_criteria/collection_report/collection_report.py b/erpnext/accounts/search_criteria/collection_report/collection_report.py index fe0cb57b0c..c0f6e6144c 100644 --- a/erpnext/accounts/search_criteria/collection_report/collection_report.py +++ b/erpnext/accounts/search_criteria/collection_report/collection_report.py @@ -66,7 +66,7 @@ for r in row_list: for r in res: if r[col_idx['Against Receivable']]: - dt=sql("select voucher_date, Aging_date from `tabReceivable Voucher` where name='%s'"%r[col_idx['Against Receivable']]) + dt=sql("select date(modified), Aging_date from `tabReceivable Voucher` where name='%s'"%r[col_idx['Against Receivable']]) r.append('') r.append(dt and cstr(dt[0][0]) or '') r.append(dt and cstr(dt[0][1]) or '') @@ -103,4 +103,4 @@ for r in res: r.append(val_l2) r.append(val_l3) r.append(val_l4) - r.append(val_l5_above) \ No newline at end of file + r.append(val_l5_above) diff --git a/erpnext/accounts/search_criteria/payment_report/payment_report.py b/erpnext/accounts/search_criteria/payment_report/payment_report.py index 8252103c5a..cc025bacf3 100644 --- a/erpnext/accounts/search_criteria/payment_report/payment_report.py +++ b/erpnext/accounts/search_criteria/payment_report/payment_report.py @@ -66,7 +66,7 @@ for r in row_list: for r in res: if r[col_idx['Against Payable']]: - dt=sql("select voucher_date, aging_date from `tabPayable Voucher` where name='%s'"%r[col_idx['Against Payable']]) + dt=sql("select date(modified), aging_date from `tabPayable Voucher` where name='%s'"%r[col_idx['Against Payable']]) r.append('') r.append(dt and cstr(dt[0][0]) or '') r.append(dt and cstr(dt[0][1]) or '') @@ -102,4 +102,4 @@ for r in res: r.append(val_l2) r.append(val_l3) r.append(val_l4) - r.append(val_l5_above) \ No newline at end of file + r.append(val_l5_above) diff --git a/erpnext/selling/search_criteria/variance_report/variance_report.py b/erpnext/selling/search_criteria/variance_report/variance_report.py index e4ebf33ebf..6948eac4ae 100644 --- a/erpnext/selling/search_criteria/variance_report/variance_report.py +++ b/erpnext/selling/search_criteria/variance_report/variance_report.py @@ -60,7 +60,7 @@ elif based_on == 'Sales Partner': if under == 'Receivable Voucher': under_detail = 'RV' - dt = 'voucher_date' + dt = 'posting_date' else: under_detail = under dt = "transaction_date" @@ -516,4 +516,4 @@ for r in res: tot_target = 0 elif tl == 1: - out.append(r) \ No newline at end of file + out.append(r) From e3ce5b4e0ca11561e7f987d217a34538b7b8f871 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 1 Mar 2012 17:37:36 +0530 Subject: [PATCH 4/4] voucher date removal issue fixed --- erpnext/accounts/doctype/gl_control/gl_control.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/gl_control/gl_control.py b/erpnext/accounts/doctype/gl_control/gl_control.py index 87f7960aa4..93bef5de76 100644 --- a/erpnext/accounts/doctype/gl_control/gl_control.py +++ b/erpnext/accounts/doctype/gl_control/gl_control.py @@ -177,7 +177,7 @@ class DocType: #---------------------------------------------------------------------------- def make_single_entry(self,parent,d,le_map,cancel, merge_entries): if self.get_val(le_map['account'], d, parent) and (self.get_val(le_map['debit'], d, parent) or self.get_val(le_map['credit'], d, parent)): - flist = ['account','cost_center','against','debit','credit','remarks','voucher_type','voucher_no','transaction_date','posting_date','fiscal_year','against_voucher','against_voucher_type','company','is_opening', 'aging_date'] + flist = ['account','cost_center','against','debit','credit','remarks','voucher_type','voucher_no','posting_date','fiscal_year','against_voucher','against_voucher_type','company','is_opening', 'aging_date'] # Check budget before gl entry #check budget only if account is expense account