[refactor] stock entry, minor ux

This commit is contained in:
Rushabh Mehta
2015-02-17 19:55:17 +05:30
parent 0fb678e7cf
commit df9e80c87a
7 changed files with 284 additions and 275 deletions

View File

@@ -14,9 +14,9 @@
<br>{%= doc.item_name %}{% } %}
{% if(doc.item_name != doc.description) { %}
<p>{%= doc.description %}</p>{% } %}
<div>
<p>
{% if(doc.sales_order || doc.against_sales_order) { %}
<span class="label label-default"
<span class="label label-default" style="margin-right: 10px;"
title="{%= __("Sales Order") %}">
<i class="icon-file"></i>
{%= doc.sales_order || doc.against_sales_order %}
@@ -36,22 +36,28 @@
}
}
%}
<span style="margin-left: 10px;"
<span style="margin-right: 10px;"
title="{%= title %}">
<span class="label {%= label_class %}">
{%= doc.warehouse %}
</span>
</span>
{% } %}
</div>
</p>
{% include "templates/form_grid/includes/visible_cols.html" %}
{% if(doc.schedule_date) { %}
<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 class="clearfix"></div>
<div>
{% if(frappe.datetime.get_diff(doc.schedule_date) < 1 && doc.received_qty < doc.qty) { %}
<span class="text-danger">
{%= __("Overdue on {0}", [doc.get_formatted("schedule_date")]) %}
</span>
{% } else { %}
<span class="text-muted">
{%= __("Due on {0}", [doc.get_formatted("schedule_date")]) %}
</span>
{% } %}
</div>
{% } %}
</div>

View File

@@ -13,24 +13,7 @@
<br>{%= doc.item_name %}{% } %}
{% if(doc.item_name != doc.description) { %}
<p>{%= doc.description %}</p>{% } %}
{% include "templates/form_grid/includes/visible_cols.html" %}
{% if(doc.schedule_date) { %}
<br><span title="{%= __("Reqd By Date") %}" class="label {%=
(frappe.datetime.get_diff(doc.schedule_date, frappe.datetime.get_today()) < 0
&& doc.ordered_qty < doc.qty)
? "label-danger" : "label-default" %}">
{%= doc.get_formatted("schedule_date") %}</span>
{% } %}
</div>
<!-- qty -->
<div class="col-sm-3 text-right">
{%= doc.get_formatted("qty") %}
<small>{%= doc.uom || doc.stock_uom %}</small>
{% var completed =
100 - cint((doc.qty - cint(doc.ordered_qty)) * 100 / doc.qty),
title = __("Ordered"); %}
{% include "templates/form_grid/includes/progress.html" %}
<div>
{% if(doc.warehouse) { %}
<div style="overflow:hidden; min-height: 25px;
white-space:nowrap; text-overflow: ellipsis;"
@@ -40,6 +23,26 @@
</span>
</div>
{% } %}
{% if(doc.schedule_date) { %}
<span title="{%= __("Reqd By Date") %}" class="label {%=
(frappe.datetime.get_diff(doc.schedule_date, frappe.datetime.get_today()) < 0
&& doc.ordered_qty < doc.qty)
? "label-danger" : "label-default" %}">
{%= doc.get_formatted("schedule_date") %}</span>
{% } %}
</div>
{% include "templates/form_grid/includes/visible_cols.html" %}
</div>
<!-- qty -->
<div class="col-sm-3 text-right">
{%= doc.get_formatted("qty") %}
<div class="small">{%= doc.uom || doc.stock_uom %}</div>
{% if(doc.qty == doc.ordered_qty) { %}
<div class="small text-success">{%= __("Ordered") %}</div>
{% } else { %}
<div class="small text-muted">{%= __("{0} Ordered", doc.ordered_qty) %}</div>
{% } %}
</div>
</div>
{% } %}