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

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

fix: Amount validation in Payment Request againt Purchase Order
(cherry picked from commit a34a1f8fd2)

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
This commit is contained in:
mergify[bot]
2023-01-31 09:20:33 +05:30
committed by GitHub
parent 44692e9b57
commit 5605f1e3ef

View File

@@ -51,7 +51,7 @@ class PaymentRequest(Document):
if existing_payment_request_amount: if existing_payment_request_amount:
ref_doc = frappe.get_doc(self.reference_doctype, self.reference_name) 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) ref_amount = get_amount(ref_doc, self.payment_account)
if existing_payment_request_amount + flt(self.grand_total) > ref_amount: if existing_payment_request_amount + flt(self.grand_total) > ref_amount: