[fix]Earlier recurring billing
diff --git a/erpnext/controllers/recurring_document.py b/erpnext/controllers/recurring_document.py
index f83df2b..c3e98e8 100644
--- a/erpnext/controllers/recurring_document.py
+++ b/erpnext/controllers/recurring_document.py
@@ -72,7 +72,7 @@
frappe.throw(exception_message)
def make_new_document(reference_doc, date_field, posting_date):
- new_document = frappe.copy_doc(reference_doc, ignore_no_copy=True)
+ new_document = frappe.copy_doc(reference_doc, ignore_no_copy=False)
mcount = month_map[reference_doc.recurring_type]
from_date = get_next_date(reference_doc.from_date, mcount)
@@ -89,7 +89,7 @@
date_field: posting_date,
"from_date": from_date,
"to_date": to_date,
- "next_date": get_next_date(from_date, mcount,cint(reference_doc.repeat_on_day_of_month))
+ "next_date": get_next_date(reference_doc.next_date, mcount,cint(reference_doc.repeat_on_day_of_month))
})
# copy document fields
@@ -202,7 +202,7 @@
if not doc.repeat_on_day_of_month:
msgprint(_("Please enter 'Repeat on Day of Month' field value"), raise_exception=1)
- next_date = doc.next_date or get_next_date(doc.from_date, month_map[doc.recurring_type],
+ next_date = get_next_date(posting_date, month_map[doc.recurring_type],
cint(doc.repeat_on_day_of_month))
frappe.db.set(doc, 'next_date', next_date)