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


<script src="${contextPath}/js/dda/reporte/acumulateBuys/reporteAcumulateBuysController.js?v=${versionJS}"></script>
<script src="${contextPath}/js/dda/reporte/acumulateBuys/reporteAcumulateBuysService.js?v=${versionJS}"></script>
<script src="${contextPath}/js/dda/reporte/oyp/reporteOveragesYPaymentsController.js?v=${versionJS}"></script>
<script src="${contextPath}/js/dda/reporte/rys/reporteRevenueYSplitsController.js?v=${versionJS}"></script>
<script src="${contextPath}/js/common/utilerias/utileriasService.js"></script>

<script type="text/javascript" language="javascript" src="${contextPath}/js/dda/carga/transaccion/transaccionesUpload.js"></script>
<script type="text/javascript" language="javascript" src="${contextPath}/js/dda/carga/transaccion/cargaTransaccionesService.js?v=${versionJS}"></script>
<script type="text/javascript" language="javascript" src="${contextPath}/js/dda/carga/transaccion/cargaTransaccionesController.js?v=${versionJS}"></script>
<script src="${contextPath}/js/common/alerts/dist/sweetalert.min.js"></script>
<script src="${contextPath}/js/common/printThis-master/printThis.js"></script>
<link rel="stylesheet" type="text/css" href="${contextPath}/js/common/alerts/dist/sweetalert.css">

<style type="text/css">
thead {
	background: #cb2c25
}

th {
	color: white;
}

estilo {
	background-color: #cb2c25
}
</style>

<div ng-app="${contextPath}">
	<div  ng-controller="cargaTransaccionesController">
	
		<div class="form-group">
			<div class="col-sm-1">
				<label class="control-label" for="forMes">Mes: </label>
			</div>
			<div class="col-sm-2">
				<input class="form-control datepicker required" id="inputMes" type="text" ng-model="mesCarga" ng-change="cambiaronParametros()">
			</div>
			<div class="col-sm-2">
				<input class="btn btn-primary" id="bConsultar" type="button" value="Consultar carga" ng-click="consultarCarga()">
			</div>
			<div class="col-sm-2">
				<input class="btn btn-success" id="bSubirTransaccion" type="button" value="Subir archivo" ng-disabled="botonSubirDisabled" ng-click="abrirModal()" >
			</div>
			<div class="col-sm-2">
			    <button type="button" class="btn btn-primary" ng-click="descargaPlantillaExcel()"><span class="glyphicon glyphicon-download-alt">&nbsp;</span>Exportar Plantilla</button>
			</div>	
		</div>
		</br>
		<div id="divTablaResumenCarga" class="form-group">
		    <div class="col-sm-5">
		          <table id="tableResumenCarga" class="table">
		                     <tr>
       							 <th style="border:none; text-align:center; color:black;" scope="colgroup" colspan="2">Resumen de Carga</th>
   							 </tr>
		                  <tbody>
		                     <tr>
		                           <td>Total de registros leidos: </td>
		                           <td id="total_registrados" class="text-center">{{total_cargados}}</td>
		                     </tr>
		                     <tr>
		                           <td>Registros Correctos: </td>
		                           <td id="total_cargados" class="text-center">{{total_registrados}}</td>
		                     </tr>
		                     <tr>
		                           <td>Registros con Error:</td> 
		                           <td id="total_error" class="text-center">{{total_error}}</td>
		                     </tr>
		                  </tbody>		                     
		          </table>
		          <div class="col-sm-2">
						<input style="background-color:gray; color:#fff9f9;" ng-disabled="botonDescargaFileError" class="btn" id="bDescargaFileError" type="button" value="Descargar Archivo de Errores" ng-click="exportarDetalleErrorCargaT()">
			      </div>
		    </div>		
		</div>
		<div class="form-group">
			<div class="col-sm-10">
				 <table class="table">
				 	<thead>
				 		<tr>
			    			<th class="text-center" ng-repeat="nt in infoHeadTransacciones">
			    				{{nt}}
			    			</th>
			    		</tr>
				 	</thead>
				  	<tbody>
				  		<tr ng-repeat="transaccion in cargaTransacciones" ng-style="{{transaccion.estilo}}">
				  		
			    			<td class="text-center">
			    				{{transaccion.pais}}
			    			</td>
			    			<td class="text-center">
			    				{{transaccion.filial}}
			    			</td>
			    			<td class="text-center">
			    				{{transaccion.transacciones | number:0}}
			    			</td>
			    			<td class="text-center">
			    				{{transaccion.monto | number:0}}
			    			</td>
			    			<td class="text-center">
			    				{{transaccion.pago | number:0}}
			    			</td>
			    			<td class="text-center">
			    				{{transaccion.asociacion}}
			    			</td>
			    		</tr>
			    	</tbody>
				</table>
			</div>
			<div class="col-sm-2 btn-group-vertical"> 
			    <div id="msjVoboCarga">VoBo: {{fecha_vobo | date:'MM-dd-yyyy'}}</div>
				<input class="btn btn-primary" id="bValidar" type="button" value="Validar carga" ng-disabled="botonValidaCarga" ng-click="validaCarga()">
				</br>
				<input class="btn btn-primary" id="bExportar" type="button" value="Exportar" ng-disabled="botonExportarPrincipal" ng-click="exportarPrincipal()">
				</br>
				<input class="btn btn-primary" id="bAsociar" type="button" value="Asociar t&iacute;tulos" ng-disabled="botonAsociarTitulos" ng-click="mostrarAsociarTitulos()">
				</br>
				<input class="btn btn-primary" id="bRecalculo" type="button" value="Recalculo de pago" ng-disabled="botonRecalculoPago" ng-click="rCalculoPago()">
				</br>	
				<button style="text-align: -webkit-left;" type="button" class="btn btn-success" ng-click="openModalAcumulateBuys()"><span class="glyphicon glyphicon-list-alt">&nbsp;</span>Acumulate Buys</button>			
			    </br>
			    <button  type="button" class="btn btn-success" ng-click="openModalOveragePayments()"><span class="glyphicon glyphicon-list-alt">&nbsp;</span>Overages & Payments</button>			
			    </br>
			    <button style="text-align: -webkit-left;" type="button" class="btn btn-success" ng-click="openModalCostPView()"><span class="glyphicon glyphicon-list-alt">&nbsp;</span>Revenue & Splits</button>			
			    </br>
			</div>
		</div>
		
		<%@include file="/jsp/dda/carga/transaccion/modalesTransacciones.jsp"%>
		
	</div>
</div>

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