@using PantheonRA.BackOffice.Enums

<div class="modal inmodal fade" id="cashDocumentListModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <div class="col-xs-10">
                        <h3>@Loc.ReceivedCashDocuments</h3>
                    </div>
                    <div class="col-xs-2 text-right">
                        <a class="btn-transparent m-r-sm" href="@Loc.CreationOfCashReceiptsHelpUrl" target="_blank" title="@Loc.CheckInstructions"><i class="fas fa-question clickable-icon"></i></a>
                        <i class="fa fa-times clickable-icon" data-dismiss="modal" title="@Loc.Close"></i>
                    </div>
                </div>
                <div class="row m-t-sm">
                    <div class="col-xs-12">
                        <div class="project-list">
                            <table id="cashDocumentsGrid" data-grid-id="cash-reg-receipt-exp" data-url="@Url.Action("CashRegPaymentsList", "CashRegister")" data-height="calc(30vh - 100px)" class="list-table">
                                <thead>
                                    <tr>
                                        <th width="20%">@Loc.CashDocumentShort</th>
                                        <th width="5%">@Loc.PositionShort</th>
                                        <th width="25%">@Loc.Title</th>
                                        <th width="15%">@Loc.PaymentMethod</th>
                                        <th width="15%">@Loc.Account</th>
                                        <th width="10%">@Loc.Amount</th>
                                        <th width="10%">@Loc.Currency</th>
                                    </tr>
                                </thead>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="onCreateCashDocument()"><i class="fas fa-coins m-r-xs"></i>@Loc.Payment</button>
            </div>
        </div>
    </div>
</div>

<div class="modal inmodal fade" id="createCashDocumentModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-50" role="document">
        <div class="modal-content">
            <div class="well m-b-n">
                <div class="row m-b-sm">
                    <div class="col-xs-12">
                        <h3 class="col-xs-10 no-padding">@Loc.PaymentOfTheInvoiceViaCashReceipt</h3>
                        <div class="m-t-xs pull-right">
                            <a class="btn-transparent m-r-xs no-padding" href="@SiteHelpAttributeHelper.GetHelpUrl(HelpIds.ExampleWholesaleCashReg)" target="_blank" title="@Loc.CheckSamples"><i class="fas fa-book-reader clickable-icon"></i></a>
                            <a class="btn-transparent" href="@Loc.CreationOfCashReceiptsHelpUrl" target="_blank"><i class="fas fa-question clickable-icon"></i></a>
                            <i class="fa fa-times clickable-icon m-l-xs" data-dismiss="modal"></i>
                        </div>
                    </div>

                    <div class="col-xs-5">
                        <div class="col-xs-12">
                            <h2 class="text-primary"><strong>@Loc.ForPayment:</strong></h2>
                        </div>
                        <div class="col-xs-12">
                            <h2 id="createCashDocForPay" class="text-primary font-bold m-t-xxs">0</h2>
                        </div>
                    </div>

                    <div class="col-xs-7 m-t-md padding-left-none">
                        <div class="form-group">
                            @Html.Label("createCashDocCashRegisterLabel", Loc.CashRegister, new { @class = "col-xs-7 control-label text-right m-t-sm" })
                            <div class="col-xs-5 pull-right">
                                <input id="createCashDocCashRegister" class="form-control padding-left-none" value="0" readonly />
                            </div>
                        </div>

                        <div class="form-group">
                            @Html.Label("createCashDocAlreadyPaidLabel", Loc.AlreadyPaid, new { @class = "col-xs-7 control-label text-right m-t-sm" })
                            <div class="col-xs-5 pull-right">
                                <input id="createCashDocAlreadyPaid" class="form-control padding-left-none" value="0" readonly />
                            </div>
                        </div>

                        <div class="form-group">
                            @Html.Label("createCashDocLeftToPayLabel", Loc.LeftToPay, new { @class = "col-xs-7 control-label text-right m-t-sm" })
                            <div class="col-xs-5 pull-right">
                                <input id="createCashDocLeftToPay" class="form-control padding-left-none" value="0" readonly />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-body">
                <div class="form-horizontal form-md form-right m-t-lg">
                    <div class="row">
                        <div class="col-xs-12">
                            <div class="row">
                                <div class="col-xs-4 padding-right-none">
                                    <h4 class="m-t-sm pull-right">@Loc.Currency</h4>
                                </div>
                                <div class="col-xs-8">
                                    @Html.DropDownList("CreateCashDocumentCurrency", new SelectList(ViewBag.Currencies != null ? ViewBag.Currencies : new List<string>(), "Id", "Name", "EUR"),
                                        HtmlAttributesHelper.CreateInputAttributes("form-control", "CreateCashDocumentCurrency", false, Loc.Currency, true))
                                </div>
                            </div>
                        </div>

                        <div class="col-xs-12">
                            <div class="row">
                                <div class="col-xs-4 padding-right-none">
                                    <h4 class="m-t-sm pull-right">@Loc.DocType</h4>
                                </div>
                                <div class="col-xs-8">
                                    @Html.DropDownList("CreateCashDocumentDocType", new SelectList(ViewBag.CashDocumentDocTypes != null ? ViewBag.CashDocumentDocTypes : new List<string>(), "Id", "Name"), "",
                                        HtmlAttributesHelper.CreateInputAttributes("form-control", "CreateCashDocumentDocType", false, Loc.DocType, true))
                                </div>
                            </div>
                        </div>

                        <div class="col-xs-12">
                            <div class="row">
                                <div class="col-xs-4 padding-right-none">
                                    <h4 class="m-t-sm pull-right">@Loc.Date</h4>
                                </div>
                                <div class="col-xs-8">
                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <i class="far fa-calendar alt"></i>
                                        </span>
                                        @Html.TextBox("CreateCashDocumentDate", DateTime.Now.ToString(Loc.DateFormat),
                                            HtmlAttributesHelper.CreateInputAttributes("form-control datepicker", "CreateCashDocumentDate", false, Loc.Date))
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="col-xs-12">
                            <div class="row">
                                <div class="col-xs-4 padding-right-none">
                                    <h4 class="m-t-sm pull-right">@Loc.Pay</h4>
                                </div>
                                <div class="col-xs-8">
                                    <input id="createCashDocumentPay" class="form-control numberInput dont-disable" autocomplete="off" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-dismiss="modal" onclick="createCashRegDocument()"><i class="fa fa-check m-r-xs"></i>@Loc.CreateDocument</button>
            </div>
        </div>
    </div>
