<kt-portlet>
	<kt-portlet-header [title]="(isNewFormaPago)? 'Crear nueva forma de pago' : 'Editar forma de pago'"
					   [class]="'kt-portlet__head--lg'">
		<div ktPortletTools class="d-flex">
			<button [routerLink]="(isNewFormaPago)? ['../']: ['../../']"
					class="btn btn-primary kt-margin-r-10"
					[disabled]="loading"
					mat-raised-button matTooltip="Regresar">
				<i class="la la-arrow-left"></i>
				<span class="kt-hidden-mobile">Regresar</span>
			</button>
			<!--<button *ngxPermissionsOnly="(isNewFormaPago)? 'administrador.formas_pagos.store' : 'administrador.formas_pagos.update'"-->
			<button class="btn btn-primary kt-margin-r-10" (click)="onSubmit()"
					[ngClass]="{'kt-spinner kt-spinner--right kt-spinner--md kt-spinner--light': loading}"
					[disabled]="loading"
					mat-raised-button matTooltip="{{(isNewFormaPago) ? 'Guardar' : 'Actualizar'}} y salir">
				<i class="la la-save"></i>
				<span class="kt-hidden-mobile">{{(isNewFormaPago) ? 'Guardar' : 'Actualizar'}}</span>
			</button>
		</div>
	</kt-portlet-header>

	<kt-portlet-body>
		<mat-tab-group [(selectedIndex)]="selectedTab">
			<mat-tab>
				<ng-template mat-tab-label>
					<!--i class="mat-tab-label-icon fa fa-building"></i--> Información básica
				</ng-template>
				<ng-template matTabContent>
					<!--begin::Form-->
					<!--<div *ngxPermissionsOnly="'administrador.formas_pagos.show'">-->
					<div>
						<div class="mat-table__bottom justify-content-center" *ngIf="isLoading">
							<mat-spinner [diameter]="25"></mat-spinner>
							<div class="mat-table__message ml-3">
								Espera un momento....
							</div>
						</div>
						<form [formGroup]="formaPagoForm" class="kt-form kt-form--group-seperator-dashed"
							  [hidden]="isLoading">
							<div class="kt-form__section kt-form__section--first">
								<div class="form-group kt-form__group row">
									<div class="col-lg-4 kt-margin-bottom-20-mobile">
										<mat-form-field class="mat-form-field-fluid">
											<input matInput type="text" placeholder="Nombre(s)" formControlName="nombre" required>
											<mat-hint *ngIf="isControlValid('first_name')">Por favor introduce el
												<strong>nombre</strong>
											</mat-hint>
											<mat-hint *ngIf="!isControlValid('first_name')">
												<strong>Datos correctos</strong>
											</mat-hint>
											<mat-error *ngIf="isControlHasError('first_name','required')">
												El campo es <strong>requerido</strong>
											</mat-error>
											<mat-error *ngIf="isControlHasError('first_name','maxlength')">
												Debe contener máximo <strong>128</strong> caracteres
											</mat-error>
										</mat-form-field>
									</div>
                                    <div>
                                        <mat-checkbox formControlName="zeros">¿Permite costo cero al guardar servicio?</mat-checkbox>
                                    </div>
								</div>
							</div>
						</form>
                        <div>
                        </div>
					</div>
					<!--end::Form-->
				</ng-template>
			</mat-tab>
		</mat-tab-group>
	</kt-portlet-body>
</kt-portlet>
