	<style>
	 /*estilo especifico para el scroll*/
	  .search-table-outter {
	    overflow-x: scroll;
	  }
	  
	  table.feesT{
  			border-collapse: collapse; 
 	  }
 
	 th, td 
	  {
		     border    : 1px solid black;		                   		     
		     min-width : 10% !important;
	  }  		 	      		 
		
	  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;
	  }
	  
	  .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;
	  }
	  
	  .tdPrecio{
		 min-width : 60px !important;    	
	  }  		 
	  
	  .tdEditable{
		 min-width : 60px !important;    			 
	  }
    </style>

	<div ng-controller="rentaLibreriaController" id="divLibreria">
																						   
			   <div class="container">
				 <div class="form-inline">
					  <div class="form-group col-sm-2" >
					     <br>
					     <label class="labelEtiqueta">Minimo Garantizado</label>		    
					  </div>					  
					  
					  <div class="form-group col-sm-2">
					     <label class="radio-inline"><input type="radio" value="categoria" ng-model="tipoMinLib" ng-click="mostrarRevenue()">Por Categoria</label>
					  </div>
					  <div class="form-group col-sm-2">
					     <label class="radio-inline"><input type="radio" value="anio" ng-model="tipoMinLib" ng-click="mostrarRevenue()">Por Año</label>
					  </div>
					  
					  <div class="form-group col-sm-6" id="divMinCateLib">
					    <div class="col-sm-1"><button type="button" class="btn btn-primary btn-sm btn-exportar" data-bs-toggle="tooltip" data-placement="top" title="Exportar a excel"  ng-click="exportarExcel('libreria', 'min_cat', tablaMinGarLib, tablaMinGarLib.encabezados)" disabled> <i class="fa fa-file-excel-o"></i></button></div>					    
					    
					    <div class="col-sm-3"><button type="button" class="btn btn-primary btn-sm btn-importar" ng-click="abrirModalMinimos()" disabled>Importar Categoría</button></div>
					    
					    <div class="col-sm-1"><button type="button" class="btn btn-primary btn-sm btn-agregar" ng-click="abrirModalFechas(0,0,'periodo')" disabled>Agregar Periodo</button></div>
					  </div>
					  
					  <div class="col-sm-1"></div>
					  <div class="form-group col-sm-6"   id="divMinAnioLib">
					    <div class="col-sm-1"><button type="button" class="btn btn-primary btn-sm btn-exportar" data-bs-toggle="tooltip" data-placement="top" title="Exportar a excel"  ng-click="exportarExcel('libreria', 'min_anio', tablaMinGarAnioLib, tablaMinGarAnioLib.encabezados)" disabled> <i class="fa fa-file-excel-o"></i></button></div>
					    <div class="col-sm-1"></div>
					  	<div class="col-sm-2"><button type="button" class="btn btn-primary btn-sm btn-agregar" ng-click="abrirModalFechas(0,0,'periodo')" disabled>Agregar Periodo</button></div>
					  </div>
					  					  					  
				 </div>
			   </div>
			   
			   <br/>
			   <br/>

		
			  <!-- Minimos -->	   			  
          	   <div id="divMinCat" class="search-table-outter wrapper"  >                    				
	           	   <table id="tabMinCatLib" class="table table-responsive feesT"  ng-show="tipoMinLib == 'categoria'">
	           	      <thead class="">                		
				      		<tr>
								<th class="encabezados encabezadoTabla" colspan="{{setColspan(x)}}" ng-repeat="x in tablaMinGarLib.encabezados" ng-click="abrirModalFechas(1,$index, 'modificar')">{{x.valor}}</th>
								<th colspan="1" class="encabezados encabezadoTabla">
	                					<i role="button" class="fa fa-plus" ng-click="editarTablaMinGarantizados('addRow')" data-bs-toggle="tooltip" data-placement="top" title="Agregar Categorías!"></i>	                					 	                					
	                			</th>																	     	                			 	
				    		</tr>
				        <thead>
				        <tbody>
		                    <tr ng-repeat="datum in tablaMinGarLib.datos">                                                                        
		                        <td ng-repeat="field in datum">
		                        	<input ng-if="$index <= 2 && $parent.$index == 0" type="{{tablaMinGarLib.metadatos[$index].tipo}}" ng-model="field.valor" readonly/>
		                            <input class="tdEditable" ng-if="$index > 2 && $parent.$index == 0 " type="{{tablaMinGarLib.metadatos[$index].tipo}}" ng-model="field.valor" ng-blur="actualizarMinCelda($parent.$parent.$index, $index, $event)" ng-model-options="{updateOn: 'blur'}"/>
		                            <input class="tdEditable" ng-if="$parent.$index > 0 " type="{{tablaMinGarLib.metadatos[$index].tipo}}" ng-model="field.valor" ng-blur="actualizarMinCelda($parent.$parent.$index, $index, $event)" ng-model-options="{updateOn: 'blur'}"/>	              		                            		                            	                           	                           	                          		                                              		
		                  		 </td>                  	
		                  		 <td> 
		                  		    <label> {{tablaMinGarLib.mensajes[$index] }} </label> 
		                  		    <i ng-if="$index > 0" role="button" class="fa fa-times" ng-click="editarTablaMinGarantizados('removeRow',$index)"></i>
		                  		 </td>		                  		 	
		                    </tr>		                    
	                    </tbody>	           	      
	           	   </table>
	           	   
	           	   <table id="tabAnioMinLib" class="table table-responsive feesT"  ng-show="tipoMinLib == 'anio'">	           	      	           	      
	           	      <thead class="">                		
				      		<tr>
								<th class="encabezados encabezadoTabla" colspan="{{setColspan(x)}}" ng-repeat="x in tablaMinGarAnioLib.encabezados" ng-click="abrirModalFechas(2,$index, 'modificar')">{{x.valor}}</th>
								<th colspan="1" class="encabezadoTabla">	                					
	                				<i role="button" class="fa fa-plus" ng-click="editarTablaMinGarantizadosAnio('addColumn')" data-bs-toggle="tooltip" data-placement="top" title="Agregar Años"></i>
	                			</th>																	     	                			 	
				    		</tr>
				        <thead>
				        <tbody>
		                    <tr ng-repeat="datum in tablaMinGarAnioLib.datos">                                                                        
		                        <td ng-repeat="field in datum">		                            
		                            <input class="tdEditable" type="{{tablaMinGarAnioLib.metadatos[$index].tipo}}" ng-model="field.valor" ng-blur="actualizarMinCelda($parent.$index, $index, $event)" ng-model-options="{updateOn: 'blur'}"/>	                           	                           	                          		                                              		
		                  		 </td>                  	
		                  		 <td> 
		                  		    <label> {{tablaMinGarAnioLib.mensajes[$index] }} </label> 		                  		    
		                  		 </td>		                  		 	
		                    </tr>		                    
	                    </tbody>
	           	   </table>     	    
	           </div>
	           
			   <br/>
			   <br/>
	           	   
	           	<!-- Impuestos -->        					             	   					   
          	   <div id="scrollH" class="search-table-outter wrapper">                    				
	              <table class="table table-responsive feesT">
	                	<thead class="">                		
				      		<tr>
								<th class="encabezados encabezadoTabla"  ng-repeat="x in tablaImpuestosLib.encabezados">{{x.valor}}</th>																									     	                			 	
				    		</tr>
				        <thead>
				        <tbody>
		                    <tr ng-repeat="datum in tablaImpuestosLib.datos">                                                                        
		                        <td ng-repeat="field in datum">		                            
		                            <input ng-if="field.valor !== 'false' && field.valor !== 'true'"  type="text" ng-model="field.valor" readonly/>
		                            <input class="tdEditable" ng-if="field.valor === 'false'" type="checkbox"  ng-click="actualizarImpCelda($parent.$parent.$index, $index, $event)"      />
		                            <input class="tdEditable" ng-if="field.valor === 'true'"  type="checkbox"  ng-click="actualizarImpCelda($parent.$parent.$index, $index, $event)" checked />	                           	                           	                          		                                              			
		                  		</td>                  			                  		 		                  		 	
		                    </tr>		                    
	                    </tbody>
	                </table>
	           </div>				

			   <br/>
			   <br/>
					   			
			    <div class="container">
				 <div class="form-inline">
					  <div class="form-group col-sm-2"></div>
					  <div class="form-group col-sm-2"></div>		    					  					  
					  <div class="form-group col-sm-2"></div>
					  <div class="form-group col-sm-2"></div>			 
					  <div class="form-group col-sm-1">
					  <div class="col-sm-1"><button type="button" class="btn btn-primary btn-sm btn-exportar" data-bs-toggle="tooltip" data-placement="top" title="Exportar a excel" ng-click="exportarExcel('libreria', 'precio', tablaPreciosLib, tablaPreciosLib.encabezados)" disabled> <i class="fa fa-file-excel-o"></i></button></div>
					  </div>					  
					  <div class="form-group col-sm-2" >						    						    
						    <div class="col-sm-1"><button type="button" class="btn btn-primary btn-sm btn-importar" ng-click="abrirModalPrecio()" disabled>Importar Categoría</button></div>
					  </div>
				  </div>					  
			   </div>		
			   
			   <br/>
			   <br/>
		
			   <!-- Precios -->						   					   
          	   <div id="scrollH" class="search-table-outter wrapper">                    				
	              <table class="table table-responsive feesT">
	                	<thead class="">                		
				      		<tr>
								<th class="encabezados encabezadoTabla" colspan="1">Precio por Evento</th>
								<th class="encabezados encabezadoTabla" colspan="2"  ng-repeat="x in tablaPreciosLib.encabezados">{{x.valor}}</th>																									     	                			 	
				    		</tr>
				    		<tr>								
								<th class="encabezados encabezadoTabla">Formato</th>												
								<th class="encabezados encabezadoTabla"  ng-repeat="y in tablaPreciosLib.subEncabezadosPrecio track by $index">{{y}}</th>													     	                			 	
				    		</tr>
				        <thead>
				        <tbody>
		                    <tr ng-repeat="datum in tablaPreciosLib.datos" >                                                                        		                        		                      		                  		
		                        <td ng-if="$index == 0" ng-repeat="field in datum" class="encabezados encabezadoTabla">		                            
		                            {{field.valor}}		                            		                             		                            	                           	                           	                          		                                              	
		                  		</td>
		                  		<td ng-if="$index >= 1" ng-repeat="field in datum">		                  				                            
		                            <input class="tdPrecio tdEditable" type="text" ng-model="field.valor" ng-blur="actualizarPrecioCelda($parent.$parent.$index, $index, $event)" ng-model-options="{updateOn: 'blur'}"/>		                            		                             		                            	                           	                           	                          		                                              	
		                  		</td>		                  		
		                    </tr>	
		                    	                    
	                    </tbody>
	                </table>
	           </div>
	           
	           <br/>
			   <br/>
					   									   									   				
 			   <div class="container">
				 <div class="form-inline">
					  <div class="form-group col-sm-2" >
					     <br>
					     <label class="labelEtiqueta">Revenue Share</label>		    
					  </div>					  					  
				 </div>
			   </div>	
			   <div class="container">
				 <div class="form-inline">					  					  
					  <div class="form-group col-sm-2">
					     <label class="radio-inline"><input type="radio" id="global" value="global" ng-model="tipoRevenue" ng-click="actualizarGlobal()" >Global</label>
					  </div>
					  <div class="form-group col-sm-4">		    
					  </div>
					  <div class="form-group col-sm-2" id="dbox">
					     <label class="radio-inline"><input type="radio" id="box" value="box" ng-model="tipoRevenue" ng-click="actualizarBox()">Box Office</label>
					  </div>					  
				 </div>
			   </div>				
			   			   
			   <br>
				<!-- Revenu -->	   	   				
			   <div class="container">
				 <div class="form-inline">					  					  
					  <div class="form-group col-sm-2">
					                        				
					                 <table class="table table-responsive feesT">
					                	<thead class="">                		
								      		<tr>												
												<th class="encabezados encabezadoTabla" >% DLA</th>
												<th class="encabezados encabezadoTabla" >% Estudio</th>																									     	                			 	
								    		</tr>				    		
								        <thead>								        
								        <tbody>
						                    <tr ng-repeat="datum in tablaRevenueLib.datos" >                                                                        		                        		                      		                  		
						                        <td  ng-repeat="field in datum">		                            
						                            <input class="tdEditable" type="text" ng-if=" $index == 0" ng-model="field.valor" ng-blur="actualizarRevenueCelda($parent.$parent.$index, $index, $event, tablaRevenueLib.metadatos)" ng-model-options="{updateOn: 'blur'}"/>
						                            <input class="tdEditable" type="text" ng-if=" $index == 1" ng-model="field.valor" readonly/>		                            		                             		                            	                           	                           	                          		                                              	
						                  		</td>		                  		
						                    </tr>	
						                    	                    
					                    </tbody>
					                </table>						                                    					     					     					     
					  </div>
					  <div class="form-group col-sm-3">		    
					  </div>
					  <div class="form-group col-sm-5">
					     					                        								     					                  
				             <table class="table table-responsive feesT" id="tRevBox">
				                	<thead class="">                		
							      		<tr>
											<th class="encabezados encabezadoTabla" colspan="2">Box Office</th>
											<th class="encabezados encabezadoTabla" colspan="1">Categoria</th>
											<th class="encabezados encabezadoTabla" colspan="1">% DLA</th>
											<th class="encabezados encabezadoTabla" colspan="1">% Estudio</th>
											<th class="encabezados encabezadoTabla">
														                  		 
					                  		</th>																	     	                			 	
							    		</tr>
							        <thead>
							        <tbody>
					                    <tr ng-repeat="datum in tablaRevenueBoxLib.datos">                                                                        
					                        <td ng-repeat="field in datum">					                            
					                             <input type="{{tablaRevenueBoxLib.metadatos[$index].tipo}}" ng-if="field.editable == false && ($index == 0 || $index == 1 || $index == 2)" ng-model="field.valor" readonly/>
					                             <input class="tdEditable" type="{{tablaRevenueBoxLib.metadatos[$index].tipo}}" ng-if="field.editable == false && $index == 3" ng-model="field.valor" ng-blur="actualizarRevenueBoxCelda($parent.$parent.$index, $index, $event, tablaRevenueBoxLib.metadatos)" ng-model-options="{updateOn: 'blur'}"/>
					                             <input class="tdEditable" type="{{tablaRevenueBoxLib.metadatos[$index].tipo}}" ng-if="field.editable && $index < 4" ng-model="field.valor" ng-blur="actualizarRevenueBoxCelda($parent.$parent.$index, $index, $event, tablaRevenueBoxLib.metadatos)" ng-model-options="{updateOn: 'blur'}"/>
					                             <input type="{{tablaRevenueBoxLib.metadatos[$index].tipo}}" ng-if="$index == 4" ng-model="field.valor" readonly/>					                            	                           	                           	                          					                                              		
					                  		 </td>
					                         <td> 
		                  		    			<label>{{ tablaRevenueBoxLib.mensajes[$index]}}</label> 
		                  		    			<i ng-if="tipoMinLib == 'anio' && $index > 0 && datum[$index].editable == true" role="button" class="fa fa-times" ng-click="editarTablaRevenueBoxLib('removeRow',$index)"></i>
		                  		    			<i ng-if="tipoMinLib == 'categoria' && datum[$index].editable == true" role="button" class="fa fa-times" ng-click="editarTablaRevenueBoxLib('removeRow',$index)"></i>		                  		    			
		                  		 			</td>		
		                  		 		</tr>					                    
				                    </tbody>
				                </table>	    	           			 					     					     
					  </div>					  
				 </div>
			   </div>
			   
			   <br/>
			   <br/>
				
			   <div class="container">
				 <div class="form-inline">
					  <div class="form-group col-sm-6"></div>					  
					  <div class="form-group col-sm-3"></div>			 
					  <div class="form-group col-sm-2">
					    <button type="button" class="btn btn-success btn-guardar" ng-click="guardarLibreria()" disabled>Guardar Librería</button>
					  </div>
				 </div>
			   </div>  
			   
			   <%@include file="/jsp/dda/contrato/transaccion/fees/feesModalesLibreria.jsp"%>									   									   									   					            	   	           
    </div>