<?php $__env->startSection('title'); ?>
  <?php echo e(config('app.name')); ?> | Nuevo
<?php $__env->stopSection(); ?>

<?php $__env->startSection('header'); ?>
  <a href="<?php echo e(route('home')); ?>" class="w3-bar-item w3-button"><span class="fa fa-home fa-fw"></span> Home</a>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
  <?php 
    extract($_REQUEST);
   ?>

  <?php if(\Auth::user()->rol->rol_nombre == 'Administrador' || \Auth::user()->rol->rol_nombre == 'Manager' || \Auth::user()->rol->rol_nombre == 'Cartera' || \Auth::user()->rol->rol_nombre == 'Facturador'): ?>
  <div class="w3-content">
  <div class="w3-container">
    <div class="w3-row">
      <div class="w3-col s12 w3-hide-small">
        <?php echo Form::open(['route' => 'erc.recibos.create', 'method' => 'get']); ?>

          <div class="input-group w3-col s4 w3-right">
            <?php echo Form::text('codigo', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'placeholder' => 'Buscar estudiante', 'aria-describedby' => 'search', 'required']); ?>

            <span class="input-group-addon" id="search"><i class="fa fa-search"></i></span>
            <a class="w3-bar-item" data-toggle="tooltip" data-placement="auto bottom" title="Para crear un recibo de caja e-RC digite el código o identificación del usuario. Si existen registros del usuario, los campos se rellenarán automáticamente. Sin embargo, también puede crear uno nuevo."><span class="fa fa-question-circle fa-fw"></span></a>
          </div>
        <?php echo Form::close(); ?>

      </div>
      <div class="w3-col s12 w3-hide-large">
        <?php echo Form::open(['route' => 'erc.recibos.create', 'method' => 'get']); ?>

          <div class="input-group w3-col s12 w3-right">
            <?php echo Form::text('codigo', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'placeholder' => 'Buscar estudiante', 'aria-describedby' => 'search', 'required']); ?>

            <span class="input-group-addon" id="search"><i class="fa fa-search"></i></span>
            <a class="w3-bar-item" data-toggle="tooltip" data-placement="auto bottom" title="Para crear un recibo de caja e-RC digite el código o identificación del usuario. Si existen registros del usuario, los campos se rellenarán automáticamente. Sin embargo, también puede crear uno nuevo."><span class="fa fa-question-circle fa-fw"></span></a>
          </div>
        <?php echo Form::close(); ?>

      </div>
    </div>
  </div>
  <br><br>

  <div class="row w3-text-theme">
    <div class="col-sm-12 text-center">
      <h2><b>Recibo de Caja</b></h2>
    </div>
  </div>

  <?php if(isset($codigo)): ?>
    <div class="row">
      <div class="col-sm-12">
        <div class="w3-panel w3-pale-red w3-padding">
          <span oncli<span onclick="this.parentElement.style.display='none'" class="fa fa-remove w3-button w3-right w3-hover-none"></span>
          No se ha encontrado información del estudiante <b><?php echo e($codigo); ?></b>.</b>
        </div>
      </div>
    </div>
  <?php endif; ?>

  <?php echo Form::open(['route' => 'erc.recibos.store', 'method' => 'post', 'multipart/form-data' => 'true']); ?>

		<div class="row">
			<div class="col-sm-12 w3-padding">
				<div class="row">
					<div class="col-sm-6">
						<div class="form-group">
							<label>Centro Operación*</label>
              <?php echo Form::select('centrooperacion_id', $centros_operacion, old('centrooperacion_id'), ['class' => 'w3-input w3-text-grey w3-border w3-border-theme' , 'onchange' => 'totalAPagar(); return false', 'placeholder' => 'Seleccionar', 'required' => true]); ?>

						</div>
					</div>
					<div class="col-sm-6">
						<div class="form-group">
							<label>N° Liquidación Banner*</label>
              <?php echo Form::text('recibo_codigo_liquidacion', old('recibo_codigo_liquidacion'), ['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'liquidacion_banner', 'onchange' => 'totalAPagar(); return false', 'maxlength' => '20', 'placeholder' => 'Código Liquidación', 'required' => 'true']); ?>

						</div>
					</div>
				</div>
			</div>
		</div>
    <hr>

		<div class="row">
			<div class="col-sm-5 w3-padding">
        <div class="row">
          <div class="col-sm-12">
            <div class="w3-panel w3-leftbar w3-border-theme">
                  <h4 style="padding: .2em"><b>Información Personal</b></h4>
            </div>
          </div>
        </div>
        <p>
          <label>Nombres*:</label>
          <?php echo Form::text('recibo_cliente_nombres', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'nombres', 'maxlength' => '100', 'placeholder' => 'Nombres', 'required' => 'true']); ?>

        </p>
        <p>
		      <label>Identificación*:</label>
          <?php echo Form::text('recibo_cliente_identificacion', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'identificacion', 'maxlength' => '20', 'placeholder' => 'Identificación', 'required' => 'true']); ?>

        </p>
        <p>
				  <label>Programa:</label>
          <?php echo Form::text('recibo_cliente_programa', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'programa', 'maxlength' => '100', 'placeholder' => 'Programa']); ?>

        </p>
        <p>
				  <label>Dirección:</label>
          <?php echo Form::text('recibo_cliente_direccion', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'direccion', 'maxlength' => '100', 'placeholder' => 'Dirección']); ?>

        </p>
        <p>
				  <label>Teléfono*:</label>
          <?php echo Form::text('recibo_cliente_telefono', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'telefono', 'maxlength' => '20', 'placeholder' => 'Teléfono', 'required' => 'true']); ?>

        </p>
        <p>
				  <label>Ciudad:</label>
          <?php echo Form::text('recibo_cliente_ciudad', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'ciudad', 'maxlength' => '100', 'placeholder' => 'Ciudad']); ?>

        </p>
        <p>
				  <label>Observaciones:</label>
          <?php echo Form::textarea('recibo_observaciones', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'observaciones', 'maxlength' => '255', 'rows' => '5', 'placeholder' => 'Observaciones (255 caracteres).']); ?>

        </p>
      </div>
			<div class="col-sm-offset-1 col-sm-6 w3-padding">
        <div class="row">
          <div class="col-sm-12">
            <div class="w3-panel w3-leftbar w3-border-theme">
                  <h4 style="padding: .2em"><b>Conceptos de Caja</b></h4>
            </div>
          </div>
        </div>

        <div class="row">
          <div class="col-sm-12">
            <div class="w3-panel w3-theme w3-padding">
              <span onclick="this.parentElement.style.display='none'" class="fa fa-times w3-button w3-right w3-hover-none"></span>
              Utilizar punto (.) sólo para indicar decimales.
            </div>
          </div>
        </div>

        <div class="row">
    			<div class="col-sm-12">
    				<div id="alerta" class="w3-panel w3-pale-red w3-leftbar w3-border-red" hidden><h4><span class="fa fa-exclamation-triangle"></span> El valor debe ser mayor o igual $0 (Cero).</h4></div>
    			</div>
    		</div>

				<table width="100%" height="320px">
					<tr>
						<th width="40%"></th>
						<th>Valor $0.00</th>
					</tr>
					<tr>
						<th> Matrícula</th>
						<td>
              <?php echo Form::number('concepto_matricula', 0,['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'matricula', 'onblur' => 'totalAPagar();', 'onkeyup' => 'totalAPagar();', 'maxlength' => '20', 'placeholder' => '0.0', 'required' => 'true']); ?>

            </td>
					</tr>
					<tr>
						<th> Carnet</th>
						<td>
              <?php echo Form::number('concepto_carnet', 0,['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'carnet', 'onblur' => 'totalAPagar();', 'onkeyup' => 'totalAPagar();', 'maxlength' => '20', 'placeholder' => '0.0', 'required' => 'true']); ?>

            </td>
					</tr>
					<tr>
						<th> Precooperativa</th>
						<td>
              <?php echo Form::number('concepto_precooperativa', 0,['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'precooperativa', 'onblur' => 'totalAPagar();', 'onkeyup' => 'totalAPagar();', 'maxlength' => '20', 'placeholder' => '0.0', 'required' => 'true']); ?>

            </td>
					</tr>
					<tr>
						<th> Curso de Verano</th>
						<td>
              <?php echo Form::number('concepto_curso_verano', 0,['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'curso_verano', 'onblur' => 'totalAPagar();', 'onkeyup' => 'totalAPagar();', 'maxlength' => '20', 'placeholder' => '0.0', 'required' => 'true']); ?>

            </td>
					</tr>
					<tr>
						<th> Certificados</th>
						<td>
              <?php echo Form::number('concepto_certificado', 0,['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'certificados', 'onblur' => 'totalAPagar();', 'onkeyup' => 'totalAPagar();', 'maxlength' => '20', 'placeholder' => '0.0', 'required' => 'true']); ?>

            </td>
					</tr>
					<tr>
						<th> Derechos de Grado</th>
						<td>
              <?php echo Form::number('concepto_derechos_grado', 0,['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'derechos_grado', 'onblur' => 'totalAPagar();', 'onkeyup' => 'totalAPagar();', 'maxlength' => '20', 'placeholder' => '0.0', 'required' => 'true']); ?>

            </td>
					</tr>
					<tr>
						<th> Habilitación</th>
						<td>
              <?php echo Form::number('concepto_habilitacion', 0,['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'habilitacion', 'onblur' => 'totalAPagar();', 'onkeyup' => 'totalAPagar();', 'maxlength' => '20', 'placeholder' => '0.0', 'required' => 'true']); ?>

            </td>
					</tr>
					<tr>
						<th> Seguro Estudiantil</th>
						<td>
              <?php echo Form::number('concepto_seguro_estudiantil', 0,['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'seguro_estudiantil', 'onblur' => 'totalAPagar();', 'onkeyup' => 'totalAPagar();', 'maxlength' => '20', 'placeholder' => '0.0', 'required' => 'true']); ?>

            </td>
					</tr>
					<tr>
						<th> Estampilla Procultura</th>
						<td>
              <?php echo Form::number('concepto_estampilla', 0,['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'estampilla', 'onblur' => 'totalAPagar();', 'onkeyup' => 'totalAPagar();', 'maxlength' => '20', 'placeholder' => '0.0', 'required' => 'true']); ?>

            </td>
					</tr>
					<tr>
						<th> Inscripción</th>
						<td>
              <?php echo Form::number('concepto_inscripcion', 0,['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'inscripcion', 'onblur' => 'totalAPagar();', 'onkeyup' => 'totalAPagar();', 'maxlength' => '20', 'placeholder' => '0.0', 'required' => 'true']); ?>

            </td>
					</tr>
					<tr>
						<th> Homologación</th>
						<td>
              <?php echo Form::number('concepto_homologacion', 0,['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'homologacion', 'onblur' => 'totalAPagar();', 'onkeyup' => 'totalAPagar();', 'maxlength' => '20', 'placeholder' => '0.0', 'required' => 'true']); ?>

            </td>
					</tr>
					<tr>
						<th> Otros Conceptos</th>
						<td>
              <?php echo Form::number('concepto_otros', 0,['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'otros_conceptos', 'onblur' => 'totalAPagar();', 'onkeyup' => 'totalAPagar();', 'maxlength' => '20', 'placeholder' => '0.0', 'required' => 'true']); ?>

            </td>
					</tr>
					<tr>
						<th> <b>TOTAL</b></th>
						<th>
              <?php echo Form::number('concepto_total', 0,['class' => 'w3-input w3-text-grey w3-border w3-border-theme', 'id' => 'total', 'maxlength' => '20', 'placeholder' => '$0.0', 'readonly' => 'true']); ?>

            </th>
					</tr>
				</table>
			</div>
		</div>
		<hr>

    <div class="row">
      <div class="col-sm-12">
        <div class="w3-panel w3-leftbar w3-border-theme">
              <h4 class="w3-text-theme" style="padding: .2em"><b>Modalidad de Pago</b></h4>
        </div>
      </div>
    </div>

    <div class="row">
			<div class="col-sm-6 w3-padding">
        <?php $__currentLoopData = $pagos; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pago): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <p>
              <?php echo e(Form::checkbox('pago_id[]', $pago->pago_id, null, ['onchange' => 'displayPago(this.value); return false', 'id' => 'checkbox_'.$pago->pago_id])); ?>

              <?php echo e(Form::label('pago_id', $pago->pago_nombre)); ?>

            </p>
            <p class="w3-margin-left">
              <?php echo e(Form::label('recibopago_valor', 'Valor', ['class' => 'valor_'.$pago->pago_id, 'style' => 'display:none;'])); ?>

              <?php echo e(Form::number('recibopago_valor[]', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme valor_'.$pago->pago_id, 'id' => 'valor_'.$pago->pago_id, 'placeholder' => 'Valor', 'style' => 'display:none;', 'disabled'])); ?>

            </p>
             <?php if($pago->pago_nombre == 'Cheque'): ?>
                  <p class="w3-margin-left">
                    <?php echo e(Form::label('recibopago_entidad_bancaria', 'Entidad Bancaria', ['class' => 'valor_'.$pago->pago_id, 'style' => 'display:none;'])); ?>

                    <?php echo e(Form::text('recibopago_entidad_bancaria[]', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme valor_'.$pago->pago_id, 'id' => 'valor_'.$pago->pago_id, 'maxlength' => '100', 'placeholder' => 'Entidad Bancaria', 'style' => 'display:none;', 'disabled'])); ?>

                  </p>
                  <p class="w3-margin-left">
                    <?php echo e(Form::label('recibopago_codigo', 'N° Cheque', ['class' => 'valor_'.$pago->pago_id, 'style' => 'display:none;'])); ?>

                    <?php echo e(Form::number('recibopago_codigo[]', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme valor_'.$pago->pago_id, 'id' => 'valor_'.$pago->pago_id, 'placeholder' => $pago->pago_nombre, 'style' => 'display:none;', 'disabled'])); ?>

                  </p>
                  <p class="w3-margin-left">
                    <?php echo e(Form::label('recibopago_plaza', 'Plaza', ['class' => 'valor_'.$pago->pago_id, 'style' => 'display:none;'])); ?>

                    <?php echo e(Form::number('recibopago_plaza[]', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme valor_'.$pago->pago_id, 'id' => 'valor_'.$pago->pago_id, 'placeholder' => 'Plaza', 'style' => 'display:none;', 'disabled'])); ?>

                  </p>
             <?php elseif($pago->pago_nombre == 'Tarjeta'): ?>
                <!-- visible input -->
                <p class="w3-margin-left">
                  <?php echo e(Form::label('recibopago_entidad_bancaria', 'Entidad Bancaria', ['class' => 'valor_'.$pago->pago_id, 'style' => 'display:none;'])); ?>

                  <?php echo e(Form::text('recibopago_entidad_bancaria[]', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme valor_'.$pago->pago_id, 'id' => 'valor_'.$pago->pago_id, 'maxlength' => '100', 'placeholder' => 'Entidad Bancaria', 'style' => 'display:none;', 'disabled'])); ?>

                </p>
                <p class="w3-margin-left">
                  <?php echo e(Form::label('recibopago_codigo', 'Voucher', ['class' => 'valor_'.$pago->pago_id, 'style' => 'display:none;'])); ?>

                  <?php echo e(Form::number('recibopago_codigo[]', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme valor_'.$pago->pago_id, 'id' => 'valor_'.$pago->pago_id, 'placeholder' => 'Voucher', 'style' => 'display:none;', 'disabled'])); ?>

                </p>

                <!-- hidden input -->
                <p class="w3-margin-left">
                  <?php echo e(Form::number('recibopago_plaza[]', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme valor_'.$pago->pago_id.' hide_'.$pago->pago_id, 'id' => 'valor_'.$pago->pago_id, 'placeholder' => 'Plaza', 'style' => 'display:none;', 'disabled'])); ?>

                </p>
             <?php elseif($pago->pago_nombre == 'Efectivo'): ?>
                <!-- hidden input -->
                <p class="w3-margin-left">
                  <?php echo e(Form::number('recibopago_codigo[]', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme valor_'.$pago->pago_id.' hide_'.$pago->pago_id, 'id' => 'valor_'.$pago->pago_id, 'placeholder' => 'Voucher', 'style' => 'display:none;', 'disabled'])); ?>

                </p>
                <p class="w3-margin-left">
                  <?php echo e(Form::text('recibopago_entidad_bancaria[]', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme valor_'.$pago->pago_id.' hide_'.$pago->pago_id, 'id' => 'valor_'.$pago->pago_id, 'maxlength' => '100', 'placeholder' => 'Entidad Bancaria', 'style' => 'display:none;', 'disabled'])); ?>

                </p>
                <p class="w3-margin-left">
                  <?php echo e(Form::number('recibopago_plaza[]', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme valor_'.$pago->pago_id.' hide_'.$pago->pago_id, 'id' => 'valor_'.$pago->pago_id, 'placeholder' => 'Plaza', 'style' => 'display:none;', 'disabled'])); ?>

                </p>
             <?php elseif($pago->pago_nombre == 'Transferencia'): ?>
                <!-- hidden input -->
                <p class="w3-margin-left">
                  <?php echo e(Form::number('recibopago_codigo[]', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme valor_'.$pago->pago_id.' hide_'.$pago->pago_id, 'id' => 'valor_'.$pago->pago_id, 'placeholder' => 'Voucher', 'style' => 'display:none;', 'disabled'])); ?>

                </p>
                <p class="w3-margin-left">
                  <?php echo e(Form::text('recibopago_entidad_bancaria[]', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme valor_'.$pago->pago_id.' hide_'.$pago->pago_id, 'id' => 'valor_'.$pago->pago_id, 'maxlength' => '100', 'placeholder' => 'Entidad Bancaria', 'style' => 'display:none;', 'disabled'])); ?>

                </p>
                <p class="w3-margin-left">
                  <?php echo e(Form::number('recibopago_plaza[]', null, ['class' => 'w3-input w3-text-grey w3-border w3-border-theme valor_'.$pago->pago_id.' hide_'.$pago->pago_id, 'id' => 'valor_'.$pago->pago_id, 'placeholder' => 'Plaza', 'style' => 'display:none;', 'disabled'])); ?>

                </p>
             <?php endif; ?>
           </p>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
      </div>
    </div>
	  <br>

    <div class="row w3-right">
			<div class="col-sm-12">
				<button type="submit" id="guardar_formulario" class="w3-btn w3-theme"><span class="fa fa-save fa-fw"></span> Guardar</button>
				<button type="reset" class="w3-btn w3-red"><span class="fa fa-paint-brush"></span> Limpiar</button>
			</div>
		</div>
  <?php echo Form::close(); ?>

  </div>
  <?php else: ?>
    <div class="w3-content">
      <div class="w3-panel w3-pale-red w3-leftbar w3-border-red">
        <p class="w3-padding"><br />¡Lo sentimos! Usuario no autorizado.</p>
      </div>
    </div>
  <?php endif; ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>