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

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

th {
	color: white;
}
</style>

<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('44');
	});
</script>

<div ng-app="${contextPath}">
	<div  ng-controller="tipoCambioController">
		
		<div class="form-group">
			<div class="col-sm-1">
				<label class="control-label" for="forAnnios">A&ntilde;o:</label>
			</div>
			<div class="col-sm-2">
				<select class="form-control-sm" ng-model="myannio" ng-options="annio for annio in annios" ng-change="limpiar()"></select>
			</div>
			
			<div class="col-sm-1"></div>
			
			<div class="col-sm-1">
				<label class="control-label" for="forPaises">Pa&iacute;s:</label>
			</div>
			<div class="col-sm-2">
				<select class="form-control-sm" ng-model="mypais" ng-options="pais.descripcionPais for pais in paises" ng-change="limpiar()"></select>
			</div>
			
			<div class="col-sm-1 centrar-elemento">
				<button id="botonConsultar" class="btn btn-primary" type="button" ng-click="consultar()">Consultar</button>
			</div>
		
			<div class="col-sm-1"></div>
		
			<div class="col-sm-1 centrar-elemento">
				<button id="botonGuardar" class="btn btn-success" type="button" ng-click="guardarCambio()">Guardar cambios</button>
			</div>
			
		</div>
		
		</br>
		<div class="form-group">	
	    	<table class="table">
	    		<thead>
	    			<tr>
		    			<th class="text-center" ng-repeat="nt in nombreTipos">
		    				{{nt.descripcion}}
		    			</th>
		    		</tr>
	    		</thead>
	    		<tfoot>
	    			<tr ng-repeat="mes in mesesTipos">
		    			<td>
		    				{{mes.nombre}}
		    			</td>
		    			<td ng-repeat="tipo in mes.tipos">
		    				<input class="form-control text-right" ng-model="tipo.valor" ng-blur="valida('{{tipo.valor}}', tipo.valor)" >
		    			</td>
		    		</tr>
	    		</tfoot>
	    	</table>
	    </div>
	    
	</div>
</div>

<script type="text/javascript" language="javascript" src="${contextPath}/js/dda/admin/catalogos/tipoCambio/tipoCambioService.js"></script>
<script type="text/javascript" language="javascript" src="${contextPath}/js/dda/admin/catalogos/tipoCambio/tipoCambioController.js"></script>
<%@include file="/jsp/common/defaultBottomLogin.jsp"%>
