<%@include file="/jsp/common/defaultTopLogin.jsp"%>
<%@include file="/jsp/dda/contrato/transaccion/comun/scripts.jsp"%>

 <style>
	.nopadding {
	   padding: 0 !important;
	   margin: 0 !important;
	}
	
		 /*estilo especifico para el scroll*/
	  .search-table-outter { overflow-x: scroll; }
	  
	  .y_scroll { overflow-y: scroll;  height: 350px !important;}
	  
	  table.feesT { border-collapse: collapse; }
 
	  th, td      { border : 1px solid black; }  		 	      		 
		
	  table.feesT input{
		      border:0px solid #000; 
		      margin:0; 
		      background:transparent;
		      width:100%;
		      text-align: center;		      
	  }
	  
	  .encabezados{
	  	  text-align: center;
	  }
	  
	  .encabezadoTabla{
	  	color: #FFF;
    	background: #CB2C25;
    	font-size: 1.1em;
    	font-weight: 400;    	    	
    	width : 90px ;
	  }
	  
	  .labelEtiqueta {
		  background-color: #CB2C25;
		  color: white;		  
		  padding: 4px;
		  text-transform: uppercase;
		  font-family: Verdana, Arial, Helvetica, sans-serif;
		  font-size: xx-small;
	  }
	  
	  .filSpan3{
	     rowspan:3;
	  }	  		  		
	  
	  .readInput{
		background-color:#DCDCDC;    	
	  }
	  
	  .tdPrecio{
		 min-width : 60px !important;    	
	  }
	  
	  .tdEditable{
		 min-width : 60px;		     	
	  }	
	  
	  .noBorder {
          border:none !important; 
      }	
 </style>
    
	<script src="${contextPath}/js/dda/reporte/cpview/visualizacionesCostoPerViewController.js?v=${versionJS}"></script>
	<script src="${contextPath}/js/common/utilerias/utileriasService.js?v=${versionJS}"></script>
	<script src="${contextPath}/js/common/printThis-master/printThis.js"></script>
	<script src="${contextPath}/js/dda/reporte/cpview/fileUpload.js?v=${versionJS}"></script>
	
	<script src="${contextPath}/js/common/perfil/perfilService.js?v=${versionJS}"></script>
	<script src="${contextPath}/js/common/perfil/perfilController.js?v=${versionJS}"></script>
	<script>
		$().ready(function() {
			var perfilController = new PerfilController();
			perfilController.ejecutarPerfil('193');
		});
	</script>
	
	
	<style type="text/css">
		.totalContratoRowClass { background-color: #ffffcc; background-image: none; }
        .contratoRowClass { background-color: #DCFFFF; background-image: none; }
    </style>
	
	
	<input type="hidden" id="pmn" name="pmn" value="${pmn}" />
	<input type="hidden" id="pmnReturn" name="pmnReturn" value="${pmnReturn}" />
	
	<div ng-app = "${contextPath}">
	<div ng-controller = "visualizacionesCostoPerViewController">
	
	<div class="form-group row">
	    <div class="col-sm-1"></div>
		<div class="col-sm-1">
			<label class="control-label" for="mes">Mes:</label>
		</div>
		<div class="col-sm-2">
			<input class="form-control required" id="mes" name="mes" type="text" ng-change="cambioFechaAccion()" ng-model="fechaConsulta">
		</div>
		<div class="col-sm-5">
			<button class="btn btn-danger" type="button" ng-click="abrirModal(fechaConsulta)" >Subir Archivo</button>
			<button class="btn btn-success" type="button" ng-click="muestraCarga(fechaConsulta)" >Consulta Carga</button>
		</div>

 	    <div class="col-sm-2">
 	    	<a id="plantillaLink" ng-click="descargaPlantilla()">DESCARGAR PLANTILLA</a>
	    </div>
	    <div class="col-sm-1"></div>
	</div>
	
	<br>
	<br>
	
		<div ng-if="header != null && muestraInformacion == true" class="form-group">
		<div class="col-sm-3"></div>
		<div class="col-sm-6">
		<table class="table table-responsive">
		<tbody>
		<tr><td align="right" class="noBorder">Total de registros leidos:</td >
		     <td align="left" class="noBorder">{{leidos}}</td>
		     <td class="noBorder"></td>
		     <td class="noBorder"></td>
		     <td class="noBorder"></td>
		     <td class="noBorder"></td>
		</tr>
		<tr><td align="right" class="noBorder">Registros Correctos:</td>
		     <td align="left" class="noBorder">{{correctos}}</td>
		     <td class="noBorder"></td>
		     <td class="noBorder"></td>
		     <td class="noBorder"></td>
		     <td class="noBorder"></td>		</tr>
		<tr><td align="right" class="noBorder">Registros con Error:</td>
		     <td align="left" class="noBorder">{{erroneos}}</td>
		     <td class="noBorder"></td>
		     <td class="noBorder"></td>
		     <td class="noBorder"></td>
		     <td class="noBorder"></td>		</tr>
			<tr><td colspan="6" align="center" class="noBorder">
		     <a ng-if="erroneos != null && erroneos > 0" id="visualizacionesLink" ng-click="descargaVisualizaciones(fechaConsulta)">DESCARGAR ARCHIVO CON ERRORES</a>
		    </td>
		</tr>
		</tbody>
		</table>
		</div>
		<div class="col-sm-3"></div>
		</div>
		<br>
         <div ng-if="header != null && muestraInformacion == true" id ="tablaReporteCostoPerView" class="y_scroll wrapper form-group" >                    				
	              <div class="col-sm-2"></div>
		          <div class="col-sm-8">
	              <table class="table table-responsive feesT">
	                	<thead class="">                		
				    		<tr>
								<th class="encabezados encabezadoTabla"  ng-repeat="valor in header track by $index">{{valor}}</th>													     	                			 	
				    		</tr>				    		
				        <thead>
				        <tbody>
		                    <tr ng-if="tabla != null" ng-repeat="row in tabla track by $index" >                                                                        		                        		                      		                  		
		                        <td  ng-repeat="column in row track by $index" class="tdEditable" 
		                        ng-style="$index == 2 ? { 'text-align':'right' } : { 'text-align': 'left' }">		                            
		                             	 {{ ($index == 2) ? (column|number:2) : column}}	                  		
		                        </td>		                  				                  		
		                    </tr>	
		                    <tr ng-if="tabla == null"  >                                                                        		                        		                      		                  		
		                        <td colspan="{{header.length}}" align="center">	
		                          No se encontr&oacute; informaci&oacute;n	                            
 		                        </td>		                  				                  		
		                    </tr>   	                    
	                    </tbody>
	                </table>
	                </div>
		            <div class="col-sm-2"></div>
	    </div> 
	    
	    <br>
	    <br>
	    
	    	
	<%@include file="/jsp/dda/reporte/cpview/modalesVisualizaciones.jsp"%>
	</div>
	</div>

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