@using PantheonRA.BackOffice.Enums
@using PantheonRA.BackOffice.Models
@model PantheonRA.BackOffice.Models.Reports.IssuedBillsListViewModel<PantheonRA.BackOffice.Models.Reports.ReceivedCashDocumentsFilter>

<div class="row buttons-tabbed">
    <a class="btn btn-primary operations journalButton pull-right" href="@Url.Action("Index", "Journal")" title="@Loc.CashRegisterJournal">
        <i class="fas fa-cash-register"></i>
        <span class="m-l-xs visible-lg-inline visible-md-inline">@Loc.CashRegisterJournal</span>
    </a>

    <a id="downloadIssuedBills" class="btn btn-primary pull-right">
        <i class="fas fa-file-excel" title="@Loc.ExportToExcel"></i><span class="bold visible-lg-inline visible-md-inline m-l-xs">@Loc.Export</span>
    </a>
</div>

<div class="row document-head">
    @Html.Hidden("DefaultDecimalPlacesPrice", Model.Filter.DefaultDecimalPlacesPrice)
    @Html.Hidden("DefaultDecimalPlacesQuantity", Model.Filter.DefaultDecimalPlacesQuantity)
    @Html.Hidden("DefaultDecimalPlacesValue", Model.Filter.DefaultDecimalPlacesValue)
    <div class="col-md-4">
        <div class="form-group">
            <label class="control-label">@Loc.SearchFilter</label>
            @Html.TextBoxFor(model => model.Filter.Keywords, new { @id = "Keywords", @class = "form-control search-input", @placeholder = Loc.Search, autocomplete = "off" })
        </div>
    </div>

    <div class="col-md-2 col-xs-4 dateFilter">
        <div class="form-group">
            <label class="control-label">@Loc.DateFrom</label>
            <div class="input-group">
                <span class="input-group-addon"><i class="far fa-calendar alt"></i></span>
                <input class="form-control datepicker" id="Filter_DateFrom" name="Filter.DateFrom" type="text" value="@DateTime.Now.Date.AddDays(-1).ToString(Loc.DateFormat)">
            </div>
        </div>
    </div>
    <div class="col-md-2 col-xs-4 dateFilter">
        <div class="form-group">
            <label class="control-label">@Loc.DateTo</label>
            <div class="input-group">
                <span class="input-group-addon"><i class="far fa-calendar alt"></i></span>
                <input class="form-control datepicker" id="Filter_DateTo" name="Filter.DateTo" type="text" value="@DateTime.Now.Date.ToString(Loc.DateFormat)">
            </div>
        </div>
    </div>
</div>

<div class="project-list">
    <div class="document-list width-99">
        <table id="mainGrid" data-grid-id="received-cash-documents" data-url="@Url.Action("ReceivedCashDocumentsData", "Reports")" class="list-table">
            <thead>
                <tr>
                    <th data-url="@Url.Action("PrintPreview", "Journal")?returnUrl=@(Url.Encode(HttpContext.Current.Request.Url.AbsolutePath))&id=">@Loc.JournalNumber</th>
                    <th>@Loc.Customer</th>
                    <th>@Loc.DocType</th>
                    <th>@Loc.CashregClose</th>
                    <th class="dt-head-right">@Loc.TotalWithTax</th>
                </tr>
            </thead>
        </table>
    </div>

    <div class="row document-footer document-footer-sm">
        <div class="col-md-9 col-xs-6">
            <div class="form-group">
                <span class="pull-left"><span>@Loc.NumberOfInvoices:</span> <b id="grid-data-total-items"></b></span>
            </div>
        </div>
        <div class="col-md-3 col-xs-6 document-head-highlight-input">
            <div class="form-group text-right">
                <span>@Loc.Amount:</span> <label id="grid-data-total-sum"></label>
            </div>
        </div>
    </div>

    @*<div class="flat well text-right" style="padding-right:10px;">
            <strong>@Loc.Total.ToUpper() <span id="grid-data-start-items"></span> @Loc.To.ToLower() <span id="grid-data-total-items"></span>: </strong>
            <span id="grid-data-total-sum"></span>
        </div>*@
</div>

<input id="ExportUrl" type="hidden" value="@Url.Action("ReceivedCashDocumentsExport", "Reports")" />
<input id="CustomDateValue" type="hidden" value="@ItemsDisplayFilterType.CustomDate" />