Update subscription.py
This commit is contained in:
parent
951ab9f78f
commit
44306bd0e5
@ -559,15 +559,13 @@ class Subscription(Document):
|
|||||||
else:
|
else:
|
||||||
self.set_status_grace_period()
|
self.set_status_grace_period()
|
||||||
|
|
||||||
update_subscription = True if getdate() > getdate(self.current_invoice_end) else False
|
|
||||||
|
|
||||||
# Generate invoices periodically even if current invoice are unpaid
|
# Generate invoices periodically even if current invoice are unpaid
|
||||||
if self.generate_new_invoices_past_due_date and 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)
|
||||||
|
|
||||||
if update_subscription:
|
if getdate() > getdate(self.current_invoice_end):
|
||||||
self.update_subscription_period(add_days(self.current_invoice_end, 1))
|
self.update_subscription_period(add_days(self.current_invoice_end, 1))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
Loading…
x
Reference in New Issue
Block a user