{% 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) { %}
{%= __("Item") %}
{%= __("Qty") %}
{%= __("Rate") %}
{%= __("Amount") %}
{% } else { %}
{%= doc.item_code %} {% if(doc.item_name != doc.item_code) { %}
{%= doc.item_name %}{% } %} {% if(doc.item_name != doc.description) { %}

{%= doc.description %}

{% } %} {% if(doc.sales_order || doc.against_sales_order) { %}

{%= doc.sales_order || doc.against_sales_order %}

{% } %} {% include "templates/form_grid/includes/visible_cols.html" %} {% if(doc.schedule_date) { %}
{%= doc.get_formatted("schedule_date") %}
{% } %}
{%= doc.get_formatted("qty") %}
{%= doc.uom || doc.stock_uom %} {% 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, completed = 100 - cint((doc.qty - delivered) * 100 / doc.qty), title = __("Delivered"); %} {% include "templates/form_grid/includes/progress.html" %} {% } %} {% 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" } } %}
{%= doc.warehouse %}
{% } %}
{% if (!frappe.perm.is_visible("rate", doc, frm.perm)) { %} {%= __("hidden") %} {% } else { %} {%= doc.get_formatted("rate") %} {% if(doc.discount_percentage) { %}
{%= -1 * doc.discount_percentage %}% {% }%} {% } %}
{% if (!frappe.perm.is_visible("amount", doc, frm.perm)) { %} {%= __("hidden") %} {% } else { %} {%= doc.get_formatted("amount") %} {% } %} {% if(in_list(["Sales Order Item", "Purchase Order Item"], doc.doctype) && frm.doc.docstatus===1 && doc.amount) { var completed = 100 - cint((doc.amount - doc.billed_amt) * 100 / doc.amount), title = __("Billed"); %}
  {% include "templates/form_grid/includes/progress.html" %} {% } %}
{% } %}