@using DevExtreme.AspNet.Mvc.Builders
@using XS.ERP.Core.Entities
@using XS.ERP.UI.Web.Razor.Models
@using XS.ERP.Common.Constant
@using XS.ERP.UI.Web.Razor.V2.Models.ApiDto
@model ProductInventoryViewModel

<script>    
</script>

@Html.AntiForgeryToken()
<div class="content-block">
    <div style="margin-top:20px;">
        @(
            Html.DevExtreme().DataGrid<DtoInventory>()
                .ID("gridProductInventory")
                .DataSource(new JS("arraySOHeaderData"))
                .Height(750)
                .StateStoring(s => s.Enabled(true).Type(StateStoringType.LocalStorage).StorageKey("gridProductInventory"))
                .Columns(columns =>
                {
                    columns.AddFor(m => m.Id).Caption("Id");
                    columns.AddFor(m => m.Product.Name).Caption("Product").Width(200);
                    columns.AddFor(m => m.Product.Description).Caption("Description");
                    columns.Add().Caption("Quantity").CellTemplate(
            @<text><%= formatNumberWithDecimalPlaces(data.Qty) %> </text>
            );
                    columns.AddFor(m => m.Booked).Caption("Booked").Format(f => f.Type(Format.FixedPoint).Precision(2));
                    columns.AddFor(m => m.Reserved).Caption("Reserved").Format(f => f.Type(Format.FixedPoint).Precision(2));
                    columns.AddFor(m => m.CreatedDate).Caption("Create Date");
                }
                )
    </div>
 </div>