chore: Update test case

(cherry picked from commit e25b98b620)
This commit is contained in:
Deepesh Garg
2022-12-20 11:42:05 +05:30
committed by Mergify
parent a01db8fc38
commit fa2df8db8c

View File

@@ -404,23 +404,23 @@ def make_payment_request(**args):
else "" else ""
) )
existing_payment_request = frappe.db.get_value( draft_payment_request = frappe.db.get_value(
"Payment Request", "Payment Request",
{"reference_doctype": args.dt, "reference_name": args.dn, "docstatus": ("!=", 2)}, {"reference_doctype": args.dt, "reference_name": args.dn, "docstatus": 0},
) )
if existing_payment_request:
frappe.db.set_value(
"Payment Request", existing_payment_request, "grand_total", grand_total, update_modified=False
)
pr = frappe.get_doc("Payment Request", existing_payment_request)
else:
if args.order_type != "Shopping Cart":
existing_payment_request_amount = get_existing_payment_request_amount(args.dt, args.dn) existing_payment_request_amount = get_existing_payment_request_amount(args.dt, args.dn)
if existing_payment_request_amount: if existing_payment_request_amount:
grand_total -= existing_payment_request_amount grand_total -= existing_payment_request_amount
if draft_payment_request:
frappe.db.set_value(
"Payment Request", draft_payment_request, "grand_total", grand_total, update_modified=False
)
pr = frappe.get_doc("Payment Request", draft_payment_request)
else:
if args.order_type != "Shopping Cart":
pr = frappe.new_doc("Payment Request") pr = frappe.new_doc("Payment Request")
pr.update( pr.update(
{ {