fix: Amount validation in Payment Request against Purchase Order (#33855)

fix: Amount validation in Payment Request againt Purchase Order
This commit is contained in:
Deepesh Garg 2023-01-29 21:34:28 +05:30 committed by GitHub
parent faecf3ee40
commit a34a1f8fd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,7 @@ class PaymentRequest(Document):
if existing_payment_request_amount:
ref_doc = frappe.get_doc(self.reference_doctype, self.reference_name)
if hasattr(ref_doc, "order_type") and getattr(ref_doc, "order_type") != "Shopping Cart":
if not hasattr(ref_doc, "order_type") or getattr(ref_doc, "order_type") != "Shopping Cart":
ref_amount = get_amount(ref_doc, self.payment_account)
if existing_payment_request_amount + flt(self.grand_total) > ref_amount: