fix: don't create invoice if invoice start date is in future
(cherry picked from commit 058fdca981)
This commit is contained in:
@@ -697,7 +697,7 @@ class Subscription(Document):
|
|||||||
self.status = "Cancelled"
|
self.status = "Cancelled"
|
||||||
self.cancelation_date = nowdate()
|
self.cancelation_date = nowdate()
|
||||||
|
|
||||||
if to_generate_invoice:
|
if to_generate_invoice and nowdate() >= self.current_invoice_start:
|
||||||
self.generate_invoice(self.current_invoice_start, self.cancelation_date)
|
self.generate_invoice(self.current_invoice_start, self.cancelation_date)
|
||||||
|
|
||||||
self.save()
|
self.save()
|
||||||
|
|||||||
Reference in New Issue
Block a user