@using PantheonRA.BackOffice.Models
@using PAW.Contracts.Enums;
@model PantheonRA.BackOffice.Models.BaseGridFilterModel
@{
    ViewBag.Title = @Loc.PaymentTypes;
}

<div class="wrapper wrapper-content">
    <div class="tabs-container">
        @Html.Partial("~/Views/Products/_CodeListTabNavigation.cshtml")
        <div class="tab-content">
            <div class="row buttons-tabbed">
                @Html.Partial("_GridButtons", new GridButtonsViewModel
                {
                    AddButton = new PantheonRA.BackOffice.Models.FormButton
                    {
                        Url = Url.Action("Create", "PaymentTypes"),
                        Icon = "fa fa-plus",
                        Text = Loc.CreateNewPaymentType
                    }
                })
            </div>

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

            <div class="project-list">
                <div class="document-list document-list-no-footer">
                    <table id="mainGrid" data-grid-id="payment-types" data-url="@Url.Action("_PaymentTypeList", "PaymentTypes")" class="list-table">
                        <thead>
                            <tr>
                                <th width="5%">@Loc.Active</th>
                                <th style="min-width:50px;" data-url="@Url.Action("Edit", "PaymentTypes")?id=">@Loc.Code</th>
                                <th data-url="@Url.Action("Edit", "PaymentTypes")?id=">@Loc.Name</th>
                                <th>@Loc.Method</th>
                                <th data-visible="@(PantheonRA.BackOffice.CurrentUser.Localization == Localization.Code.SI ||
                                                    PantheonRA.BackOffice.CurrentUser.Localization == Localization.Code.HR)">
                                    @Loc.PaymentType
                                </th>
                                <th data-visible="@(PantheonRA.BackOffice.CurrentUser.Localization == Localization.Code.SI ||
                                                    PantheonRA.BackOffice.CurrentUser.Localization == Localization.Code.HR)">
                                    @Loc.FiscalGroup
                                </th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<input type="hidden" id="ChangeFiscalGroupUrl" value="@Url.Action("ChangeFiscalGroup", "PaymentTypes")" />
<input type="hidden" id="PaymentOtherLoc" value="@Loc.PaymentOther" />
<input type="hidden" id="PaymentCashLoc" value="@Loc.FiscalCash" />
<input type="hidden" id="PaymentCashHrLoc" value="@Loc.HrFiscalGroupCash" />
<input type="hidden" id="PaymentCerditCardLoc" value="@Loc.PaymentCerditCard" />
<input type="hidden" id="PaymentCheckLoc" value="@Loc.PaymentCheck" />
<input type="hidden" id="PaymentTransactionLoc" value="@Loc.PaymentTransaction" />

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