@model PantheonRA.BackOffice.Models.ArsoReportFilterModel
@{
    ViewBag.Title = Loc.Packaging;
}

<div class="wrapper wrapper-content">
    <div class="tabs-container">
        @Html.Partial("_ReportsTabNavigation")
        <div class="row btn-group pull-right m-l buttons-tabbed">
            <button type="button" title="@Loc.Export" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <i class="fa fa-file-pdf-o m-r-xs" id="loader-icon"></i><span class="visible-lg-inline visible-md-inline">@Loc.Export</span> <span class="caret"></span>
            </button>
            <ul class="dropdown-menu">
                <li><a class="journalButton" id="downloadPackagingReport"><i class="fa fa-file-pdf-o fa-lg"></i><span class="m-l-xs">@Loc.ArsoReport</span></a></li>
                <li><a class="journalButton" id="downloadPackagingQuantitySold"><i class="fa fa-file-excel-o fa-lg"></i><span class="m-l-xs">@Loc.QuantitySold</span></a></li>
            </ul>
        </div>

        <div class="tab-content">
            @Html.HiddenFor(model => model.DefaultDecimalPlacesPrice)
            @Html.HiddenFor(model => model.DefaultDecimalPlacesQuantity)
            @Html.HiddenFor(model => model.DefaultDecimalPlacesValue)
            <div class="row document-head">
                <div class="col-md-2 col-xs-4">
                    <div class="form-group">
                        @Html.LabelFor(model => model.Type, Loc.PrintTypeArso, new { @class = "control-label" })
                        <select id="@Html.IdFor(m => m.Type)" name="@Html.NameFor(m => m.Type)" class="form-control custom-select">
                            <option value="0">@Loc.ByInventory</option>
                            <option value="1">@Loc.BySupplier</option>
                        </select>
                    </div>
                </div>
                <div class="col-lg-1 col-md-2  col-xs-4">
                    <div class="form-group">
                        @Html.LabelFor(model => model.DateFrom, Loc.DateFrom, new { @class = "control-label" })
                        @Html.TextBoxFor(m => m.DateFrom, "{0:dd.MM.yyyy}", new { @class = "form-control datepicker", @autocomplete = "off" })
                    </div>
                </div>
                <div class="col-lg-1 col-md-2  col-xs-4">
                    <div class="form-group">
                        @Html.LabelFor(model => model.DateTo, Loc.DateTo, new { @class = "control-label" })
                        @Html.TextBoxFor(m => m.DateTo, "{0:dd.MM.yyyy}", new { @class = "form-control datepicker", @autocomplete = "off" })
                    </div>
                </div>
                <div class="col-md-2 col-xs-6">
                    <div class="form-group">
                        @Html.LabelFor(model => model.SupplierId, Loc.Supplier, new { @class = "control-label" })
                        @Html.TextBoxFor(model => model.SupplierId,
                            HtmlAttributesHelper.CreateInputAttributes("form-control typeahead_3 typeahead_large addable-input", "SupplierId", false, Loc.Supplier, true,
                            new { dataUrl = Url.Action("SearchSuppliers", "ReceivedBills") }))
                    </div>
                </div>
                <div class="col-md-2 col-xs-6">
                    <div class="form-group typeahead-ident-filter">
                        @Html.LabelFor(model => model.Ident, Loc.Ident, new { @class = "control-label" })
                        <input type="hidden" id="ProductPlaceholder" value="" />
                        <input type="text" class="typeahead_3 form-control" id="IdentFilterSearch" dataUrl="@Url.Action("SearchIdents", "SetItem")"
                               placeholder="@Loc.EnterIdentProduct" autocomplete="off" />
                    </div>
                </div>
            </div>

            <div id="packagingContent" class="project-list">
                <div class="document-list width-99">
                    <table id="grid-data" data-grid-id="packing" data-url="@Url.Action("PackagingData", "Reports")" class="list-table">
                        <thead>
                            <tr>
                                <th width="20%">@Loc.Packaging</th>
                                <th width="25%" class="dt-head-center">@Loc.DomesticPackaging</th>
                                <th width="35%" class="dt-head-center">@Loc.EndUserPackaging</th>
                                <th width="20%" class="dt-head-right">@Loc.Total.ToUpper()</th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<input id="packagingReportUrl" value="@Url.Action("PackagingExport", "Reports")" hidden />
<input id="packagingQuantitySold" value="@Url.Action("PackagingQuantitySoldExport", "Reports")" hidden />

@section pageScripts{
    @Scripts.Render("~/bundles/reports")
    <script>
        $(document).ready(function () {
            initializeReportsPackaging();
        });
    </script>
}