

<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.5.6/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.flash.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.print.min.js"></script>
	
	<div class="row">
		<input type="hidden" id="hfIdFactura">
		<input type="hidden" id="hfIdServicio">
		<input type="hidden" id="hfUuid">

		<div class="col-xl-12">
			<div class="breadcrumb-holder">
				<h1 class="main-title float-left"><i class="fa fa-book"></i> Notas de credito</h1>
					<ol class="breadcrumb float-right">
						<a id="btnNuevo" role="button" href="#" class="btn btn-secondary" style="margin-right: 10px;"><span class="btn-label"><i class="fa fa-search"></i></span>Nueva</a>
						<a id="btnFiltrar" role="button" href="#" class="btn btn-secondary" style="margin-right: 10px;"><span class="btn-label"><i class="fa fa-filter"></i></span>Filtrar</a>
                    </ol>
                    <div class="clearfix"></div>
            </div>
		</div>
	</div>
	<div class="row">
	
		<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">						
			<div class="card mb-12">
				<div class="card-header">
					<h3><i class="fa fa-table"></i> Notas registradas en sistema</h3>					
				</div>
					
				<div class="card-body">
					<table id="tablaDatos" class="table table-bordered table-hover display" cellspacing="0" width="100%">
						  <thead>
							<tr>
							 <th>Tipo sistema</th>
							 <th>Cliente</th>
							 <th>Fecha</th>
							 <th>Total</th>
							 <th>F. CFDI</th>
							 <th></th>
							</tr>			
						  </thead>
					</table>
				</div>														
			</div><!-- end card-->					
		</div>	
	</div>
    <!-- end row -->
	
	<input type="hidden" id="hfIdSeleccionado">

	<div id="popupNuevaNota" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modal_add_user"  aria-hidden="true" style="display: none;">
		<div class="modal-dialog">
			<div class="modal-content">
						
				<div class="modal-header">
				<h5 class="modal-title" id="modal_add_user">Nota credito</h5>
				<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>          	
				</div>
					
				<div class="modal-body">				                							
					<div class="row">
						<div class="col-lg-12">
							<div class="form-group">
									<label>Tipo sistema</label>
									<select id="ddlTipoSistema" name="role_id" class="form-control" onfocus="removeHas('ddlTipoSistema');">
									    <option value="-1">-SELECCIONE-</option>
										<option value="1">AMARRES</option>
										<option value="2">PLATAFORMA</option>
									</select>
							</div>
						</div>   

						<div class="col-lg-12">
							<div class="form-group">
								<label>Cliente</label>
								<select id="ddlCliente" name="role_id" class="form-control" onfocus="removeHas('ddlCliente');">
									<option value="-1">-SELECCIONE-</option>
								</select>
							</div>
						</div>   

						<div class="col-lg-12">
							<div class="form-group">
								<label>Factura</label>
								<select id="ddlFacturas" name="role_id" class="form-control" onfocus="removeHas('ddlFacturas');">
								</select>
							</div>
						</div> 
						<div style="width: 100%;padding-left: 10px;padding-right: 10px;">
							<table id="tablaServicios" class="table table-bordered table-hover display" cellspacing="0" width="100%">
								<thead>
									<tr>
										<th>Servicio</th>
										<th>Total</th>
										<th>Monto</th>
									</tr>			
								</thead>
							</table>
						</div>
							
						
						<div class="col-lg-12">
							<div class="form-group">
								<label>Comentarios</label>
								<textarea id="txtComentarios"  rows="3" class="form-control"></textarea>
							</div>
						</div>  
					</div>
		
				</div>             
				
				<div class="modal-footer">
					<button id="btnGuardar" class="btn btn-secondary"><i class="iconoBoton fa fa-save"></i>Guardar</button>
				</div>
					
				
			</div>
		</div>
	</div>

	<div id="popuFiltro" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modal_add_user" aria-hidden="true" style="display: none;">
		<div class="modal-dialog">
			<div class="modal-content">
						
				<div class="modal-header">
				<h5 class="modal-title" id="modal_add_user">Filtros de busqueda</h5>
				<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>          	
				</div>
					
				<div class="modal-body">				                							
					<div class="row">
						<div class="col-lg-6">
							<div class="form-group">
								<label>Fecha inicio</label>
								<input class="form-control" id="txtFechaInicio" type="email" onfocus="removeHas('txtFechaInicio');">
							</div>
						</div>  
						
						<div class="col-lg-6">
							<div class="form-group">
								<label>Fecha fin</label>
								<input id="txtFechaFin" class="form-control" type="text" onfocus="removeHas('txtFechaFin');">
							</div>
						</div>  
					</div>

					<div class="row">
						<div class="col-lg-12">
							<div class="form-group">
								<label>Tipo sistema</label>
								<select id="ddlTipoSistemaFiltro" name="role_id" class="form-control" onfocus="removeHas('ddlTipoSistema');">
									<option value="1">AMARRES</option>
									<option value="2">PLATAFORMA</option>
								</select>
							</div>
						</div>    
					</div>

					<div class="row">
						<div class="col-lg-12">
							<div class="form-group">
								<label>Cliente</label>
								<select id="ddlClienteFiltro" name="role_id" class="form-control" onfocus="removeHas('ddlClienteFiltro');">
									<option value="-1">-SELECCIONE-</option>
								</select>
							</div>
						</div>    
					</div>

					<div class="row">
						<div class="col-lg-12">
							<div class="form-group">
								<label>Timbrada</label>
								<select id="ddlTimbrada" name="role_id" class="form-control" onfocus="removeHas('ddlTimbrada');">
									<option value="0">NO</option>
									<option value="1">SI</option>
								</select>
							</div>
						</div>    
					</div>
									
				</div>             
				
				<div class="modal-footer">
					<button id="btnConsultar" class="btn btn-secondary"><i class="iconoBoton fa fa-search"></i>Consultar</button>
				</div>
					
				
			</div>
		</div>
	</div>
	
	<!-- Servicio -->
	<div class="modal fade" id="popupFacturas" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
	  <div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title" id="modal_add_user">Facturas</h5>
				<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>          	
			</div>
		  <div class="modal-body">
		  		<table id="tablaDatos" class="table table-bordered table-hover display" cellspacing="0" width="100%">
						  <thead>
							<tr>
							 <th>Folio</th>
							 <th>Fecha emicion</th>
							 <th></th>
							</tr>			
						  </thead>
				</table>
		  	</div>
		  <div class="modal-footer">
			
		  </div>
		</div>
	  </div>
	</div>

		<!-- Modal ULTIMO CABO -->
		<div class="modal fade" id="popupTimbrar" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
	  <div class="modal-dialog" role="document">
		<div class="modal-content">
		  <div class="modal-header">
			<h5 class="modal-title" id="exampleModalLabel">Timbrar Nota de credito</h5>
			<button type="button" class="close" data-dismiss="modal" aria-label="Close">
			  <span aria-hidden="true">&times;</span>
			</button>
		  </div>
		  <div class="modal-body">
		  <div class="col-xs-12 col-sm-12 col-lg-12 col-lg-12">						
			<div class="form-group">
					<div class="row">
						<div class="col-xs-6 col-sm-6 col-lg-6 col-lg-6">
							<label>Resultado</label>
						</div>
						<div class="col-xs-6 col-sm-6 col-lg-6 col-lg-6" style="text-align: right">
							<span id="spanResultadoFacturacion"></span>
						</div>
					</div>
					<div>
					<textarea id="txtResultadoTimbrar" rows="6" class="form-control" readonly></textarea>
					</div>
				</div>
			</div>			
		  </div>
		  <div class="modal-footer">		    
			<button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="iconoBoton fa fa-close"></i>Salir</button>			
		  </div>
		</div>
	  </div>
	</div>
	
<script src="<?php echo ADMIN_URL;?>/Scripts/notasCredito.js"></script>	
<script src="../test_soap/test.js"></script>
