<%@include file="/jsp/common/defaultTopLogin.jsp"%>

<style>
 
 table.tSuscriptores, table.tFlat{
  border-collapse: collapse; 
 }
 
 table.tSuscriptores tbody td, table.tFlat tbody td, table.bono tbody td,
 table.tSuscriptores tbody th, table.tFlat tbody th, table.bono tbody th,
 table.tSuscriptores thead th, table.tFlat thead th, table.bono thead th 
 {
     border    : 1px solid black;
     text-align: center;              
     font-size : 12px;
     min-width : 90px;
 }  
 
 table.tSuscriptores th:first-child, table.tFlat th:first-child 
 {     
     min-width : 160px;
 }
 
 table.tFlat thead th:last  
 {     
     min-width : 20px;
     background : white;
 }
     
 .thMin { 
    min-width : 20px;
    background : white;
 }
 
 div.divtabla{
  overflow-x:scroll;   
 }
 
 table input{
      border:0px solid #000; 
      margin:0; 
      background:transparent;
      width:100%;
      text-align: right;
 }
  
 table tr.categoria td:first-child input{
      text-align: left;
 } 
</style>

<form action="guardarDatosFees" method="post" id="forma" name="forma" class="form-horizontal">

	<input type="hidden" id="pmn" name="pmn" value="${pmn}" />
	<input type="hidden" id="numAnios"/>
	<input type="hidden" id="numRangos"/>
    <input type="hidden" id="request"          name="request"/>
    <input type="hidden" id="operacion"        name="operacion"/> 		 		
    <input type="hidden" id="requestEliminar"  name="requestEliminar"/>
    <input type="hidden" id="periodosEliminar" name="periodosEliminar"/>	                    
    <input type="hidden" id="msgExito" value="${msgExito}"/>
	<input type="hidden" id="msgError" value="${msgError}"/>
	<input type="hidden" id="requestBono"  name="requestBono"/>	
					
	<div class="form-group">		
		<div class="col-sm-2">
			<label class="radio-inline"><input type="radio" id="optradioSusc" >Suscriptores</label>
		</div>		
		<div class="col-sm-2">
			<label class="radio-inline"><input type="radio" id="optradioFlat">Flat</label>						
		</div>
		<div class="col-sm-2">
			<label class="radio-inline"><input type="radio" id="optradioCostoTotal">Costo Total</label>						
		</div>
		<div class="col-sm-2">
			<label class="radio-inline"><input type="radio" id="optradioNA">NA</label>						
		</div>				
		<div class="col-sm-2">	  				
			<input type="button" id="nuevoPeriodo" class="btn btn-primary" value="Agregar Periodo">
		</div>
		<div class="col-sm-2">	  				
			<input type="button" id="cargaExcel" class="btn btn-primary" value="Carga Excel">
		</div>						
	</div>

	<br>
	<div class ="row">
   		  <label id="labelError" class="text-danger" for="porcentaje" style="display:none">*Seleccione un filtro para la b&uacute;squeda.</label>
   	</div>	  		
	<br>
	
	<div class="form-group" id="divCostoTotal">
					<div class="col-sm-1" >	
						<br>
						<label id="costoTotalLbl" class="control-label">Costo Total:</label>										
					</div>
					
					<div class="col-sm-2" >
						<br>
						<input type="number" min="0" name="price" pattern="0.00" step=".01" value="${costoTotal}" id="costoTotalNmb" class="form-control"/>				
					</div>
	</div>
				
	<div class="form-group" id="divVigencia">
	
					<div class="col-sm-1" >			  	    
					  	<label class="control-label">Vigencia Contrato</label>
					</div>
					
					<div class="col-sm-2" >
						<br>				    			    
					  	<input type="text" id="fechaCtoInicio" name="fechaCtoInicio" value="" class="form-control"  width="100px" readonly>						
					</div>
									
					<div class="col-sm-2" >
						<br>
					  	<input type="text" id="fechaCtoFin" value="" class="form-control" readonly>						
					</div>
					
					<div class="col-sm-1" >
						<label id="labInflacion" class="control-label">Porcentaje Inflaci&oacute;n</label>						
				       </div>
								
					<div class="col-sm-2">
						<br>	  				
						<input id="inflacion"  name="inflacion" type="text" class="form-control" value="${inflacion}">
					</div>												  									  							  			
	</div>

	<div class="form-group">
			<div id="divSuscriptores" style="display:none;"></div>
	  		<div id="divFlat"         style="display:none;"></div>
	  		<div id="divBonoCont"     style="display:none;"></div>
	</div>

	<br>

	<div id="divJustificacion" class="form-group">
	    	<label for="justificacion" class="col-md-2 control-label">Justificaci&oacute;n:</label>
		    <div  class="col-md-10" >
		       <jsp:include page="/jsp/dda/contrato/common/justificacion.jsp" />
			   <textarea class="form-control" rows="3" id="justificacion" name="justificacion" maxlength="150">${justificacion}</textarea>					   
			</div>
	</div>		
			  	
