mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 03:09:09 +00:00
generate new invoice only when current_invoice_end is past
This commit is contained in:
@@ -141,7 +141,8 @@ class Subscriptions(Document):
|
|||||||
frappe.throw(_('Both Trial Period Start Date and Trial Period End Date must be set'))
|
frappe.throw(_('Both Trial Period Start Date and Trial Period End Date must be set'))
|
||||||
|
|
||||||
def after_insert(self):
|
def after_insert(self):
|
||||||
if not self.is_trialling():
|
# todo: deal with users who collect prepayments. Maybe a new Subscription Invoice doctype?
|
||||||
|
if not self.is_trialling() and nowdate() > self.current_invoice_end:
|
||||||
self.generate_invoice()
|
self.generate_invoice()
|
||||||
|
|
||||||
def generate_invoice(self):
|
def generate_invoice(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user