Sales Invoice List: show percent paid as 100% if grand total is 0
This commit is contained in:
parent
ff367c7b31
commit
b20de6a3ec
@ -7,8 +7,10 @@ frappe.listview_settings['Sales Invoice'] = {
|
|||||||
add_columns: [{"content":"Percent Paid", width:"10%", type:"bar-graph",
|
add_columns: [{"content":"Percent Paid", width:"10%", type:"bar-graph",
|
||||||
label: "Payment Received"}],
|
label: "Payment Received"}],
|
||||||
prepare_data: function(data) {
|
prepare_data: function(data) {
|
||||||
data["Percent Paid"] = (data.docstatus===1 && flt(data.grand_total))
|
if (data.docstatus === 1) {
|
||||||
? (((flt(data.grand_total) - flt(data.outstanding_amount)) / flt(data.grand_total)) * 100)
|
data["Percent Paid"] = flt(data.grand_total)
|
||||||
: 0;
|
? (((flt(data.grand_total) - flt(data.outstanding_amount)) / flt(data.grand_total)) * 100)
|
||||||
|
: 100.0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user