From 8ed7535e8a2e6779e52e2424788a41693bc2ea68 Mon Sep 17 00:00:00 2001 From: Saqib Ansari Date: Tue, 31 Mar 2020 18:44:02 +0530 Subject: [PATCH] fix: travis --- erpnext/accounts/doctype/payment_request/payment_request.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/payment_request/payment_request.py b/erpnext/accounts/doctype/payment_request/payment_request.py index 49c0e36204..aa0e67c5f2 100644 --- a/erpnext/accounts/doctype/payment_request/payment_request.py +++ b/erpnext/accounts/doctype/payment_request/payment_request.py @@ -424,12 +424,11 @@ def make_status_as_paid(doc, method): "docstatus": 1}) if payment_request_name: - outstanding_amt = frappe.get_value(ref.reference_doctype, ref.reference_name, 'outstanding_amount') doc = frappe.get_doc("Payment Request", payment_request_name) - if doc.status != "Paid" and outstanding_amt <= 0: + if doc.status != "Paid" and ref.outstanding_amount <= ref.allocated_amount: doc.db_set('status', 'Paid') frappe.db.commit() - elif doc.status != "Partially Paid" and outstanding_amt != doc.grand_total: + elif doc.status != "Partially Paid" and ref.outstanding_amount != ref.allocated_amount: doc.db_set('status', 'Partially Paid') frappe.db.commit()