From 6c34e1411f654e379ab8b470459e303f2465cfd4 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 4 Jun 2012 16:21:25 +0530 Subject: [PATCH] Flexible invoice period in recurring invoice --- erpnext/accounts/doctype/gl_control/gl_control.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/gl_control/gl_control.py b/erpnext/accounts/doctype/gl_control/gl_control.py index 87b326499a..2f84a9c7f4 100644 --- a/erpnext/accounts/doctype/gl_control/gl_control.py +++ b/erpnext/accounts/doctype/gl_control/gl_control.py @@ -485,8 +485,8 @@ def manage_recurring_invoices(): and notify the concerned people """ rv = webnotes.conn.sql("""select name, recurring_id from `tabSales Invoice` where ifnull(convert_into_recurring_invoice, 0) = 1 - and next_date = %s and next_date <= ifnull(end_date, '2199-12-31') and docstatus=1""", nowdate(), debug=1) - msgprint(rv) + and next_date = %s and next_date <= ifnull(end_date, '2199-12-31') and docstatus=1""", nowdate()) + for d in rv: if not webnotes.conn.sql("""select name from `tabSales Invoice` where posting_date = %s and recurring_id = %s and docstatus=1""", (nowdate(), d[1])): prev_rv = get_obj('Sales Invoice', d[0], with_children=1) @@ -587,6 +587,5 @@ def send_notification(new_rv): msg = hd + tbl + totals - msgprint(msg) from webnotes.utils.email_lib import sendmail sendmail(new_rv.doc.notification_email_address.split(", "), subject=subject, msg = msg) \ No newline at end of file