Skip to content

Commit a32821c

Browse files
fix: customer_has_balance api debug
1 parent 34bfef8 commit a32821c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

d2h/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,4 +172,4 @@ def customer_has_balance(customer, sales_order):
172172
invoice = frappe.get_doc("Sales Invoice", { "name": invoice_item.parent })
173173
pending_amount = invoice.outstanding_amount
174174
total = invoice.total
175-
return { "balance": info[0]["total_unpaid"], "pending": pending_amount, "total": total, "info_debug": info }
175+
return { "balance": info[0]["total_unpaid"] if info else 0, "pending": pending_amount, "total": total, "info_debug": info }

0 commit comments

Comments
 (0)