Skip to content

Commit

Permalink
Merge pull request #31110 from ruchamahabal/fix-npo-membership
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchamahabal authored May 24, 2022
2 parents e9968cc + 168a9d4 commit a071095
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 3 additions & 1 deletion erpnext/non_profit/doctype/donation/donation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions erpnext/non_profit/doctype/membership/membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ def validate_membership_period(self):
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)
Expand Down

0 comments on commit a071095

Please sign in to comment.