mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 16:34:46 +00:00
fix(payments): Only check for Draft or Submitted paymentswhile cancelling payment requests
This commit is contained in:
@@ -214,9 +214,11 @@ class PaymentRequest(Document):
|
|||||||
|
|
||||||
def check_if_payment_entry_exists(self):
|
def check_if_payment_entry_exists(self):
|
||||||
if self.status == "Paid":
|
if self.status == "Paid":
|
||||||
payment_entry = frappe.db.sql_list("""select parent from `tabPayment Entry Reference`
|
payment_entry = frappe.get_all("Payment Entry Reference",
|
||||||
where reference_name=%s""", self.reference_name)
|
filters={"reference_name": self.reference_name, "docstatus": ["<", 2]},
|
||||||
if payment_entry:
|
fields=["distinct(parent)"])
|
||||||
|
|
||||||
|
if any(payment_entry):
|
||||||
frappe.throw(_("Payment Entry already exists"), title=_('Error'))
|
frappe.throw(_("Payment Entry already exists"), title=_('Error'))
|
||||||
|
|
||||||
def make_communication_entry(self):
|
def make_communication_entry(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user