After an item added to quote then clicked Pay an error shows

on the webshop, when I select one item from all-products page and then hit “Add to Quote” it works fine but after that when i click on Pay an error shows up as below “server error” “status 500”

Traceback (most recent call last):
File “apps/frappe/frappe/”, line 114, in application
response = frappe.api.handle(request)
File “apps/frappe/frappe/api/”, line 49, in handle
data = endpoint(**arguments)
File “apps/frappe/frappe/api/”, line 36, in handle_rpc_call
return frappe.handler.handle()
File “apps/frappe/frappe/”, line 49, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/”, line 85, in execute_cmd
return, **frappe.form_dict)
File “apps/frappe/frappe/”, line 1768, in call
return fn(*args, **newargs)
File “apps/frappe/frappe/utils/”, line 31, in wrapper
return func(*args, **kwargs)
File “apps/erpnext/erpnext/accounts/doctype/payment_request/”, line 430, in make_payment_request
grand_total = get_amount(ref_doc, gateway_account.get(“payment_account”))
File “apps/erpnext/erpnext/accounts/doctype/payment_request/”, line 542, in get_amount
if grand_total > 0:
UnboundLocalError: local variable ‘grand_total’ referenced before assignment

@NCP do you think its an issue from my end or might be a bug?