@using PantheonRA.BackOffice
@using PAW.Contracts.Enums;
@using PantheonRA.BackOffice.Models
@model PantheonRA.Contracts.DataContracts.CompanyUnitCreateData
@{
    ViewBag.Title = string.IsNullOrEmpty(Model.Id) ? Loc.CreateNewCompanyUnit : Loc.EditCompanyUnit;
}
<div class="tabs-container">
    @Html.Partial("~/Views/Company/_CompanySettingsTabNavigation.cshtml")
    <div class="tab-content">
        @using (Html.BeginForm(null, null, FormMethod.Post, new { id = "companyUnitForm" }))
        {
            @Html.HiddenFor(model => model.IsMobile)
            @Html.HiddenFor(model => model.QId)
            @Html.HiddenFor(model => model.IsRegisteredWithFiscalAuthority)

            <div class="row buttons-tabbed">
                @Html.Partial("_FormButtons", new FormButtonsViewModel
                {
                    BackUrl = Url.Action("Index", "CompanyUnits"),
                    SaveButtonGroup = new FormButtonGroup
                    {
                        Buttons = new List<FormButton>
                        {
                            new FormButton { Text = Loc.Save, Icon = "far fa-print fa-lg", OnClick = "$('#companyUnitForm').submit();" },
                        }
                    }
                })

                @if ((CurrentUser.Localization == Localization.Code.SI || CurrentUser.Localization == Localization.Code.ME) && !string.IsNullOrEmpty(Model.Id) && Model.QId != 0)
                {
                    if (!Model.IsRegisteredWithFiscalAuthority || !Model.CloseDate.HasValue)
                    {
                        <button id="btnRegisterCompanyUnit" type="button" class="btn btn-primary btn-outline pull-right collapsable-form-button">
                            <i class="fa fa-paper-plane" title="@Loc.RegisterCompanyUnit"></i><span class="hidden-xs hidden-sm m-l-xs">@Loc.RegisterCompanyUnit</span>
                        </button>
                    }
                    if ((!Model.IsRegisteredWithFiscalAuthority || !Model.CloseDate.HasValue) && CurrentUser.Localization != Localization.Code.ME)
                    {
                        <button id="btnCheckFiscalServiceConnectivity" type="button" class="btn btn-primary btn-outline pull-right collapsable-form-button">
                            <i class="fa fa-wifi" title="@Loc.CheckServiceAvailability"></i><span class="hidden-xs hidden-sm m-l-xs">@Loc.CheckServiceAvailability</span>
                        </button>
                    }
                    if (Model.IsRegisteredWithFiscalAuthority && !Model.CloseDate.HasValue)
                    {
                        <button id="btnCloseCompanyUnit" type="button" class="btn btn-primary btn-outline pull-right collapsable-form-button">
                            <i class="fa fa-ban" title="@Loc.CloseCompanyUnit"></i><span class="hidden-xs hidden-sm m-l-xs">@Loc.CloseCompanyUnit</span>
                        </button>
                    }
                }

                <a href="@Url.Action("Create", "CompanyUnits")" title="@Loc.CreateNewCompanyUnit"
                   class="btn btn-primary btn-outline pull-right collapsable-form-button @(string.IsNullOrEmpty(Model.Id) ? "hidden" : string.Empty)">
                    <i class="fas fa-plus m-r-xs"></i>
                    <span class="visible-lg-inline">@Loc.CreateNewCompanyUnit</span>
                </a>
            </div>

            <div class="divided-content clearfix">
                <div class="divided-content-main divided-content-full">
                    <div class="row">
                        <div class="col-md-6 column-full-height-border-right">
                            <div class="form-horizontal">
                                <div class="row">
                                    <div class="col-md-12">
                                        <h3 class="m-b-md m-t-md">@Loc.BasicData</h3>

                                        <div class="form-group">
                                            @Html.LabelFor(model => model.Id, Loc.Code, new { @class = "col-md-3" })
                                            <div class="col-md-9">
                                                @if (Model.IsRegisteredWithFiscalAuthority)
                                                {
                                                    @Html.TextBoxFor(model => model.Id, new { @class = "form-control", @placeholder = Loc.CompanyUnitCode, @autocomplete = "off", @readonly = "readonly" })
                                                }
                                                else
                                                {
                                                    @Html.TextBoxFor(model => model.Id, new { @class = "form-control", @placeholder = Loc.CompanyUnitCode, @autocomplete = "off" })
                                                }
                                                @Html.ValidationMessageFor(model => model.Id)
                                            </div>
                                        </div>
                                        <div class="form-group m-t-sm">
                                            @Html.LabelFor(model => model.Description, Loc.Title, new { @class = "col-md-3" })
                                            <div class="col-md-9">
                                                @Html.TextBoxFor(model => model.Description, new { @class = "form-control", @placeholder = Loc.CompanyUnitDescription, @autocomplete = "off" })
                                                @Html.ValidationMessageFor(model => model.Description)
                                            </div>
                                        </div>
                                        @if (PantheonRA.BackOffice.CurrentUser.Localization == Localization.Code.SI)
                                        {
                                            <div class="form-group">
                                                @Html.LabelFor(model => model.MobileType, Loc.MovableType, new { @class = "col-xs-3" })
                                                <div class="col-xs-9">
                                                    <div><label>@Html.RadioButtonFor(model => model.MobileType, string.Empty, new { @class = "custom-radio" }) <span>N - @Loc.NonMovabeWorkplace</span></label></div>
                                                    @foreach (var movableType in PantheonRA.BackOffice.Enums.FiscalWorkplaceMobileType.SelectList)
                                                    {
                                                        <div><label>@Html.RadioButtonFor(model => model.MobileType, movableType.Value, new { @class = "custom-radio", id = "" }) <span>@movableType.Text</span></label></div>
                                                    }
                                                </div>
                                            </div>
                                        }

                                        <h3 class="m-b-md m-t-md">@Loc.Other</h3>

                                        <div class="form-group">
                                            @Html.LabelFor(model => model.StartDate, Loc.StartDate, new { @class = "col-md-3" })
                                            <div class="col-md-9">
                                                <div class="input-group">
                                                    <span class="input-group-addon"><i class="far fa-calendar alt"></i></span>
                                                    @Html.TextBoxFor(model => model.StartDate, Model.StartDate.ToString(Loc.DateFormat),
                                                        HtmlAttributesHelper.CreateInputAttributes("form-control datepicker", "StartDate", false, Loc.StartDate))
                                                </div>
                                                @Html.ValidationMessageFor(model => model.StartDate)
                                            </div>
                                        </div>

                                        @if (Localization.IsInSecondaryServerFiscalization(PantheonRA.BackOffice.CurrentUser.Localization) && CurrentUser.Localization != Localization.Code.ME)
                                        {
                                            <div class="form-group">
                                                @Html.LabelFor(model => model.WorkTime, Loc.WorkingHours, new { @class = "col-md-3" })
                                                <div class="col-md-9">
                                                    @Html.TextAreaFor(model => model.WorkTime, new { @class = "form-control", @placeholder = Loc.WorkingHours, @autocomplete = "off", @rows = 4 })
                                                    @Html.ValidationMessageFor(model => model.WorkTime)
                                                </div>
                                            </div>
                                        }

                                        <div class="form-group">
                                            @Html.LabelFor(model => model.SpecialPurpose, Loc.SpecialPurpose, new { @class = "col-md-3" })
                                            <div class="col-md-9">
                                                @Html.TextAreaFor(model => model.SpecialPurpose, new { @class = "form-control", @placeholder = Loc.SpecialPurpose, @autocomplete = "off", @rows = 4 })
                                                @Html.ValidationMessageFor(model => model.SpecialPurpose)
                                            </div>
                                        </div>

                                        @if (Localization.IsInSecondaryServerFiscalization(PantheonRA.BackOffice.CurrentUser.Localization) && CurrentUser.Localization != Localization.Code.ME)
                                        {
                                            <div class="form-group">
                                                @Html.LabelFor(model => model.WorkTime, Loc.Registration, new { @class = "col-md-3" })
                                                <div class="col-md-9">
                                                    @Html.TextBoxFor(model => model.RegTime, Model.RegTime.HasValue ? Model.RegTime.Value.ToString(Loc.DateFormat) : string.Empty, new { @class = "form-control datepicker", @placeholder = Loc.Registration, @autocomplete = "off", @rows = 4 })
                                                    @Html.ValidationMessageFor(model => model.RegTime)
                                                </div>
                                            </div>

                                            <div class="form-group">
                                                @Html.LabelFor(model => model.City, Loc.ResponsiblePerson, new { @class = "col-md-3" })
                                                <div class="col-md-9">
                                                    @Html.HiddenFor(model => model.Clerk)
                                                    @Html.TextBoxFor(model => model.ClerkName, new
                                                    {
                                                        @class = "form-control typeahead_3 typeahead_wide",
                                                        @dataUrl = Url.Action("SearchUsers", "Task"),
                                                        @placeholder = Loc.ResponsiblePerson,
                                                        @autocomplete = "off"
                                                    })
                                                    @Html.ValidationMessageFor(model => model.Clerk)
                                                </div>
                                            </div>
                                        }
                                        else
                                        {
                                            @Html.HiddenFor(model => model.RegTime)
                                        }

                                        <div class="form-group">
                                            @Html.LabelFor(model => model.Note, Loc.Note, new { @class = "col-md-3" })
                                            <div class="col-md-9">
                                                @Html.TextAreaFor(model => model.Note, new { @class = "form-control", @placeholder = Loc.Note, @autocomplete = "off", @rows = 4 })
                                                @Html.ValidationMessageFor(model => model.Note)
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            @Html.LabelFor(model => model.TimeOut, Loc.Timeout, new { @class = "col-md-3" })
                                            <div class="col-md-9">
                                                @Html.TextBoxFor(model => model.TimeOut, new { @class = "form-control", @placeholder = "sec", @autocomplete = "off", @type = "number" })
                                                @Html.ValidationMessageFor(model => model.TimeOut)
                                            </div>
                                        </div>
                                        <div class="form-group @(!Model.CloseDate.HasValue ? "hidden" : string.Empty)">
                                            @Html.LabelFor(model => model.CloseDate, Loc.CloseDate, new { @class = "col-md-3" })
                                            <div class="col-md-9">
                                                @Html.TextBoxFor(model => model.CloseDate, "{0: " + Loc.DateTimeFormat + "}", new { @class = "form-control", @readonly = "@readonly" })
                                            </div>
                                        </div>
                                        @if (Localization.IsInSecondaryServerFiscalization(PantheonRA.BackOffice.CurrentUser.Localization) && CurrentUser.Localization != Localization.Code.ME)
                                        {
                                            <div class="form-group">
                                                @Html.LabelFor(model => model.IsActive, Loc.IsActive, new { @class = "col-md-3" })
                                                <div class="col-md-9">
                                                    @Html.CheckBoxFor(model => model.IsActive,
                                                        HtmlAttributesHelper.CreateInputAttributes("form-control js-switch", null, !Model.IsActive, null, false, null, !Model.IsActive))
                                                    @Html.ValidationMessageFor(model => model.IsActive)
                                                </div>
                                            </div>
                                        }
                                        else
                                        {
                                            @Html.HiddenFor(model => model.IsActive)
                                        }

                                        <div class="col-xs-12">
                                            <div class="form-group">
                                                @Html.ValidationSummary(true)
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                @if (CurrentUser.Localization == Localization.Code.ME)
                                {
                                    <h3 class="m-b-md m-t-md">@Loc.LocationData</h3>

                                    <div class="form-group">
                                        @Html.LabelFor(model => model.WorkPlaceCode, Loc.WorkPlaceCode, new { @class = "col-md-3" })
                                        <div class="col-md-9">
                                            @Html.TextBoxFor(model => model.WorkPlaceCode, new { @class = "form-control", @placeholder = Loc.WorkPlaceCode, @autocomplete = "off" })
                                            @Html.ValidationMessageFor(model => model.WorkPlaceCode)
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        @Html.LabelFor(model => model.ENUCode, Loc.EnuIntCode, new { @class = "col-md-3" })
                                        <div class="col-md-9">
                                            @Html.TextBoxFor(model => model.ENUCode, new { @class = "form-control", @placeholder = Loc.EnuIntCode, @autocomplete = "off" })
                                            @Html.ValidationMessageFor(model => model.ENUCode)
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        @Html.LabelFor(model => model.ENUType, Loc.ENUType, new { @class = "col-md-3" })
                                        <div class="col-md-9">
                                            @Html.DropDownListFor(model => model.ENUType, new List<SelectListItem> { new SelectListItem { Text = "Standard", Value = "S" } }, new { @class = "form-control", @placeholder = Loc.ENUType })
                                            @Html.ValidationMessageFor(model => model.ENUType)
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        @Html.LabelFor(model => model.ERPCode, Loc.ERPCode, new { @class = "col-md-3" })
                                        <div class="col-md-9">
                                            @Html.TextBoxFor(model => model.ERPCode, new { @class = "form-control", @placeholder = Loc.ERPCode, @autocomplete = "off" })
                                            @Html.ValidationMessageFor(model => model.ERPCode)
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        @Html.LabelFor(model => model.ERPDeveloperCode, Loc.ERPDeveloperCode, new { @class = "col-md-3" })
                                        <div class="col-md-9">
                                            @Html.TextBoxFor(model => model.ERPDeveloperCode, new { @class = "form-control", @placeholder = Loc.ERPDeveloperCode, @autocomplete = "off" })
                                            @Html.ValidationMessageFor(model => model.ERPDeveloperCode)
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        @Html.LabelFor(model => model.TCRCode, Loc.TCRCode, new { @class = "col-md-3" })
                                        <div class="col-md-9">
                                            @Html.TextBoxFor(model => model.TCRCode, new { @class = "form-control", @placeholder = Loc.TCRCode, @autocomplete = "off", @readonly = "readonly" })
                                            @Html.ValidationMessageFor(model => model.TCRCode)
                                        </div>
                                    </div>
                                }
                            </div>
                        </div>
                        @if (CurrentUser.Localization != Localization.Code.ME)
                        {
                            <div class="col-md-6">
                                <div class="row">
                                    <div class="col-xs-12">
                                        <div class="form-horizontal">
                                            <div class="col-xs-12 hidden-lg hidden-md">
                                                <div class="hr-line-dashed"></div>
                                            </div>
                                            <h3 class="m-b-md m-t-md">@Loc.LocationData</h3>
                                            <div class="form-group">
                                                @Html.LabelFor(model => model.Street, Loc.Address, new { @class = "col-md-3" })
                                                <div class="col-md-5">
                                                    @Html.TextBoxFor(model => model.Street, new { @class = "form-control t-immovable", @placeholder = Loc.Street, @autocomplete = "off" })
                                                    @Html.ValidationMessageFor(model => model.Street)
                                                </div>
                                                <div class="col-md-2 padding-left-none-lg padding-left-none-md">
                                                    @Html.TextBoxFor(model => model.HouseNumber, new { @class = "form-control t-immovable", @placeholder = Loc.StreetNum, @autocomplete = "off" })
                                                    @Html.ValidationMessageFor(model => model.HouseNumber)
                                                </div>
                                                <div class="col-md-2 padding-left-none-lg padding-left-none-md">
                                                    @Html.TextBoxFor(model => model.HouseNumberAdditional, new { @class = "form-control t-immovable", @placeholder = Loc.HouseNumberSuffix, @autocomplete = "off", @title = Loc.HouseNumberSuffix })
                                                    @Html.ValidationMessageFor(model => model.HouseNumberAdditional)
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                @Html.LabelFor(model => model.City, Loc.Post, new { @class = "col-md-3" })
                                                <div class="col-md-3">
                                                    @Html.HiddenFor(model => model.Post)
                                                    <input type="text" value="@Model.Post" id="PostSelect" class="form-control t-immovable typeahead_3 typeahead_large" placeholder="@Loc.ZipCode" autocomplete="off" dataUrl="@Url.Action("SearchPosts", "Post")" />
                                                    @Html.ValidationMessageFor(model => model.Post)
                                                </div>
                                                <div class="col-md-6 padding-left-none-lg padding-left-none-md">
                                                    @Html.TextBoxFor(model => model.City, new { @class = "form-control t-immovable", @placeholder = Loc.Place, @autocomplete = "off" })
                                                    @Html.ValidationMessageFor(model => model.City)
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                @Html.LabelFor(model => model.Municip, Loc.Municip, new { @class = "col-md-3" })
                                                <div class="col-md-9">
                                                    @Html.HiddenFor(model => model.MunicipId)
                                                    @Html.TextBoxFor(model => model.Municip, !string.IsNullOrWhiteSpace(Model.Municip) ? Model.Municip.Trim() : "",
                                                        HtmlAttributesHelper.CreateInputAttributes("form-control t-immovable typeahead_3 typeahead_wide", "Municip", false, Loc.Municip))
                                                    @Html.ValidationMessageFor(model => model.MunicipId, "", new { @class = "text-danger", @id = "MunicipId-validation" })
                                                </div>
                                            </div>

                                            @if (PantheonRA.BackOffice.CurrentUser.Localization == Localization.Code.SI)
                                            {
                                                <div class="form-group">
                                                    @Html.LabelFor(model => model.CadastralNumber, Loc.CadastralMunicip, new { @class = "col-md-3" })
                                                    <div class="col-md-9">
                                                        @Html.TextBoxFor(model => model.CadastralNumber, new { @class = "form-control t-immovable", @placeholder = Loc.CadastralMunicip, @autocomplete = "off" })
                                                        @Html.ValidationMessageFor(model => model.CadastralNumber)
                                                    </div>
                                                </div>

                                                <div class="form-group">
                                                    @Html.LabelFor(model => model.CadastralBuildingNumber, Loc.BuildingNumber, new { @class = "col-md-3" })
                                                    <div class="col-md-9">
                                                        @Html.TextBoxFor(model => model.CadastralBuildingNumber, new { @class = "form-control t-immovable", @placeholder = Loc.BuildingNumber, @autocomplete = "off" })
                                                        @Html.ValidationMessageFor(model => model.CadastralBuildingNumber)
                                                    </div>
                                                </div>

                                                <div class="form-group">
                                                    @Html.LabelFor(model => model.CadastralSectionNumber, Loc.BuildingSectionNumber, new { @class = "col-md-3" })
                                                    <div class="col-md-9">
                                                        @Html.TextBoxFor(model => model.CadastralSectionNumber, new { @class = "form-control t-immovable", @placeholder = Loc.BuildingSectionNumber, @autocomplete = "off" })
                                                        @Html.ValidationMessageFor(model => model.CadastralSectionNumber)
                                                    </div>
                                                </div>
                                            }
                                            else
                                            {
                                                <div class="row">
                                                    <div class="col-xs-12">
                                                        <div class="form-group">
                                                            @Html.LabelFor(model => model.OtherType, Loc.OtherCompanyUnitTypes, new { @class = "col-md-3", title = Loc.OtherCompanyUnitTypes })
                                                            <div class="col-md-9">
                                                                @Html.TextBoxFor(model => model.OtherType, new { @class = "form-control t-immovable", @placeholder = Loc.OtherCompanyUnitTypes, @autocomplete = "off" })
                                                                @Html.ValidationMessageFor(model => model.OtherType)
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            }

                                            <div class="row">
                                                <div class="col-lg-12 m-t-sm">
                                                    <h3 class="m-b-md">@Loc.Warning</h3>
                                                    <div class="flat">
                                                        <p><b>@Loc.LocationData</b></p>
                                                        <p>@Loc.DataAboutRealEstateIsAvailableAt</p>
                                                    </div>
                                                </div>
                                                <div class="col-lg-12 m-t-sm">
                                                    <div class="flat">
                                                        <p><b>@Loc.CompanyUnitCode</b></p>
                                                        <p>@Loc.YouWillNotBeAbleToChangeCompanyUnitCodeWarning</p>
                                                    </div>
                                                </div>
                                                <div class="col-lg-12 m-t-sm" @(Localization.IsInSecondaryServerFiscalization(PantheonRA.BackOffice.CurrentUser.Localization) ? "hidden" : "")>
                                                    <div class="flat">
                                                        <p><b>@Loc.DifferentDevices</b></p>
                                                        <p>@Loc.MultipleDevicesRequireMultipeCompanyUnits</p>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        }
                        else if (!string.IsNullOrEmpty(Model.Id))
                        {
                            <div class="col-md-6">
                                <div class="clearfix">
                                    <h3 class="m-b-md m-t-md display-inline-block">@Loc.WorkPlaceCashData</h3>
                                    @if (Model.IsRegisteredWithFiscalAuthority && !Model.CloseDate.HasValue)
                                    {
                                        <div class="btn-group dropdown m-t-sm pull-right display-inline-block">
                                            <button type="button"
                                                    class="btn btn-primary"
                                                    onClick="openDepositModal('I', '@Model.Id', '@Model.Currency', '@Loc.DepositInput', '@Loc.Value', '@Url.Action("Register", "Deposit")', '@Loc.Error', '@Loc.OK', '@Loc.Cancel', () => { $.fn.dataTable.reload($('#mainGrid')); })"
                                                    title="@Loc.DepositInput">
                                                <i class="fa fa-money m-r-xs"></i>@Loc.RegisterDeposit
                                            </button>
                                            <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                                <span class="caret"></span>
                                            </button>
                                            <ul class="dropdown-menu">
                                                <li>
                                                    <a onclick="openDepositModal('I', '@Model.Id', '@Model.Currency', '@Loc.DepositInput', '@Loc.Value', '@Url.Action("Register", "Deposit")', '@Loc.Error', '@Loc.OK', '@Loc.Cancel', () => { $.fn.dataTable.reload($('#mainGrid')); })">
                                                        @Loc.DepositInput
                                                    </a>
                                                </li>
                                                <li>
                                                    <a onclick="openDepositModal('W', '@Model.Id', '@Model.Currency', '@Loc.DepositOutput', '@Loc.Value', '@Url.Action("Register", "Deposit")', '@Loc.Error', '@Loc.OK', '@Loc.Cancel', () => { $.fn.dataTable.reload($('#mainGrid')); })">
                                                        @Loc.DepositOutput
                                                    </a>
                                                </li>
                                            </ul>
                                        </div>
                                    }
                                </div>
                                <div class="project-list" style="height:calc(100vh - 160px);">
                                    <div class="document-list document-list-no-footer" style="height: 100%; position: relative;">
                                        <table id="mainGrid" data-grid-id="create-company-units" data-url="@Url.Action("WorkPlaceCashList", "Deposit")" class="list-table">
                                            <thead>
                                                <tr>
                                                    <th>@Loc.Date</th>
                                                    <th>@Loc.Operation</th>
                                                    <th>@Loc.SubseqDelivType</th>
                                                    <th>@Loc.Amount</th>
                                                    <th>@Loc.FCDC</th>
                                                </tr>
                                            </thead>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        }
                    </div>
                </div>
            </div>
        }
    </div>
