@using PantheonRA.BackOffice.Enums
@using PAW.Contracts.Enums
@model PantheonRA.BackOffice.Models.Reports.IssuedBillsListViewModel<PantheonRA.BackOffice.Models.Reports.IssuedBillsDetailedFilterModel>
@{
    Layout = null;
    var isLocRS = (PantheonRA.BackOffice.CurrentUser.Localization == PAW.Contracts.Enums.Localization.Code.RS);
    var isLocBG = (PantheonRA.BackOffice.CurrentUser.Localization == PAW.Contracts.Enums.Localization.Code.BG);
}

@Html.Hidden("OurCompIsName2", Model.Filter.OurCompIsName2)

<div class="document-list document-list-double-footer-xs width-99">
    <table id="grid-data" data-grid-id="issued-bills-detailed" class="list-table" data-url="@Url.Action("IssuedBillsDetailedData", "Reports")" data-height="calc(100vh - 320px)">
        <thead>
            <tr>
                <th width="3%"
                    data-function="openPdfPreview('@Url.Action("PAASPrintByAcKeyAndType", "Move")?fiscalize=false&preview=true&acKey={0}&type={1}')"
                    data-function-1="openPdfPreview('@Url.Action("PAASPrintByAcKeyAndType", "Move")?fiscalize=false&preview={2}&acKey={0}&type={1}')">
                </th>
                <th data-visible="@(isLocRS || Model.Filter.Author == AuthorType.ReceivedBills ? false : true)">@Loc.FiscNumber</th>
                <th data-visible="@(isLocRS && Model.Filter.Author != AuthorType.ReceivedBills ? true : false)">@Loc.SDCInvoiceNumber</th>
                <th data-url="@Url.Action("PrintPreview", "CashRegister")?returnUrl=@(Url.Action("IssuedBills", "CashRegister"))&id="
                    data-url-1="@Url.Action("Edit", "Wholesale")?returnUrl=@(Url.Action("IssuedBillsBilling", "Wholesale"))&id="
                    data-url-2="@Url.Action("Edit", "ReceivedBills")?returnUrl=@(Url.Action("ReceivedBillsBilling", "ReceivedBills"))&id=">
                    @Loc.InvoiceRef
                </th>
                <th data-visible="@(isLocBG ? true : false)" data-url="@Url.Action("PrintPreview", "CashRegister")?returnUrl=@(Url.Action("IssuedBills", "CashRegister"))&id="
                    data-url-1="@Url.Action("Edit", "Wholesale")?returnUrl=@(Url.Action("IssuedBillsBilling", "Wholesale"))&id="
                    data-url-2="@Url.Action("Edit", "ReceivedBills")?returnUrl=@(Url.Action("ReceivedBillsBilling", "ReceivedBills"))&id=">
                    @Loc.ProtocolNumberShort
                </th>
                <th>@Loc.DateOfIssue</th>
                <th data-url="@Url.Action("Edit", "Subjects")?id=" data-visible="@(Model.Filter.OurCompIsName2 == false || Model.Filter.Author == AuthorType.ReceivedBills ? true : false)">@Loc.Buyer</th>
                <th data-url="@Url.Action("Edit", "Subjects")?id=" data-visible="@(Model.Filter.OurCompIsName2 == true && Model.Filter.Author != AuthorType.ReceivedBills ? true : false)">@Loc.Buyer</th>
                <th data-url="@Url.Action("Edit", "Subjects")?id=" data-visible="@(Model.Filter.OurCompIsName2 == false || Model.Filter.Author != AuthorType.ReceivedBills ? true : false)">@Loc.Supplier</th>
                <th data-url="@Url.Action("Edit", "Subjects")?id=" data-visible="@(Model.Filter.OurCompIsName2 == true && Model.Filter.Author == AuthorType.ReceivedBills ? true : false)">@Loc.Supplier</th>
                <th>@Loc.Ident</th>
                <th>@Loc.QuantityShort</th>
                <th>@Loc.MeasUnit</th>
                <th class="dt-head-right">@Loc.ForPayment</th>
                <th class="dt-head-right">@Loc.Discount</th>
                <th class="dt-head-right">@Loc.RebatePercent</th>
                <th class="dt-head-right">@Loc.VATPercent</th>
                <th class="dt-head-right">@Loc.TotalTax</th>
                <th>@Loc.Status</th>
            </tr>
        </thead>
    </table>
</div>

<div class="row document-footer document-footer-sm">
    <div class="col-sm-9">
        <div class="form-group">
            <span class="pull-left"><span>@Loc.NumberOfRows:</span> <b class="grid-data-total-items"></b></span>
            <span class="pull-right"><span>@Loc.VAT:</span> <b id="grid-data-vat-sum"></b></span>
            <span class="pull-right m-r-md"><span>@Loc.Total:</span> <b id="grid-data-total-sum"></b></span>
        </div>
    </div>
    <div class="col-sm-3 document-head-highlight-input">
        <div class="form-group text-right">
            <span>@Loc.TotalWithTax:</span> <label id="grid-data-vat-total-sum"></label>
        </div>
    </div>
</div>

<input id="ExportUrl" type="hidden" value="@Url.Action("IssuedBillsDetailedExport", "Reports")" />
<input type="hidden" id="lblConfirmed" value="@Loc.Confirmed" />
<input type="hidden" id="lblNotConfirmed" value="@Loc.NotConfirmed" />
<input type="hidden" id="userLoc" value="@PantheonRA.BackOffice.CurrentUser.Localization" />
<input type="hidden" id="RSLoc" value="@Localization.Code.RS" />