<!DOCTYPE html>
<style>
	table.factura td, table.factura th{	     	      		  
		  min-width: 80px;		  
		  padding-left: 0px;
		  padding-right: 0px;		  
	 }
	 
	table.factura td, table.factura th{
	      text-align: right;
	      align: right;
	 }
	 	 
	 table.factura td > input{	     
	      text-align: right;	      
	 }	   
	 
	 table.factura td:nth-child(6), table.factura th:nth-child(6){	     	      
		  min-width :20px;		  		  
		  padding-left: 0px;
		  padding-right: 0px;		  	 
	 }
	 
	 table.factura td:nth-child(7), table.factura th:nth-child(7){	     	      
		  width :100px;		  		  
		  padding-left: 0px;
		  padding-right: 0px;	 
	 }
			 	 	 	  
	 table.factura input[type=text]{
	      border:0px solid #000; 
	      margin:0; 
	      background:transparent;
	      width: 90px;	      
	      text-align: right;
	      padding-left: 5px;
	 }
	 
	 table.factura input[type=check]{
	      border:0px solid #000; 
	      margin:0; 
	      background:transparent;
	      min-width: 20px;
	      width: 20px;
	      text-align: left;
	 }
	 
	 table.factura button{	       
	      min-width: 25px;
	      width:    25px;	      
	 }	 	 
	 	 
</style>

<%@include file="/jsp/common/defaultTopLogin.jsp"%>
<script src="${contextPath}/js/dda/ncredito/general/generalNotaCredito.js?v=${versionJS}"></script>
<script src="${contextPath}/js/dda/ncredito/general/tablaNotaCredito.js?v=${versionJS}"></script>
<script src="${contextPath}/js/dda/ncredito/general/modeloNotaCredito.js?v=${versionJS}"></script>


<input type="hidden" id="pmn" name="pmn" value="${pmn}" />

<form name="myform" id="formaId" method="POST" enctype="multipart/form-data"  >

    
 	<input type="hidden" id="notaCreditoIdentificador" value="${notaCredito.idNota}" name="notaCredito.idNota">
 	<input type="hidden" id="detalleCto"            name="detalleCto">
	<input type="hidden" id="restCto"               name="restCto">
    	
	<div class="form-group">	
		   <label class="col-xs-2 control-label">Estudio:</label> 
	       <div class="col-xs-4">
              <select name="notaCredito.idEstudio" id="estudioEleccion" class="form-control"  onchange="actualizaForma()" required>
	          <option value=""> Seleccione </option>
	             <c:forEach var="m" items="${estudios}">
		            <option value="${m.idEstudio}" <c:if test="${notaCredito.idEstudio == m.idEstudio}"> selected="selected"  </c:if> > ${m.descripcionEstudio} </option>
	             </c:forEach>
              </select>
    	   </div>

	       <label class="col-xs-2 control-label" for="monto">Amount:</label>
	  	   <div class="col-xs-4">
              <input type="text" id="montoNotaCredito"  value="${notaCredito.monto}" name="notaCredito.monto" class="form-control" readonly> 
    	   </div> 
    </div>

    <div id="divInputFactura" class="form-group">	    
	       <label  class="col-xs-2 control-label" for="numeroFactura">Numero de factura:</label> 		   	
           <div class="col-xs-4">
              <input type="text" id="numeroFactura"  value="${notaCredito.numeroFactura}" name="notaCredito.numeroFactura" class="form-control" required > 
           </div> 
           
           <label  class="col-xs-2 control-label" for="fechaFactura">Fecha de factura:</label> 		   	
           <div class="col-xs-4">
              <input  id="fechaNotaCredito"  value="<fmt:formatDate pattern='MM/dd/yyyy' value='${notaCredito.fechaFactura}'/>" name="notaCredito.fechaFactura" class="form-control datepicker" 
              required> 
           </div>     
    </div>
    <br>    <br>
	<div id="divRadio" class="form-group">	
			 	  <input type="hidden" id="approvedRadioButtonValor" value="${notaCredito.approved}">
			          <label   class="col-xs-2 control-label" for="approved">Approved:</label>
			          <div class="col-xs-6">
			              <c:forEach var="m" items="${siNoOpcion}">
				            <input class="col-xs-1" type="radio" value="${m.value}" name="notaCredito.approved"  id="approved" 
					           <c:if test="${notaCredito.approved == m.value}"> checked  </c:if> 
					           required />
					            <div class="col-xs-1">${m.desc}</div>
					            <div class="col-xs-1"></div>
			              </c:forEach>
			          </div>
	</div>
	<br>    <br>
	<div id="divComentario" class="form-group">
          <div class="col-xs-1"></div> 
    	  <div class="form-group col-xs-10">            
		        <label class="col-xs-1 control-label" for="comentario">Comentarios:</label>
	            <textarea  id="comentario" name="notaCredito.comentario" 
	                         rows="5" maxlength="490" class="col-xs-10 form-control">${notaCredito.comentario}</textarea>
	      </div>           
    </div>
	    	
	<br>        	 		             
    <div class="form-group">
    		 <div class="col-xs-1"></div>
    		 <div class="col-xs-3">    
    	     	<a href="../../ncredito/listado/index?pmn=${pmnReturn}" class="btn btn-default col-xs-4" roll="button" >Regresar</a>
    	     </div>
    	     <div class="col-xs-1"></div>
	 	     <div class="col-xs-3">       
                 <button class="btn btn-success" id="botonGuardar" type="button" onclick="valida()">Guardar cambios</button>
	         </div>
	         <div class="col-xs-1"></div>
	         <div class="col-xs-3">
	 	         <div id='botonConsultarFactura'> </div>
	 	     </div>	           	   	           	   
    </div>
	
	<br>
		
	<div id='tablaFacturaDetalle'> </div>
<!-- 	<div id='tablaFacturaDetalle2'> </div>
 --></form>

<jsp:include page="/jsp/dda/contrato/common/uploadDocument.jsp" />
<%@include file="/jsp/common/defaultBottomLogin.jsp"%>