Merge pull request #39425 from frappe/mergify/bp/version-15-hotfix/pr-39423

fix: Update subscription period (#39423)
This commit is contained in:
Deepesh Garg 2024-01-17 15:03:51 +05:30 committed by GitHub
commit 62f7d984be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -595,6 +595,8 @@ class Subscription(Document):
) and self.can_generate_new_invoice(posting_date):
self.generate_invoice(posting_date=posting_date)
self.update_subscription_period(add_days(self.current_invoice_end, 1))
elif posting_date and getdate(posting_date) > getdate(self.current_invoice_end):
self.update_subscription_period()
if self.cancel_at_period_end and (
getdate(posting_date) >= getdate(self.current_invoice_end)