chore: Update test case
This commit is contained in:
parent
dc178984ae
commit
e25b98b620
@ -411,23 +411,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(
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user