mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 08:54:45 +00:00
fix: Add check to generate new invoices
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
"cancelation_date",
|
"cancelation_date",
|
||||||
"trial_period_start",
|
"trial_period_start",
|
||||||
"trial_period_end",
|
"trial_period_end",
|
||||||
|
"generate_new_invoices_past_due_date",
|
||||||
"column_break_11",
|
"column_break_11",
|
||||||
"current_invoice_start",
|
"current_invoice_start",
|
||||||
"current_invoice_end",
|
"current_invoice_end",
|
||||||
@@ -183,8 +184,7 @@
|
|||||||
"fieldname": "invoices",
|
"fieldname": "invoices",
|
||||||
"fieldtype": "Table",
|
"fieldtype": "Table",
|
||||||
"label": "Invoices",
|
"label": "Invoices",
|
||||||
"options": "Subscription Invoice",
|
"options": "Subscription Invoice"
|
||||||
"read_only": 1
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"collapsible": 1,
|
"collapsible": 1,
|
||||||
@@ -195,9 +195,16 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "dimension_col_break",
|
"fieldname": "dimension_col_break",
|
||||||
"fieldtype": "Column Break"
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"description": "New invoices will be generated as per schedule even if current invoices are unpaid or past due date",
|
||||||
|
"fieldname": "generate_new_invoices_past_due_date",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Generate New Invoices Past Due Date"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modified": "2020-08-27 23:30:02.504042",
|
"modified": "2020-11-29 22:46:14.879289",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Subscription",
|
"name": "Subscription",
|
||||||
|
|||||||
@@ -412,7 +412,7 @@ class Subscription(Document):
|
|||||||
self.update_subscription_period(add_days(self.current_invoice_end, 1))
|
self.update_subscription_period(add_days(self.current_invoice_end, 1))
|
||||||
|
|
||||||
# Generate invoices periodically even if current invoice are unpaid
|
# Generate invoices periodically even if current invoice are unpaid
|
||||||
if not self.is_current_invoice_generated() and (self.is_postpaid_to_invoice()
|
if self.generate_new_invoices_past_due_date and not self.is_current_invoice_generated() and (self.is_postpaid_to_invoice()
|
||||||
or self.is_prepaid_to_invoice()):
|
or self.is_prepaid_to_invoice()):
|
||||||
prorate = frappe.db.get_single_value('Subscription Settings', 'prorate')
|
prorate = frappe.db.get_single_value('Subscription Settings', 'prorate')
|
||||||
self.generate_invoice(prorate)
|
self.generate_invoice(prorate)
|
||||||
|
|||||||
Reference in New Issue
Block a user