</div>

<div class="modal inmodal fade" id="cashRegReceiptExpenditureWarningModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-body">
                <div class="iris-title m-b-sm">
                    <div class="row">
                        <div class="col-xs-11 padding-right-none">
                            <span id="deleteWarningMessage"><strong>@Loc.PaymentTypeNotCash</strong></span>
                        </div>
                        <div class="col-xs-1 pull-right">
                            <i class="fa fa-times clickable-icon m-l-xs" data-dismiss="modal"></i>
                        </div>
                    </div>
                </div>
                <span id="deleteWarningMessage">@Loc.CreateCashDocumentWarning</span>
                <div class="well well-sm well-bg clickable-icon m-t-sm m-b-sm" data-dismiss="modal" id="changePaymentType">
                    <div class="row">
                        <div class="col-xs-2">
                            <div class="icon-arrow-right"></div>
                        </div>
                        <div class="col-xs-10 well-text-margin">
                            <strong>@Loc.ChangePaymentType</strong>
                            <p class="no-margins">@Loc.ChangePaymentTypeOnDocument</p>
                        </div>
                    </div>
                </div>
                <div class="well well-sm well-bg clickable-icon m-b-sm" data-dismiss="modal" id="continueDeleteDocument" onclick="continueCreateCashDocument()">
                    <div class="row">
                        <div class="col-xs-2">
                            <div class="icon-arrow-right"></div>
                        </div>
                        <div class="col-xs-10 well-text-margin">
                            <strong>@Loc.Continue</strong>
                            <p class="no-margins">@Loc.CreateCashDocumentAnyway</p>
                        </div>
                    </div>
                </div>
                <div class="well well-sm well-bg clickable-icon m-b-sm" data-dismiss="modal" onclick="continueCreateCashDocument()">
                    <div class="row">
                        <div class="col-xs-2">
                            <div class="icon-arrow-right"></div>
                        </div>
                        <div class="col-xs-10 well-text-margin">
                            <strong>@Loc.DontWarnMeAnymore</strong>
                            <p class="no-margins">@Loc.DontWantProgramWarning</p>
                        </div>
                    </div>
                </div>
                <div class="well well-sm well-bg clickable-icon m-b-sm" onclick="openCashDocumentWarningHelp()">
                    <div class="row">
                        <div class="col-xs-2">
                            <div class="icon-help icon-full-size"></div>
                        </div>
                        <div class="col-xs-10 well-text-margin">
                            <strong>@Loc.ViewInstructions</strong>
                            <p class="no-margins">@Loc.ViewInstructionsDescription</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>