</form>

	<div id="divBotones" style="display:none" >
		<div class="form-group pull-right">
	          <a href="../../contrato/listado/irListado?pmn=${sessionScope.pmnReturn}&tipoContrato=${tipoContrato}" class="btn btn-default" roll="button" >Regresar</a>			
	  		  <button id="subirDoc" class="btn btn-info" type="button" data-bs-toggle="modal" data-bs-target="#modalDocum">Subir documento</button>
			  <button class="btn btn-success" id="guardarBtn" type="submit">Guardar cambios</button>
		</div>
	</div>
	
	<div id='dialogTitulosCate' class='modal  bs-example-modal-lg' id='modalTitulo' style='display:hide'>
		 <div class='modal-dialog  modal-lg'>
		    <div class='modal-content'>
				<div class='modal-header'>
				 <button type='button' class='close' data-bs-dismiss='modal' aria-hidden='true'>X</button>
					<h3 class='modal-title'>Advertencia</h3>
				</div>
				<div class='modal-body'>										 
				</div>
				<div class='modal-footer'>
				    <button type='button' class='btn btn-default' data-bs-dismiss='modal' >Cerrar</button>							
				</div>
			</div>
		</div>
	</div>
	
	<div id='dialogAgregarPeriodo' name='dialogAgregarPeriodo' class='modal  bs-example-modal-sm' >
		 <div class='modal-dialog  modal-lg'>
		    <div class='modal-content'>
				<div class='modal-header'>
				 <button type='button' class='close' data-bs-dismiss='modal' aria-hidden='true'>X</button>
					<h3 class='modal-title'>Nuevo Periodo</h3>
				</div>
				<div class='modal-body'>
									
				    <label id="labErrAddPerS" style="color:red;"></label>
					<div class='row'>
						<div class="col-sm-2">
							<label>A&ntilde;o Contrato</label>
						</div>						
						<div class="col-sm-3">
							<input type="text" id="anioContrato" class="form-control"/>
						</div>
						<div class="col-sm-3">																					
						</div>
						<div class="col-sm-4">																					
						</div>
					</div>
					<br>
					
					<div class='row'>
						<div class="col-sm-2">
							<input type="radio" id="perBase" > Periodo Base:<br>
						</div>						
						<div class="col-sm-3">
							<select id="selectPeriodos">							  							  
							</select>
						</div>
						<div class="col-sm-3">														
							<input type="checkbox" id="checkInfla"> Inflaci&oacute;n<br>
						</div>
						<div class="col-sm-4">																					
						</div>
					</div>
					<br>
					<div class='row'>
						<div class="col-sm-2">
							<input type="radio" id="perVacio" value="female"> Periodo Vac&iacute;o<br>
						</div>						
					</div>										
				</div>
				<div class='modal-footer'>					
				    	<button type='button' id="aceptarPer" class='btn btn-default' >Aceptar</button>				    						
				</div>
			</div>
		</div>
	</div>
	
	
	<div id='dialogAgregarPeriodoFlat' name='dialogAgregarPeriodo' class='modal  bs-example-modal-sm' >
		 <div class='modal-dialog  modal-lg'>
		    <div class='modal-content'>
				<div class='modal-header'>
				 <button type='button' class='close' data-bs-dismiss='modal' aria-hidden='true'>X</button>
					<h3 class='modal-title'>Nuevo Periodo</h3>
				</div>
				<div class='modal-body'>
				    <input type="hidden" id="hidIdPer"/>
				    <label id="labErrAddPer" style="color:red;"></label>
				    <div class='row'>
						<div class="col-sm-2">
							<label>A&ntilde;o Contrato</label>
						</div>
						<div class="col-sm-2">																					
						</div>						
						<div class="col-sm-3">
							<input type="text" id="anioContratoFlaclass="form-control"sm"/>
						</div>						
						<div class="col-sm-4">																					
						</div>
					</div>
					<br>
					<div class='row'>
						<div class="col-sm-3">
							<input type="radio" id="perBaseF" > Replicar Último Periodo:<br>
						</div>						
						<div class="col-sm-1">
							<br>
							<label>Periodo</label>
						</div>
						<div class="col-sm-2">						
							<input type="text" id="iniAddPeriodo" class="form-control datepicker" >
						</div>
						<div class="col-sm-1">
						    <br>
							<label>al</label>
						</div>
						<div class="col-sm-2">
							<input type="text" id="finAddPeriodo" class="form-control datepicker" >
						</div>						
						<div class="col-sm-4">																					
						</div>
					</div>
					<br>
					<div class='row'>
						<div class="col-sm-2">
							<input type="radio" id="perVacioF" value="female"> Periodo Vac&iacute;o<br>
						</div>
					</div>										
				</div>
				<div class='modal-footer'>					
				    	<button type='button' id="aceptarPerFlat" class='btn btn-default' >Aceptar</button>				    						
				</div>
			</div>
		</div>
	</div>			
	
	<div id='modificarPeriodo' name='modificarPeriodo' class='modal  bs-example-modal-sm' >
		 <div class='modal-dialog  modal-lg'>
		    <div class='modal-content'>
				<div class='modal-header'>
				 <button type='button' class='close' data-bs-dismiss='modal' aria-hidden='true'>X</button>
					<h3 class='modal-title'>Modificar Periodo</h3>
				</div>
				<div class='modal-body'>				
					<div class='row' id="ediFlatPeriodo">
					    	<div class="col-sm-1">																					
							</div>
							<div class="col-sm-2">
								<label>A&ntilde;o Contrato</label>
							</div>
							<div class="col-sm-2">																					
							</div>						
							<div class="col-sm-3">
								<input type="text" id="anioEdContratoFlat" class="form-control"/>
							</div>													
					</div>
						<br>
					<div class='row'>
					    <input type="hidden" id="idPerFecha"/>					    						
						<div class="col-sm-1">
						    <label>Fecha Inicio : </label>																					
						</div>						
						<div class="col-sm-2">
							<input type="text" id="fechaPerInicio" class="datepicker form-control"/>					
						</div>
						<div class="col-sm-2">																											
						</div>
						<div class="col-sm-1">
							<label>Fecha Fin : </label>																					
						</div>
						<div class="col-sm-2">				
							<input type="text" id="fechaPerFin" class="datepicker form-control"/>																	
						</div>
					</div>														
					<label id="labErroPer" style="color:red; display:none;"></label>
				</div>
				<div class='modal-footer'>					
				    	<button type='button' id="aceptarPer" class='btn btn-default' onclick="actualizarPerFechas()">Aceptar</button>				    						
				</div>
			</div>
		</div>
	</div>

