From 7eefedfb119bcd8d01bbad2e43d87f5ed3b707ee Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Wed, 17 Jan 2024 10:57:19 +0530 Subject: [PATCH] fix: Update subscription period --- erpnext/accounts/doctype/subscription/subscription.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/accounts/doctype/subscription/subscription.py b/erpnext/accounts/doctype/subscription/subscription.py index ce56a7b0a2..6d27806253 100644 --- a/erpnext/accounts/doctype/subscription/subscription.py +++ b/erpnext/accounts/doctype/subscription/subscription.py @@ -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)