From b20de6a3ecf7053ac9ccfb551ffe4899c32cf42c Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 17 Jun 2014 13:58:06 +0530 Subject: [PATCH] Sales Invoice List: show percent paid as 100% if grand total is 0 --- .../accounts/doctype/sales_invoice/sales_invoice_list.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js index 5592bc5220..42c80b4e26 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js @@ -7,8 +7,10 @@ frappe.listview_settings['Sales Invoice'] = { add_columns: [{"content":"Percent Paid", width:"10%", type:"bar-graph", label: "Payment Received"}], prepare_data: function(data) { - data["Percent Paid"] = (data.docstatus===1 && flt(data.grand_total)) - ? (((flt(data.grand_total) - flt(data.outstanding_amount)) / flt(data.grand_total)) * 100) - : 0; + if (data.docstatus === 1) { + data["Percent Paid"] = flt(data.grand_total) + ? (((flt(data.grand_total) - flt(data.outstanding_amount)) / flt(data.grand_total)) * 100) + : 100.0; + } } };