</div>

<input type="hidden" id="LocAvailable" value="@Loc.Available" />
<input type="hidden" id="LocUnavailable" value="@Loc.Unavailable" />
<input type="hidden" id="LocFiscalizationServiceIsAvailable" value="@Loc.FiscalizationServiceIsAvailable" />
<input type="hidden" id="LocFiscalizationServiceIsUnavailable" value="@Loc.FiscalizationServiceIsUnavailable" />
<input type="hidden" id="LocErrorHappenedWhileCheckingFiscalServiceConnectivity" value="@Loc.ErrorHappenedWhileCheckingFiscalServiceConnectivity" />
<input type="hidden" id="LocError" value="@Loc.Error" />
<input type="hidden" id="LocErrorHappenedWhileRegisteringCompanyUnit" value="@(Loc.ErrorHappenedWhileRegisteringCompanyUnit + " " + Model.Id)" />
<input type="hidden" id="LocCompanyUnitRegistration" value="@Loc.CompanyUnitRegistration" />
<input type="hidden" id="LocAreYouSureYouWantToRegisterCompanyUnit" value="@string.Format(Loc.AreYouSureYouWantToRegisterCompanyUnit, Model.Id)" />
<input type="hidden" id="LocAreYouSureYouWantToSendCompanyUnitChange" value="@Loc.AreYouSureYouWantToSendCompanyUnitChange" />
<input type="hidden" id="LocYes" value="@Loc.Yes" />
<input type="hidden" id="LocNo" value="@Loc.No" />
<input type="hidden" id="LocOk" value="@Loc.OK" />
<input type="hidden" id="LocYouHaveRegisteredThisCompanyUnitWithFiscalAuthority" value="@Loc.YouHaveRegisteredThisCompanyUnitWithFiscalAuthority" />
<input type="hidden" id="LocInvalidCompanyUnitData" value="@Loc.InvalidCompanyUnitData" />
<input type="hidden" id="LocCompanyUnitRegistered" value="@string.Format(Loc.CompanyUnitRegistered, Model.Id)!" />
<input type="hidden" id="LocCompanyUnitClose" value="@Loc.CompanyUnitClose" />
<input type="hidden" id="LocAreYouSureYouWantToCloseCompanyUnit" value="@string.Format(Loc.AreYouSureYouWantToCloseCompanyUnit, Model.Id)" />
<input type="hidden" id="LocCompanyUnitClosed" value="@string.Format(Loc.CompanyUnitClosed, Model.Id)" />
<input type="hidden" id="LocYouHaveRegisteredThisCompanyUnitClosingWithFiscalAuthority" value="@Loc.YouHaveRegisteredThisCompanyUnitClosingWithFiscalAuthority" />
<input type="hidden" id="LocGeneralError" value="@Loc.GeneralError" />
<input type="hidden" id="UrlCompanyUnitClose" value="@Url.Action("Close", "CompanyUnits")" />
<input type="hidden" id="UrlCompanyUnitRegister" value="@Url.Action("_Register", "CompanyUnits")" />
<input type="hidden" id="UrlGetMunicipalities" value="@Url.Action("SearchMunicipalities", "Subjects")" />
<input type="hidden" id="UrlCheckFiscalServiceConnectivity" value="@Url.Action("_CheckFiscalServiceConnectivity", "CompanyUnits")" />

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