<jsp:include page="/jsp/dda/contrato/fees/cargaForm.jsp" />
	
<script src="${contextPath}/js/common/jquery/jquery-format/jquery.number.min.js"></script>
<script src="${contextPath}/js/dda/contrato/fees/feesSuscriptor.js?v=${versionJS}"></script>
<script src="${contextPath}/js/dda/contrato/fees/feesBono.js?v=${versionJS}"></script>
<script src="${contextPath}/js/dda/contrato/fees/feesFlat.js?v=${versionJS}"></script>
<script src="${contextPath}/js/dda/contrato/fees/feesValidacion.js?v=${versionJS}"></script>
<script src="${contextPath}/js/dda/contrato/fees/feesContrato.js?v=${versionJS}"></script>
<script src="${contextPath}/js/dda/contrato/fees/feesComun.js?v=${versionJS}"></script>
<script src="${contextPath}/js/dda/contrato/fees/TablaFees.js?v=${versionJS}"></script>
<script src="${contextPath}/js/dda/contrato/fees/feesUpload.js?v=${versionJS}"></script>
<script src="${contextPath}/js/dda/contrato/fees/importarExcel.js?v=${versionJS}"></script>
<script src="${contextPath}/js/common/perfil/perfilController.js?v=${versionJS}"></script>
<script src="${contextPath}/js/common/perfil/perfilService.js?v=${versionJS}"></script>
	
<jsp:include page="/jsp/dda/contrato/common/uploadDocument.jsp" />

<%@include file="/jsp/common/defaultBottomLogin.jsp"%>