more updates to lists and started sane filters
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.html b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.html
index 783e425..de8451e 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.html
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.html
@@ -10,12 +10,12 @@
{% if(frappe.datetime.get_diff(doc.due_date) < 0) { %}
<span class="label label-danger filterable"
title="{%= doc.get_formatted("due_date")%}"
- data-filter="outstanding_amount,>,0|due,<,Today">
+ data-filter="outstanding_amount,>,0|due_date,<,Today">
{%= __("Overdue: ") + comment_when(doc.due_date) %}
</span>
{% } else { %}
<span class="label label-warning filterable"
- data-filter="outstanding_amount,>,0|due,>=,Today"
+ data-filter="outstanding_amount,>,0|due_date,>=,Today"
title="{%= __("Payment Pending") %}">
{%= doc.get_formatted("due_date") %}</span>
{% } %}
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js
index 2cb7b4c..ea2986a 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js
@@ -4,5 +4,6 @@
// render
frappe.listview_settings['Sales Invoice'] = {
add_fields: ["customer", "customer_name", "grand_total", "outstanding_amount", "due_date", "company",
- "currency"]
+ "currency"],
+ filters: [["outstanding_amount", ">", "0"]]
};
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order_list.html b/erpnext/buying/doctype/purchase_order/purchase_order_list.html
index beb97f4..4806cfb 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order_list.html
+++ b/erpnext/buying/doctype/purchase_order/purchase_order_list.html
@@ -16,6 +16,11 @@
<span class="label label-danger filterable"
data-filter="status,=,Stopped">{%= __(doc.status) %}</span>
{% } %}
+ {% if(doc.per_received == 100 && doc.status!=="Stopped") { %}
+ <span class="filterable text-muted"
+ data-filter="per_received,=,100|status,!=,Stopped">
+ <i class="icon-ok-sign"></i></span>
+ {% } %}
</div>
</div>
<div class="col-xs-1 text-right">
diff --git a/erpnext/manufacturing/doctype/bom/bom_list.html b/erpnext/manufacturing/doctype/bom/bom_list.html
index 23e5a38..8303f4a 100644
--- a/erpnext/manufacturing/doctype/bom/bom_list.html
+++ b/erpnext/manufacturing/doctype/bom/bom_list.html
@@ -4,11 +4,13 @@
{%= list.get_avatar_and_id(doc) %}
{% if(cint(doc.is_active)) { %}
<span class="label label-success filterable"
- data-filter="is_active,=,Yes">{%= __("Active") %}</span>
+ data-filter="is_active,=,Yes">
+ <i class="icon-ok-sign"></i> {%= __("Active") %}</span>
{% } %}
{% if(cint(doc.is_default)) { %}
- <span class="label label-success filterable"
- data-filter="is_default,=,Yes">{%= __("Default") %}</span>
+ <span class="label label-primary filterable"
+ data-filter="is_default,=,Yes">
+ <i class="icon-ok-sign"></i> {%= __("Default") %}</span>
{% } %}
</div>
</div>
diff --git a/erpnext/manufacturing/doctype/production_order/production_order_list.html b/erpnext/manufacturing/doctype/production_order/production_order_list.html
new file mode 100644
index 0000000..4cdaa54
--- /dev/null
+++ b/erpnext/manufacturing/doctype/production_order/production_order_list.html
@@ -0,0 +1,47 @@
+<div class="row" style="max-height: 30px;">
+ <div class="col-xs-11">
+ <div class="text-ellipsis">
+ {% var per = 100 - cint((doc.qty - doc.produced_qty) * 100 / doc.qty); %}
+ {%= list.get_avatar_and_id(doc) %}
+ <span style="margin-right: 8px; display: inline-block">
+ <span class="filterable"
+ data-filter="customer,=,{%= doc.customer %}">
+ {%= doc.customer_name %}</span></span>
+ {% if(per < 100 && doc.status!=="Stopped") { %}
+ {% if(frappe.datetime.get_diff(doc.expected_delivery_date) < 0) { %}
+ <span class="label label-danger filterable"
+ title="{%= doc.get_formatted("expected_delivery_date")%}"
+ data-filter="status,=,Submitted|expected_delivery_date,<,Today"
+ >
+ {%= __("Overdue") %}
+ </span>
+ {% } else { %}
+ <span class="label label-warning filterable"
+ data-filter="produced_qty,<,qty|status,!=,Stopped"
+ title="{%= __("Pending") %}">
+ {%= doc.get_formatted("expected_delivery_date")%}</span>
+ {% } %}
+ {% } %}
+ {% if(per == 100 && doc.status!=="Stopped") { %}
+ <span class="filterable text-muted"
+ data-filter="produced_qty,=,qty|status,!=,Stopped">
+ <i class="icon-ok-sign"></i></span>
+ {% } %}
+ {% if(doc.status==="Stopped") { %}
+ <span class="label label-danger filterable"
+ data-filter="status,=,Stopped">{%= __("Stopped") %}</span>
+ {% } %}
+ <span class="label label-default filterable"
+ data-filter="sales_order,=,{%= doc.sales_order %}"
+ title="{%= __("Sales Order") %}">
+ <i class="icon-file-text"></i> {%= doc.sales_order %}</span>
+ <span class="label label-default filterable"
+ data-filter="bom_no,=,{%= doc.bom_no %}" title="{%= __("BOM") %}">
+ <i class="icon-sitemap"></i> {%= doc.bom_no %}</span>
+ </div>
+ </div>
+ <div class="col-xs-1 text-right">
+ {% var completed = per, title = __("Completed") %}
+ {% include "templates/form_grid/includes/progress.html" %}
+ </div>
+</div>
diff --git a/erpnext/manufacturing/doctype/production_order/production_order_list.js b/erpnext/manufacturing/doctype/production_order/production_order_list.js
new file mode 100644
index 0000000..457e803
--- /dev/null
+++ b/erpnext/manufacturing/doctype/production_order/production_order_list.js
@@ -0,0 +1,5 @@
+frappe.listview_settings['Production Order'] = {
+ add_fields: ["bom_no", "status", "sales_order", "qty",
+ "produced_qty", "expected_delivery_date"],
+ filters: [["status", "!=", "Completed"], ["status", "!=", "Stopped"]]
+};
diff --git a/erpnext/selling/doctype/sales_order/sales_order_list.html b/erpnext/selling/doctype/sales_order/sales_order_list.html
index 2861de0..ffa3c01 100644
--- a/erpnext/selling/doctype/sales_order/sales_order_list.html
+++ b/erpnext/selling/doctype/sales_order/sales_order_list.html
@@ -21,6 +21,11 @@
{%= doc.get_formatted("delivery_date")%}</span>
{% } %}
{% } %}
+ {% if(doc.per_delivered == 100 && doc.status!=="Stopped") { %}
+ <span class="filterable text-muted"
+ data-filter="per_delivered,=,100|status,!=,Stopped">
+ <i class="icon-ok-sign"></i></span>
+ {% } %}
{% if(doc.status==="Stopped") { %}
<span class="label label-danger filterable"
data-filter="status,=,Stopped">{%= __("Stopped") %}</span>
diff --git a/erpnext/selling/doctype/sales_order/sales_order_list.js b/erpnext/selling/doctype/sales_order/sales_order_list.js
index 0eab5de..a801cb9 100644
--- a/erpnext/selling/doctype/sales_order/sales_order_list.js
+++ b/erpnext/selling/doctype/sales_order/sales_order_list.js
@@ -1,4 +1,5 @@
frappe.listview_settings['Sales Order'] = {
add_fields: ["grand_total", "company", "currency", "customer",
- "customer_name", "per_delivered", "per_billed", "delivery_date"]
+ "customer_name", "per_delivered", "per_billed", "delivery_date"],
+ filters: [["per_delivered", "<", "100"]]
};
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 413aa47..1da2ad5 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -11,6 +11,7 @@
from erpnext.stock.utils import get_incoming_rate
from erpnext.stock.stock_ledger import get_previous_sle
from erpnext.controllers.queries import get_match_cond
+from erpnext.stock.get_item_details import get_available_qty
class NotUpdateStockError(frappe.ValidationError): pass
class StockOverReturnError(frappe.ValidationError): pass
@@ -25,6 +26,11 @@
class StockEntry(StockController):
fname = 'mtn_details'
+ def onload(self):
+ if self.docstatus==1:
+ for item in self.get(self.fname):
+ item.update(get_available_qty(item.item_code,
+ item.s_warehouse))
def validate(self):
self.validate_posting_time()
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry_list.html b/erpnext/stock/doctype/stock_entry/stock_entry_list.html
index 63fc2eb..cff7fe5 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry_list.html
+++ b/erpnext/stock/doctype/stock_entry/stock_entry_list.html
@@ -11,7 +11,7 @@
"Purchase Return": "icon-warning-sign",
"Subcontract": "icon-truck"
}[doc.purpose]; %}
- <span class="label label-success filterable"
+ <span class="label label-info filterable"
data-filter="purpose,=,{%= doc.purpose %}"
title="{%= doc.purpose %}">
<i class="{%= icon %}"></i>
diff --git a/erpnext/templates/form_grid/item_grid.html b/erpnext/templates/form_grid/item_grid.html
index 73e6c2e..c2e5d56 100644
--- a/erpnext/templates/form_grid/item_grid.html
+++ b/erpnext/templates/form_grid/item_grid.html
@@ -23,11 +23,12 @@
{% } %}
{% include "templates/form_grid/includes/visible_cols.html" %}
{% if(doc.schedule_date) { %}
- <br><span title="{%= __("Reqd By Date") %}" class="label {%=
+ <div><span title="{%= __("Reqd By Date") %}" class="label {%=
(frappe.datetime.get_diff(doc.schedule_date) < 1
&& doc.received_qty < doc.qty)
? "label-danger" : "label-default" %}">
{%= doc.get_formatted("schedule_date") %}</span>
+ </div>
{% } %}
</div>
diff --git a/erpnext/templates/form_grid/stock_entry_grid.html b/erpnext/templates/form_grid/stock_entry_grid.html
index 59bf516..c5f3ecd 100644
--- a/erpnext/templates/form_grid/stock_entry_grid.html
+++ b/erpnext/templates/form_grid/stock_entry_grid.html
@@ -18,7 +18,11 @@
<p>{%= doc.description %}</p>{% } %}
{% include "templates/form_grid/includes/visible_cols.html" %}
<div>
- {% if(doc.s_warehouse) { %}<span class="label label-default">
+ {% if(doc.s_warehouse) { %}<span class="label
+ {%= (doc.actual_qty >= doc.qty) ? "label-success"
+ : "label-danger" %}"
+ title="{%= (doc.actual_qty >= doc.qty) ? __("In Stock")
+ : __("Not In Stock") %}">
{%= doc.s_warehouse || "" %}</span>{% } %}
<i class="icon-long-arrow-right"></i>
{% if(doc.t_warehouse) { %}<span class="label label-primary">