From 746c1620552c1509e6c452168a890adefeec4931 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 29 Jul 2015 14:54:33 +0530 Subject: [PATCH] Return status in listview for return entry --- .../doctype/purchase_invoice/purchase_invoice_list.js | 6 ++++-- .../accounts/doctype/sales_invoice/sales_invoice_list.js | 6 ++++-- erpnext/stock/doctype/delivery_note/delivery_note_list.js | 7 ++++++- .../doctype/purchase_receipt/purchase_receipt_list.js | 7 ++++++- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js index dfb8329364b..ccad5ce2ad7 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js @@ -4,9 +4,11 @@ // render frappe.listview_settings['Purchase Invoice'] = { add_fields: ["supplier", "supplier_name", "base_grand_total", "outstanding_amount", "due_date", "company", - "currency"], + "currency", "is_return"], get_indicator: function(doc) { - if(flt(doc.outstanding_amount) > 0 && doc.docstatus==1) { + if(cint(doc.is_return)==1) { + return [__("Return"), "darkgrey", "is_return,=,1"]; + } else if(flt(doc.outstanding_amount) > 0 && doc.docstatus==1) { if(frappe.datetime.get_diff(doc.due_date) < 0) { return [__("Overdue"), "red", "outstanding_amount,>,0|due_date,<,Today"]; } else { diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js index 6d152f8c1df..11c97891957 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js @@ -4,9 +4,11 @@ // render frappe.listview_settings['Sales Invoice'] = { add_fields: ["customer", "customer_name", "base_grand_total", "outstanding_amount", "due_date", "company", - "currency"], + "currency", "is_return"], get_indicator: function(doc) { - if(flt(doc.outstanding_amount)==0) { + if(cint(doc.is_return)==1) { + return [__("Return"), "darkgrey", "is_return,=,1"]; + } else if(flt(doc.outstanding_amount)==0) { return [__("Paid"), "green", "outstanding_amount,=,0"] } else if (flt(doc.outstanding_amount) > 0 && doc.due_date > frappe.datetime.get_today()) { return [__("Unpaid"), "orange", "outstanding_amount,>,0|due_date,>,Today"] diff --git a/erpnext/stock/doctype/delivery_note/delivery_note_list.js b/erpnext/stock/doctype/delivery_note/delivery_note_list.js index d30dec91e5a..dce68634412 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note_list.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note_list.js @@ -1,4 +1,9 @@ frappe.listview_settings['Delivery Note'] = { add_fields: ["customer", "customer_name", "base_grand_total", "per_installed", - "transporter_name", "grand_total"] + "transporter_name", "grand_total", "is_return"], + get_indicator: function(doc) { + if(cint(doc.is_return)==1) { + return [__("Return"), "darkgrey", "is_return,=,1"]; + } + } }; diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.js index b0559cea738..64d5456bfee 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.js @@ -1,4 +1,9 @@ frappe.listview_settings['Purchase Receipt'] = { add_fields: ["supplier", "supplier_name", "base_grand_total", "is_subcontracted", - "transporter_name"] + "transporter_name", "is_return"], + get_indicator: function(doc) { + if(cint(doc.is_return)==1) { + return [__("Return"), "darkgrey", "is_return,=,1"]; + } + } };