From 890aa0f51d694ee0b0cbae8b2a991b03ebf64139 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 18 Jan 2012 12:25:20 +0530 Subject: [PATCH] fix: interface error due to use of sql instead of webnotes.conn.sql --- erpnext/accounts/doctype/gl_control/gl_control.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/gl_control/gl_control.py b/erpnext/accounts/doctype/gl_control/gl_control.py index bab86267c1..5365bbce09 100644 --- a/erpnext/accounts/doctype/gl_control/gl_control.py +++ b/erpnext/accounts/doctype/gl_control/gl_control.py @@ -506,10 +506,10 @@ def manage_recurring_invoices(): Create recurring invoices on specific date by copying the original one and notify the concerned people """ - rv = sql("""select name, recurring_id from `tabReceivable Voucher` where ifnull(convert_into_recurring_invoice, 0) = 1 + rv = webnotes.conn.sql("""select name, recurring_id from `tabReceivable Voucher` where ifnull(convert_into_recurring_invoice, 0) = 1 and next_date = %s and next_date <= end_date order by next_date desc""", nowdate()) for d in rv: - if not sql("""select name from `tabReceivable Voucher` where posting_date = %s and recurring_id = %s""", (nowdate(), d[1])): + if not webnotes.conn.sql("""select name from `tabReceivable Voucher` where posting_date = %s and recurring_id = %s""", (nowdate(), d[1])): prev_rv = get_obj('Receivable Voucher', d[0], with_children=1) new_rv = create_new_invoice(prev_rv)