From 0091c86e80390548ebf9d06098c8dfcb2b33bc9d Mon Sep 17 00:00:00 2001 From: tundebabzy Date: Mon, 26 Feb 2018 16:18:55 +0100 Subject: [PATCH] fix date comparison bug --- erpnext/accounts/doctype/subscriptions/subscriptions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/subscriptions/subscriptions.py b/erpnext/accounts/doctype/subscriptions/subscriptions.py index 1a07190e7d..cf82b129ce 100644 --- a/erpnext/accounts/doctype/subscriptions/subscriptions.py +++ b/erpnext/accounts/doctype/subscriptions/subscriptions.py @@ -51,7 +51,7 @@ class Subscriptions(Document): return True end_date = getdate(end_date) - return nowdate() > end_date + return getdate(nowdate()) > getdate(end_date) def is_past_grace_period(self): current_invoice = self.get_current_invoice() @@ -83,7 +83,7 @@ class Subscriptions(Document): def validate_trial_period(self): if self.trial_period_start and self.trial_period_end: - if getdate(self.trial_period_end) > getdate(self.trial_period_start): + if getdate(self.trial_period_end) < getdate(self.trial_period_start): frappe.throw(_('Trial Period End Date Cannot be before Trial Period Start Date')) elif self.trial_period_start or self.trial_period_end: