@using PantheonRA.BackOffice.Models
@using PantheonRA.WebApi.Contracts

@model PaWoEx

    <div class="tabs-container">
        @Html.Partial("_ProcessingTabNavigation")
        <div class="row buttons-tabbed">
            @Html.Partial("_FormButtons", new FormButtonsViewModel
                {
                    BackUrl = Url.Action("Index", "Manufacturing", new { type = ViewBag.ProdType })
                })
            <a href="@Url.Action("Receive", "Manufacturing", new { @id = Model.AcKey, type = ViewBag.ProdType })" id="receiveButton" class="btn btn-success  pull-right" title="@Loc.Receive">
                <i class="fa fa-dolly"></i><span class="bold hidden-xs m-l-xs">@Loc.Receive</span>
            </a>
        </div>
        @Html.HiddenFor(model => model.AcKey)
        <div class="row document-head">
            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-6 document-head-disabled-input">
                <div class="form-group">
                    @Html.LabelFor(model => model.AcKey, Loc.Number, new { @class = "control-label m-t-xs" })
                    <input class="form-control text-center " id="acKeyDisplay" disabled="disabled" type="text" value=" @Model.KeyView">
                </div>
            </div>
            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-6 document-head-disabled-input">
                <div class="form-group typeahead-ident-filter">
                    @Html.Label(Loc.Product, new { @class = "control-label" })
                    <input type="hidden" id="productPlaceholder" title="@Loc.Product" />
                    <input type="text" disabled="disabled" class="typeahead_3 form-control" id="IdentFilterSearch" dataUrl="@Url.Action("SearchIdents", "SetItem")"
                            placeholder="@Loc.EnterIdentProduct" autocomplete="off" value="@Model.Ident" />
                </div>
            </div>
        </div>
        <div class="project-list">
            <table id="mainGridProcessing" data-grid-id="work-order-items" data-url="@Url.Action("WorkOrderItemList", "Manufacturing")" class="cards cardsDailyPlan">
                <thead style="display:none">
                </thead>
            </table>
            
        </div>
    </div>

<input type="hidden" id="itemType" value="@ViewBag.ItemType" />
<input type="hidden" id="prodType" value="@ViewBag.ProdType" />
<input type="hidden" id="operationCaption" value="@Loc.Operation" />
<input type="hidden" id="materialCaption" value="@Loc.MaterialEnum" />

@section pageScripts{
    @Scripts.Render("~/bundles/manufacturing")
    <script>
        $(document).ready(function () {
            if ($("#itemType").val() === "S") {
                initializeWorkOrderOperations();
            }
            else {
                initializeWorkOrderMaterials();
            }
        });
    </script>
}