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

<script src="${contextPath}/js/dda/contrato/generales/sos_combobox.js"></script>
<script src="${contextPath}/js/dda/contrato/deal/deal.js?v=${versionJS}"></script>

		<form name="myform"  id="formaId" method="POST" enctype="multipart/form-data" onSubmit="doSubmit();" action="dealUpdate"> 
		<input type="hidden" name="pmn" value="${pmn}" />
													
		<label class="control-label">FILIALES</label> 
	    
	    <div class="form-group">
	      
	       <div class="col-xs-1"></div>
	       
	       <div class="col-xs-3">
           <select id="filialesDisponiblesSelect"  multiple class="form-control" size="6">
               <s:iterator value="deal.filialesDisponibles" status="loopStatus">
                   <option value="<s:property value="idFilial"/>" id="option-<s:property value="#loopStatus.index"/>" > <s:property value="descFilial"/> </option>
               </s:iterator>	
           </select>
           </div>
           
           <div class="col-xs-1">                   
           <input type="button" name="btE1" value=">" class="btn btn-info btn-sm"
                  onclick="Combobox.move( filialesDisponibles, filialesElegidas );">
               <br><br>
           <input type="button" name="btE2" value="<" class="btn btn-info btn-sm"
                  onclick="Combobox.move( filialesElegidas, filialesDisponibles );">
           </div>
            
           <div class="col-xs-3">
           <select id="filialesElegidasSelect"  multiple class="form-control" size="6">
               <s:iterator value="deal.filialesElegidos" status="loopStatus">
                   <option  value="<s:property value="idFilial"/>" id="option-<s:property value="#loopStatus.index"/>" > <s:property value="descFilial"/> </option>                   
               </s:iterator>	
           </select>
            </div>
            
           <div class="col-xs-1"></div>
           
        </div>  
        
        <div class="form-group"></div>   
        <div class="form-group"></div>   
        
        
        <label class="control-label">TYPE</label>
         
        <div class="form-group">   
            
           <div class="col-xs-1"></div>
           
           <div class="col-xs-3">       
           <select id="typesDisponiblesSelect"  multiple  class="form-control" size="6">
               <s:iterator value="deal.typesDisponibles" status="loopStatus">
                   <option value="<s:property value="idType"/>" id="option-<s:property value="#loopStatus.index"/>" > <s:property value="descType"/> </option>
               </s:iterator>	
           </select>
           </div>
           
           <div class="col-xs-1">         
           <input type="button" name="btE3" value=">" class="btn btn-info btn-sm"
                  onclick="Combobox.move( typesDisponibles, typesElegidas );">
               <br><br>
           <input type="button" name="btE4" value="<" 
                  class="btn btn-info btn-sm"
                  onclick="Combobox.move( typesElegidas, typesDisponibles );">
           </div>
             
           <div class="col-xs-3">
           <select id="typesElegidasSelect"  multiple  class="form-control" size="6">
               <s:iterator value="deal.typesElegidos" status="loopStatus">
                   <option  value="<s:property value="idType"/>" id="option-<s:property value="#loopStatus.index"/>" > <s:property value="descType"/> </option>                   
               </s:iterator>	
           </select>
           </div>            
           <div class="col-xs-1"></div>                                          
        </div>                
                 
		<input type="hidden" id="idContrato" value="<s:property value="deal.idContrato"/>"
			   name="deal.idContrato"> 
			     
        <div class="form-group"></div>   
        <div class="form-group"></div> 
       
        <label class="control-label">Comentarios:</label>
        <div class="form-group">
           <div class="col-xs-1"></div>
           <div class="col-xs-10">
               <textarea class="form-control" id="comentarioField" name="deal.limitesLicencia" 
                         rows="5" maxlength="490"><s:property value="deal.limitesLicencia"/></textarea>
           </div>
        </div>
        
        <div class="form-group"></div>
		<div class="form-group"></div>	
 	
		<label class="control-label">Justificacion: </label>
        <div class="form-group">
           <div class="col-xs-1"></div>
           <div class="col-xs-10">
           	   <jsp:include page="/jsp/dda/contrato/common/justificacion.jsp" />          
               <textarea class="form-control" id="justificacion" rows="5" name="justificacion" maxlength="150">${justificacion}</textarea>
           </div>
        </div>
        
        <div class="form-group"></div>
		<div class="form-group"></div>		
        
        <div class="form-group">
             <div class="col-xs-6">
                   <a href="../../contrato/listado/irListado?pmn=<%=pmnReturn%>&tipoContrato=${tipoContrato}" class="btn btn-default col-xs-4" roll="button" >Regresar</a> 
                    <div class="col-xs-2"></div>         
  		           <button class="btn btn-info col-xs-4" type="button" data-toggle="modal" data-target="#modalDocum">Subir documento</button>	           
             </div>
             <div class="col-xs-2"></div>
             <div class="col-xs-4">
        	       <button class="btn btn-success" type="submit">Guardar cambios</button>
             </div>
        </div>

	</form>
	
<script>	
	 	var filialesDisponibles = document.myform.filialesDisponiblesSelect;
		var filialesElegidas = document.myform.filialesElegidasSelect;
		
        Combobox();
        Combobox.setCombos( filialesDisponibles, filialesElegidas );
        
	 	var typesDisponibles = document.myform.typesDisponiblesSelect;
		var typesElegidas = document.myform.typesElegidasSelect;
		
        Combobox();
        Combobox.setCombos( typesDisponibles, typesElegidas );
		
</script>

<!-- Si el estado del contrato es diferente de registro se bloquea -->
<s:if test="estadoCto != 1">			
	<script type="text/javascript">
	 		 $('form :input').prop( "disabled", true );
	</script>
</s:if>

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