Merge pull request #31110 from ruchamahabal/fix-npo-membership

This commit is contained in:
Rucha Mahabal
2022-05-24 18:38:43 +05:30
committed by GitHub
2 changed files with 3 additions and 5 deletions

View File

@@ -100,7 +100,9 @@ def capture_razorpay_donations(*args, **kwargs):
return
# to avoid capturing subscription payments as donations
if payment.description and "subscription" in str(payment.description).lower():
if payment.invoice_id or (
payment.description and "subscription" in str(payment.description).lower()
):
return
donor = get_donor(payment.email)

View File

@@ -61,10 +61,6 @@ class Membership(Document):
frappe.throw(_("You can only renew if your membership expires within 30 days"))
self.from_date = add_days(last_membership.to_date, 1)
elif frappe.session.user == "Administrator":
self.from_date = self.from_date
else:
self.from_date = nowdate()
if frappe.db.get_single_value("Non Profit Settings", "billing_cycle") == "Yearly":
self.to_date = add_years(self.from_date, 1)