From 20dc93a4b77b831d6d76f7bff6c0d48372baee65 Mon Sep 17 00:00:00 2001 From: Jatin3128 Date: Sun, 28 Dec 2025 21:02:21 +0530 Subject: [PATCH] fix(subscription): complete subscription if no outstanding invoices --- erpnext/accounts/doctype/subscription/subscription.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/subscription/subscription.py b/erpnext/accounts/doctype/subscription/subscription.py index 68303bccdfd..4fbdd734ab3 100644 --- a/erpnext/accounts/doctype/subscription/subscription.py +++ b/erpnext/accounts/doctype/subscription/subscription.py @@ -223,7 +223,11 @@ class Subscription(Document): """ if self.is_trialling(): self.status = "Trialing" - elif self.status == "Active" and self.end_date and getdate(posting_date) > getdate(self.end_date): + elif ( + not self.has_outstanding_invoice() + and self.end_date + and getdate(posting_date) > getdate(self.end_date) + ): self.status = "Completed" elif self.is_past_grace_period(): self.status = self.get_status_for_past_grace_period()