import frappe
from erpnext.controllers.recurring_document import manage_recurring_documents

def execute():

	frappe.db.sql("""update `tabSales Invoice` 
				set is_recurring=1 where (docstatus=1 or docstatus=0) and next_date='2016-06-26' and is_recurring=0""")
	
	manage_recurring_documents("Sales Invoice", "2016-06-26")


@@ -204,20 +204,51 @@
 tatus=0)
- and
+%0A%09%09%09%09and (next_date='2016-06-25' or
  next_da
@@ -262,16 +262,17 @@
 6-06-26'
+)
  and is_
@@ -348,9 +348,67 @@
 06-2
-6
+5
 %22)%0A
+%09manage_recurring_documents(%22Sales Invoice%22, %222016-06-26%22)
 %0A

Update create_recurring_for_failed.py