@model PantheonRA.BackOffice.Models.OrderCreateDocumentModel

@{
    Layout = null;
}

@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "createDocumentForm" }))
{
    @Html.HiddenFor(x => x.DocumentAcKey)
    @Html.HiddenFor(x => x.OrderType)
    <div class="divided-content clearfix">
        <div class="divided-content-full">
            <div class="tab-content">
                <div id="createDocTab" class="tab-pane fade in active m-t-md">
                    <div class="col-xs-5 column-full-height-border-right">
                        <div class="form-horizontal form-md">
                            <div class="col-xs-12">
                                <h4>@Loc.Document</h4>
                                <div class="form-group">
                                    @Html.LabelFor(model => model.DocType, Loc.DocType, new { @class = "col-md-5 control-label" })
                                    <div class="col-md-7">
                                        @Html.DropDownListFor(model => model.DocType,
                                                new SelectList(ViewBag.NewDocumentDocTypes != null ? ViewBag.NewDocumentDocTypes : new List<string>(), "Id", "Value"), Loc.Select,
                                                HtmlAttributesHelper.CreateInputAttributes("form-control", "DocTypes", false, Loc.DocType))
                                        @Html.ValidationMessageFor(model => model.DocType, "", new { @class = "text-danger", @id = "DocType-validation" })
                                    </div>
                                </div>
                                <div class="form-group">
                                    @Html.LabelFor(model => model.CreateDate, Loc.Date, new {
                                        @class = "col-md-5 control-label",
                                        @title = Loc.Date
                                    })
                                    <div class="col-md-7">
                                        <div class="input-group">
                                            <span class="input-group-addon">
                                                <i class="far fa-calendar alt"></i>
                                            </span>
                                            @Html.TextBoxFor(model => model.CreateDate, Model.CreateDate.ToString(Loc.DateFormat),
                                                HtmlAttributesHelper.CreateInputAttributes("form-control datepicker", "CreateDate", false, Loc.Date))
                                        </div>
                                        @Html.ValidationMessageFor(model => model.CreateDate, "", new { @class = "text-danger", @id = "Date-validation" })
                                    </div>
                                </div>
                                <div class="form-group">
                                    @Html.LabelFor(model => model.InvoiceDate, Loc.InvoiceDate, new {
                                        @class = "col-md-5 control-label",
                                        @title = Loc.InvoiceDate
                                    })
                                    <div class="col-md-7">
                                        <div class="input-group">
                                            <span class="input-group-addon">
                                                <i class="far fa-calendar alt"></i>
                                            </span>
                                            @Html.TextBoxFor(model => model.InvoiceDate, Model.InvoiceDate.ToString(Loc.DateFormat),
                                                HtmlAttributesHelper.CreateInputAttributes("form-control datepicker", "InvoiceDate", false, Loc.InvoiceDate))
                                        </div>
                                        @Html.ValidationMessageFor(model => model.InvoiceDate, "", new { @class = "text-danger", @id = "InvoiceDate-validation" })
                                    </div>
                                </div>
                                <div class="form-group">
                                    @Html.LabelFor(model => model.TaxDate, Loc.DateTax, new {
                                        @class = "col-md-5 control-label",
                                        @title = Loc.DateTax
                                    })
                                    <div class="col-md-7">
                                        <div class="input-group">
                                            <span class="input-group-addon">
                                                <i class="far fa-calendar alt"></i>
                                            </span>
                                            @Html.TextBoxFor(model => model.TaxDate, Model.TaxDate.ToString(Loc.DateFormat),
                                                HtmlAttributesHelper.CreateInputAttributes("form-control datepicker", "TaxDate", false, Loc.DateTax))
                                        </div>
                                        @Html.ValidationMessageFor(model => model.TaxDate, "", new { @class = "text-danger", @id = "TaxDate-validation" })
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-md-offset-5 col-md-7">
                                        <button type="button" class="btn btn-primary col-md-8 pull-right create-document-from-order" id="createNewDocumentBtn" onclick="createNewDocument()">
                                            <i class="fas fa-plus m-r-xs"></i>
                                            @Loc.CreateDocumentFull
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-7">
                        <div class="form-horizontal form-md">
                            <div class="col-xs-12">
                                <h4>@Loc.TypeOfSubject</h4>

                                <div class="form-group">
                                    <div class="col-md-1 m-t-xs">
                                        @Html.CheckBoxFor(model => model.FillSubject, new { @id = "FillSubject", @class = "form-control js-switch" })
                                    </div>
                                    @Html.LabelFor(model => model.FillSubject, Loc.FillSubject, new { @class = "col-md-11 control-label" })
                                </div>
                                <div class="form-group m-t-md">
                                    <div class="col-md-1 m-t-xs">
                                        @Html.CheckBoxFor(model => model.ConfirmTransferedDocuments, new { @id = "ConfirmTransferedDocuments", @class = "form-control js-switch" })
                                    </div>
                                    @Html.LabelFor(model => model.ConfirmTransferedDocuments, Loc.ConfirmTransferedDocuments, new { @class = "col-md-11 control-label" })
                                </div>
                                <div class="form-group m-t-md">
                                    <div class="col-md-1 m-t-xs">
                                        @Html.CheckBoxFor(model => model.FillAccountDataFromSubject, new { @id = "FillAccountDataFromSubject", @class = "form-control js-switch" })
                                    </div>
                                    @Html.LabelFor(model => model.FillAccountDataFromSubject, Loc.FillAccountTransferDataFromSubject, new { @class = "col-md-11 control-label" })
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div id="transferStatisticTab" class="tab-pane fade m-t-md">
                    <div id="transferStatisticTable" class="project-list">
                        <table id="statistics-grid" class="list-table">
                            <thead>
                                <tr>
                                    <th width="3%">@Loc.PositionShort</th>
                                    <th width="10%">@Loc.DocumentOn</th>
                                    <th width="6%">@Loc.PositionOn</th>
                                    <th width="15%">@Loc.Ident</th>
                                    <th width="15%">@Loc.Title</th>
                                    <th width="10%" class="dt-head-right">@Loc.RequiredQuantity</th>
                                    <th width="8%" class="dt-head-right">@Loc.AddedQuantity</th>
                                    <th width="5%">@Loc.UM</th>
                                    <th width="15%">@Loc.Comment</th>
                                    <th width="13%"class="dt-head-center">@Loc.Status</th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
}

<input type="hidden" value="@ViewBag.ReturnUrl" id="ReturnUrl" name="ReturnUrl" />
