more updates to lists and started sane filters

This commit is contained in:
Rushabh Mehta 2014-08-01 16:07:59 +05:30 committed by Anand Doshi
parent 8544447b19
commit 873141c1a5
12 changed files with 87 additions and 10 deletions

View File

@ -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>
{% } %}

View File

@ -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"]]
};

View File

@ -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">

View File

@ -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>

View File

@ -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>

View File

@ -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"]]
};

View File

@ -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>

View File

@ -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"]]
};

View File

@ -11,6 +11,7 @@ from frappe import _
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 @@ form_grid_templates = {
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()

View File

@ -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>

View File

@ -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>

View File

@ -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">