fix: subscription prepaid date validation (#24356)

This commit is contained in:
Jannat Patel 2021-01-13 21:02:15 +05:30 committed by GitHub
parent 53cb9f9f47
commit 00ccec7314
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -446,7 +446,7 @@ class Subscription(Document):
if not self.generate_invoice_at_period_start:
return False
if self.is_new_subscription():
if self.is_new_subscription() and getdate() >= getdate(self.current_invoice_start):
return True
# Check invoice dates and make sure it doesn't have outstanding invoices