2014-07-29 10:37:43 +00:00
|
|
|
{% var visible_columns = row.get_visible_columns(["item_code", "item_name", "description", "qty", "rate", "amount", "stock_uom", "uom", "discount_percentage", "schedule_date", "warehouse", "against_sales_order", "sales_order"]); %}
|
|
|
|
|
|
|
|
{% if(!doc) { %}
|
|
|
|
<div class="row">
|
2015-01-13 13:11:40 +00:00
|
|
|
<div class="col-sm-6 col-xs-8">{%= __("Items") %}</div>
|
|
|
|
<div class="col-sm-2 hidden-xs text-right">{%= __("Qty") %}</div>
|
|
|
|
<div class="col-sm-2 hidden-xs text-right">{%= __("Rate") %}</div>
|
|
|
|
<div class="col-sm-2 col-xs-4 text-right">{%= __("Amount") %}</div>
|
2014-07-29 10:37:43 +00:00
|
|
|
</div>
|
|
|
|
{% } else { %}
|
|
|
|
<div class="row">
|
2015-01-13 13:11:40 +00:00
|
|
|
<div class="col-sm-6 col-xs-8"><strong>{%= doc.item_code %}</strong>
|
2014-07-29 10:37:43 +00:00
|
|
|
{% if(doc.item_name != doc.item_code) { %}
|
|
|
|
<br>{%= doc.item_name %}{% } %}
|
|
|
|
{% if(doc.item_name != doc.description) { %}
|
|
|
|
<p>{%= doc.description %}</p>{% } %}
|
2014-12-16 11:49:36 +00:00
|
|
|
<div>
|
|
|
|
{% if(doc.sales_order || doc.against_sales_order) { %}
|
|
|
|
<span class="label label-default"
|
|
|
|
title="{%= __("Sales Order") %}">
|
|
|
|
<i class="icon-file"></i>
|
|
|
|
{%= doc.sales_order || doc.against_sales_order %}
|
|
|
|
</span>
|
|
|
|
{% } %}
|
|
|
|
{% if(doc.warehouse) {
|
|
|
|
var label_class = "label-default",
|
|
|
|
title = "Warehouse",
|
|
|
|
actual_qty = (doc.doctype==="Sales Order"
|
|
|
|
? doc.projected_qty : doc.actual_qty);
|
|
|
|
if(actual_qty != undefined) {
|
|
|
|
if(actual_qty > doc.qty) {
|
|
|
|
var label_class = "label-success";
|
|
|
|
var title = "In Stock"
|
|
|
|
} else {
|
|
|
|
var title = "Not In Stock"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
%}
|
|
|
|
<span style="margin-left: 10px;"
|
|
|
|
title="{%= title %}">
|
|
|
|
<span class="label {%= label_class %}">
|
|
|
|
{%= doc.warehouse %}
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
{% } %}
|
|
|
|
</div>
|
2014-07-29 10:37:43 +00:00
|
|
|
{% include "templates/form_grid/includes/visible_cols.html" %}
|
|
|
|
{% if(doc.schedule_date) { %}
|
2014-08-01 10:37:59 +00:00
|
|
|
<div><span title="{%= __("Reqd By Date") %}" class="label {%=
|
2014-07-29 10:37:43 +00:00
|
|
|
(frappe.datetime.get_diff(doc.schedule_date) < 1
|
|
|
|
&& doc.received_qty < doc.qty)
|
|
|
|
? "label-danger" : "label-default" %}">
|
2014-07-30 13:02:08 +00:00
|
|
|
{%= doc.get_formatted("schedule_date") %}</span>
|
2014-08-01 10:37:59 +00:00
|
|
|
</div>
|
2014-07-29 10:37:43 +00:00
|
|
|
{% } %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- qty -->
|
2015-01-13 13:11:40 +00:00
|
|
|
<div class="col-sm-2 hidden-xs text-right">
|
2014-07-30 13:02:08 +00:00
|
|
|
{%= doc.get_formatted("qty") %}
|
2014-07-29 10:37:43 +00:00
|
|
|
<br><small>{%= doc.uom || doc.stock_uom %}</small>
|
|
|
|
{% if(in_list(["Sales Order Item", "Purchase Order Item"],
|
|
|
|
doc.doctype) && frm.doc.docstatus===1) {
|
|
|
|
var delivered = doc.doctype==="Sales Order Item" ?
|
|
|
|
doc.delivered_qty : doc.received_qty,
|
2014-07-30 13:02:08 +00:00
|
|
|
completed =
|
2015-02-06 07:30:33 +00:00
|
|
|
100 - cint((flt(doc.qty) - flt(delivered)) * 100 / flt(doc.qty)),
|
2014-07-30 13:02:08 +00:00
|
|
|
title = __("Delivered");
|
2014-07-29 10:37:43 +00:00
|
|
|
%}
|
2014-07-30 13:02:08 +00:00
|
|
|
{% include "templates/form_grid/includes/progress.html" %}
|
2014-07-29 10:37:43 +00:00
|
|
|
{% } %}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- rate -->
|
2015-01-13 13:11:40 +00:00
|
|
|
<div class="col-sm-2 hidden-xs text-right">
|
2014-09-01 11:56:00 +00:00
|
|
|
{% if (!frappe.perm.is_visible("rate", doc, frm.perm)) { %}
|
2014-09-01 07:07:52 +00:00
|
|
|
<span class="text-muted">{%= __("hidden") %}</span>
|
|
|
|
{% } else { %}
|
|
|
|
{%= doc.get_formatted("rate") %}
|
|
|
|
{% if(doc.discount_percentage) { %}
|
|
|
|
<br><span class="label label-default pull-right"
|
|
|
|
title="{%= __("Discount") %}">
|
|
|
|
{%= -1 * doc.discount_percentage %}%</span>
|
|
|
|
{% }%}
|
|
|
|
{% } %}
|
2014-07-29 10:37:43 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- amount -->
|
2015-01-13 13:11:40 +00:00
|
|
|
<div class="col-sm-2 col-xs-4 text-right">
|
2014-09-01 11:56:00 +00:00
|
|
|
{% if (!frappe.perm.is_visible("amount", doc, frm.perm)) { %}
|
2014-09-01 07:07:52 +00:00
|
|
|
<span class="text-muted">{%= __("hidden") %}</span>
|
|
|
|
{% } else { %}
|
|
|
|
{%= doc.get_formatted("amount") %}
|
|
|
|
{% } %}
|
|
|
|
|
2014-07-29 10:37:43 +00:00
|
|
|
{% if(in_list(["Sales Order Item", "Purchase Order Item"],
|
|
|
|
doc.doctype) && frm.doc.docstatus===1 && doc.amount) {
|
2014-07-30 13:02:08 +00:00
|
|
|
var completed =
|
2015-02-06 07:30:33 +00:00
|
|
|
100 - cint((flt(doc.amount) - flt(doc.billed_amt)) * 100 / flt(doc.amount)),
|
2014-07-30 13:02:08 +00:00
|
|
|
title = __("Billed");
|
2014-07-29 10:37:43 +00:00
|
|
|
%}
|
|
|
|
<br><small> </small>
|
2014-07-30 13:02:08 +00:00
|
|
|
{% include "templates/form_grid/includes/progress.html" %}
|
2014-07-29 10:37:43 +00:00
|
|
|
{% } %}
|
2015-01-13 13:11:40 +00:00
|
|
|
|
|
|
|
{% if (frappe.perm.is_visible("rate", doc, frm.perm)) { %}
|
|
|
|
<div class="visible-xs text-muted">
|
|
|
|
{%= doc.get_formatted("qty") %} <small>{%= doc.uom || doc.stock_uom %}</small>
|
|
|
|
x {%= doc.get_formatted("rate") %}
|
|
|
|
</div>
|
|
|
|
{% } %}
|
2014-07-29 10:37:43 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% } %}
|