{% var visible_columns = row.get_visible_columns(["item_code", "qty", "rate", "amount", "stock_uom", "uom", "discount_percentage", "warehouse"]); %} {% if(!doc) { %}
{%= __("Items") %}
{%= __("Amount") %}
{% } else { %} {% var visible_column_fieldnames = $.map(visible_columns, function(x, i) {return x.fieldname}); %}
{% if(doc.warehouse) { var label_class = "label-default", title = "Warehouse", actual_qty = (frm.doc.doctype==="Sales Order" ? doc.projected_qty : doc.actual_qty); if(flt(frm.doc.per_delivered) < 100 && in_list(["Sales Order Item", "Delivery Note Item"], doc.doctype)) { if(actual_qty != undefined) { if(actual_qty >= doc.qty) { var label_class = "label-success"; var title = "In Stock" } else { var label_class = "label-danger"; var title = "Not In Stock" } } } %} {%= doc.warehouse %} {% } %} {% 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; var pending = flt(doc.qty) - flt(delivered); %} {%= doc.item_code %} {% } else { %} {%= doc.item_code %} {% } %} {% if(doc.item_name != doc.item_code && in_list(visible_column_fieldnames, "item_name")) { %} {% if (doc.item_code) { %}
{% } %} {%= doc.item_name %}{% } %} {% include "templates/form_grid/includes/visible_cols.html" %}
{% if (!frappe.perm.is_visible("amount", doc, frm.perm)) { %} {%= __("hidden") %} {% } else { %} {%= doc.get_formatted("amount") %} {% } %} {% if (frappe.perm.is_visible("rate", doc, frm.perm)) { %}
{%= doc.get_formatted("qty") %} {%= doc.uom || doc.stock_uom %} x {%= doc.get_formatted("rate") %}
{% } %}
{% } %}