Can anyone give code for pos invoice which is in jinja format to show customer balance. i am using following code but it didnt show exact result.
"{% set invoices = frappe.get_list(‘Sales Invoice’, {‘customer’: doc.customer, ‘docstatus’: 1}, [‘outstanding_amount’]) %}
{% set total_unpaid_amount = invoices | map(attribute=‘outstanding_amount’) | sum %}
Your outstanding balance as of {{ doc.posting_date.strftime('%d-%m-%Y') }} is: {{ total_unpaid_amount | default(0.0) }}