From 6282c4a18ae6194259ee4f1f55eb26f51dcebb64 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Sat, 2 Feb 2013 15:12:45 +0530 Subject: [PATCH] added bar indicators to Sales Invoice & Purchase Invoice --- .../doctype/purchase_invoice/purchase_invoice_list.js | 9 +++++++++ accounts/doctype/sales_invoice/sales_invoice_list.js | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 accounts/doctype/purchase_invoice/purchase_invoice_list.js create mode 100644 accounts/doctype/sales_invoice/sales_invoice_list.js diff --git a/accounts/doctype/purchase_invoice/purchase_invoice_list.js b/accounts/doctype/purchase_invoice/purchase_invoice_list.js new file mode 100644 index 0000000000..bb284baae7 --- /dev/null +++ b/accounts/doctype/purchase_invoice/purchase_invoice_list.js @@ -0,0 +1,9 @@ +// render +wn.listview_settings['Purchase Invoice'] = { + add_fields: ["`tabPurchase Invoice`.grand_total", "`tabPurchase Invoice`.outstanding_amount"], + add_columns: [{"content":"outstanding_amount", width:"10%", type:"bar-graph"}], + prepare_data: function(data) { + data.outstanding_amount = (flt(data.grand_total) - + flt(data.outstanding_amount)) / flt(data.grand_total) * 100; + } +}; diff --git a/accounts/doctype/sales_invoice/sales_invoice_list.js b/accounts/doctype/sales_invoice/sales_invoice_list.js new file mode 100644 index 0000000000..c1f8061665 --- /dev/null +++ b/accounts/doctype/sales_invoice/sales_invoice_list.js @@ -0,0 +1,9 @@ +// render +wn.listview_settings['Sales Invoice'] = { + add_fields: ["`tabSales Invoice`.grand_total", "`tabSales Invoice`.outstanding_amount"], + add_columns: [{"content":"outstanding_amount", width:"10%", type:"bar-graph"}], + prepare_data: function(data) { + data.outstanding_amount = (flt(data.grand_total) - + flt(data.outstanding_amount)) / flt(data.grand_total) * 100; + } +};