fix(Non Profit): Membership and Donation API fixes (#24900) (#24905)

* fix: Donation fixes

- differentiate between subscription payment and payment

- issue with donation amount

* fix: existing membership validation

* fix: ignore subscription payments while capturing donations
This commit is contained in:
Rucha Mahabal
2021-03-16 20:52:53 +05:30
committed by GitHub
parent 65165fcc80
commit 00cce433a5
3 changed files with 11 additions and 4 deletions

View File

@@ -29,7 +29,10 @@ class TaxExemption80GCertificate(Document):
def validate_duplicates(self):
if self.recipient == 'Donor':
certificate = frappe.db.exists(self.doctype, {'donation': self.donation})
certificate = frappe.db.exists(self.doctype, {
'donation': self.donation,
'name': ('!=', self.name)
})
if certificate:
frappe.throw(_('An 80G Certificate {0} already exists for the donation {1}').format(
get_link_to_form(self.doctype, certificate), frappe.bold(self.donation)