<?php 
	if(isset($corteFiscal) && $corteFiscal)extract($corteFiscal);
	if(isset($anexoMedios) && $anexoMedios)extract($anexoMedios);
	if(isset($anexoDocumento) && $anexoDocumento)extract($anexoDocumento);
	if(isset($anexoTipo) && $anexoTipo)extract($anexoTipo);
?>
<div class="tabs-container" id="<?php if(isset($modal) && $modal):$windowid= date('YmdHis'); echo $windowid; endif;?>">
	<?php if(isset($modal) && $modal):?>
	<div style="height:475px;overflow:scroll">
	<?php endif;?>
	<div class="tabs-left">
		<ul class="nav nav-tabs">
			<?php if(isset($corteFiscal) && $corteFiscal):?>
			<li class="active">
				<a data-toggle="tab" href="#cortes-app-fiscal-tab">Corte fiscal</a>
			</li>
			<?php endif; if(isset($anexoMedios) && $anexoMedios):?>
			<li>
				<a data-toggle="tab" href="#cortes-app-medio-tab">Medio de pago</a>
			</li>
			<?php endif; if(isset($anexoDocumento) && $anexoDocumento):?>
			<li>
				<a data-toggle="tab" href="#cortes-app-documento-tab">Documento</a>
			</li>
			<?php endif; if(isset($anexoTipo) && $anexoTipo):?>
			<li>
				<a data-toggle="tab" href="#cortes-app-ingreso-tab">Tipo</a>
			</li>
			<?php endif;?>
		</ul>
		<div class="tab-content m-md" id="cortes-app-tab-content">
			<!--Corte Fiscal-->
			<?php if(isset($corteFiscal) && $corteFiscal):?>
			<div id="cortes-app-fiscal-tab" class="tab-pane active">
				<table class="table table-hover">
					<!--Factura-->
					<tr>
						<td colspan="2"><b>Total facturas</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td class="money"><b><?php $totalFiscalFacturas=$total_factura_grabado+$total_factura_exento+$total_factura_nosujeto;echo number_format($totalFiscalFacturas,2,".",",");?></b></td>
					</tr>
					<tr>
						<td></td>
						<td> Total Gravadas</td>
						<td>$</td>
						<td class="money"><?php echo number_format($total_factura_grabado,2,".",",");?></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td></td>
						<td>Total Exentas</td>
						<td>$</td>
						<td class="money"><?php echo number_format($total_factura_exento,2,".",",");?></td>
						<td></td>
						<td></td>
					</tr>
					<tr class="border-div">
						<td></td>
						<td>Total No Sujetas</td>
						<td>$</td>
						<td class="money"><?php echo number_format($total_factura_nosujeto,2,".",",");?></td>
						<td></td>
						<td></td>
					</tr>
					<!--CCF-->
					<tr>
						<td colspan="2"><b>Total CCF</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td class="money"><b><?php $totalFiscalCCF=$total_ccf_grabado+$total_ccf_exento+$total_ccf_nosujeto;echo number_format($totalFiscalCCF,2,".",",");?></b></td>
					</tr>
					<tr>
						<td></td>
						<td> Total Gravadas</td>
						<td>$</td>
						<td class="money"><?php echo number_format($total_ccf_grabado,2,".",",");?></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td></td>
						<td>Total Exentas</td>
						<td>$</td>
						<td class="money"><?php echo number_format($total_ccf_exento,2,".",",");?></td>
						<td></td>
						<td></td>
					</tr>
					<tr class="border-div">
						<td></td>
						<td>Total No Sujetas</td>
						<td>$</td>
						<td class="money"><?php echo number_format($total_ccf_nosujeto,2,".",",");?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Tickets-->
					<tr>
						<td colspan="2"><b>Total tickets</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td class="money"><b><?php $totalFiscalTicket=$total_ticket_grabado+$total_ticket_exento+$total_ticket_nosujeto;echo number_format($totalFiscalTicket,2,".",",");?></b></td>
					</tr>
					<tr>
						<td></td>
						<td> Total Gravadas</td>
						<td>$</td>
						<td class="money"><?php echo number_format($total_ticket_grabado,2,".",",");?></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td></td>
						<td> Total Interno</td>
						<td>$</td>
						<td class="money"><?php echo number_format($total_ticket_interno,2,".",",");?></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td></td>
						<td> Total Exentas</td>
						<td>$</td>
						<td class="money"><?php echo number_format($total_ticket_exento,2,".",",");?></td>
						<td></td>
						<td></td>
					</tr>
					<tr class="border-div">
						<td></td>
						<td> Total No Sujetas</td>
						<td>$</td>
						<td class="money"><?php echo number_format($total_ticket_nosujeto,2,".",",");?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Anulaciones-->
					<tr>
						<td colspan="2"><b>Devoluciones</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td class="money"><b>(<?php $totalFiscalDev=$total_devolucion_factura+$total_devolucion_ccf+$total_devolucion_ticket+$total_devolucion_ncredito;echo number_format($totalFiscalDev,2,".",",");?>)</b></td>
					</tr>
					<tr>
						<td></td>
						<td>Devoluci&oacute;n Facturas</td>
						<td>$</td>
						<td class="money"><?php echo number_format($total_devolucion_factura,2,".",",");?></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td></td>
						<td>Devoluci&oacute;n CCF</td>
						<td>$</td>
						<td class="money"><?php echo number_format($total_devolucion_ccf,2,".",",");?></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td></td>
						<td>Devoluci&oacute;n Nota Cr&eacute;dito</td>
						<td>$</td>
						<td class="money"><?php echo number_format($total_devolucion_ncredito,2,".",",");?></td>
						<td></td>
						<td></td>
					</tr>
					<tr class="border-div">
						<td></td>
						<td>Devoluci&oacute;n Tickets</td>
						<td>$</td>
						<td class="money"><?php echo number_format($total_devolucion_ticket,2,".",",");?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Totales-->
					<tr  class="border-div">
						<td colspan="2"><b>TOTAL EN VENTAS</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td class="money"><b><?php echo number_format($totalFiscalFacturas+$totalFiscalCCF+$totalFiscalTicket-$totalFiscalDev,2,".",",");?></b></td>
					</tr>
					<tr>
						<td colspan="2">Facturas Emitidas</td>
						<td></td>
						<td></td>
						<td></td>
						<td><?php echo $total_trans_factura;?></td>
					</tr>
					<tr>
						<td colspan="2">CCF Emitidos</td>
						<td></td>
						<td></td>
						<td></td>
						<td><?php echo $total_trans_ccf;?></td>
					</tr>
					<tr>
						<td colspan="2">Nota Cr&eacute;dito Emitidas</td>
						<td></td>
						<td></td>
						<td></td>
						<td><?php echo $total_trans_ncredito;?></td>
					</tr>
					<tr>
						<td colspan="2">Tickets Emitidos</td>
						<td></td>
						<td></td>
						<td></td>
						<td><?php echo $total_trans_ticket;?></td>
					</tr>
					<tr>
						<td colspan="2">Tickets devoluci&oacute;n</td>
						<td></td>
						<td></td>
						<td></td>
						<td><?php echo $total_trans_ticket_dev;?></td>
					</tr>
					<tr>
						<td></td>
						<td>Tickets inicio</td>
						<td></td>
						<td><?php echo str_pad($ticketInicio,7, "0", STR_PAD_LEFT);?></td>
						<td></td>
						<td></td>
					</tr>
					<tr class="border-div">
						<td></td>
						<td>Tickets final</td>
						<td></td>
						<td><?php echo (($ticketFin!="-")?str_pad($ticketFin,7, "0", STR_PAD_LEFT):"-");?></td>
						<td></td>
						<td></td>
					</tr>
					<tr class="border-div">
						<td colspan="2">Transacciones realizadas</td>
						<td></td>
						<td></td>
						<td></td>
						<td><?php echo $total_trans_factura+ $total_trans_ccf+$total_trans_ncredito+$total_trans_ticket+$total_trans_ticket_dev;?></td>
					</tr>
				</table>
			</div>
			<?php endif; if(isset($anexoMedios) && $anexoMedios):?>
			<!--Anexo 1 medios de pago-->
			<div id="cortes-app-medio-tab" class="tab-pane">
				<table class="table table-hover">
					<!--Efectivo-->
					<tr>
						<td colspan="2"><b>EFECTIVO</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td class="money"><b><?php $totalEfectivoMedios=$total_ventas_efectivo-$total_devoluciones_efectivo;$totalNetoMedios=$totalEfectivoMedios;echo number_format($totalEfectivoMedios,2,'.',',');?></b></td>
					</tr>
					<tr>
						<td></td>
						<td>Ingresos</td>
						<td>$</td>
						<td class="money"><?php echo  number_format($total_ventas_efectivo,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<tr class="border-div">
						<td></td>
						<td>Egresos</td>
						<td>$</td>
						<td class="money">(<?php echo  number_format($total_devoluciones_efectivo,2,'.',',');?>)</td>
						<td></td>
						<td></td>
					</tr>
					<!--Cheque-->
					<tr>
						<td colspan="2"><b>CHEQUE</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td class="money"><b><?php $totalChequeMedios=$total_ventas_cheque-$total_devoluciones_cheque;$totalNetoMedios+=$totalChequeMedios;echo  number_format($totalChequeMedios,2,'.',',');?></b></td>
					</tr>
					<tr>
						<td></td>
						<td>Ingresos</td>
						<td>$</td>
						<td class="money"><?php echo  number_format($total_ventas_cheque,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<tr class="border-div">
						<td></td>
						<td>Egresos</td>
						<td>$</td>
						<td class="money">(<?php echo  number_format($total_devoluciones_cheque,2,'.',',');?>)</td>
						<td></td>
						<td></td>
					</tr>
					<!--POS-->
					<tr>
						<td colspan="2"><b>POS</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td class="money"><b><?php $totalPOSMedios=$total_ventas_pos-$total_devoluciones_pos;$totalNetoMedios+=$totalPOSMedios;echo number_format($totalPOSMedios,2,'.',',');?></b></td>
					</tr>
					<tr>
						<td></td>
						<td>Ingresos</td>
						<td>$</td>
						<td class="money"><?php echo  number_format($total_ventas_pos,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<tr class="border-div">
						<td></td>
						<td>Egresos</td>
						<td>$</td>
						<td class="money">(<?php echo  number_format($total_devoluciones_pos,2,'.',',');?>)</td>
						<td></td>
						<td></td>
					</tr>
					<!--ABONO A CUENTA-->
					<tr>
						<td colspan="2"><b>ABONOS A CUENTA</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td class="money"><b><?php $totalACuentaMedios=$total_ventas_cuenta-$total_devoluciones_cuenta;$totalNetoMedios+=$totalACuentaMedios;echo number_format($totalACuentaMedios,2,'.',',');?></b></td>
					</tr>
					<tr>
						<td></td>
						<td>Ingresos</td>
						<td>$</td>
						<td class="money"><?php echo  number_format($total_ventas_cuenta,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<tr class="border-div">
						<td></td>
						<td>Egresos</td>
						<td>$</td>
						<td class="money">(<?php echo  number_format($total_devoluciones_cuenta,2,'.',',');?>)</td>
						<td></td>
						<td></td>
					</tr>
					<!--PAGO ELECTRONICO-->
					<tr>
						<td colspan="2"><b>PAGO ELECTR&Oacute;NICO</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td class="money"><b><?php $totalPElectronico=$total_ventas_electronico-$total_devoluciones_electronico;$totalNetoMedios+=$totalPElectronico;echo  number_format($totalPElectronico,2,'.',',');?></b></td>
					</tr>
					<tr>
						<td></td>
						<td>Ingresos</td>
						<td>$</td>
						<td class="money"><?php echo  number_format($total_ventas_electronico,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<tr class="border-div">
						<td></td>
						<td>Egresos</td>
						<td>$</td>
						<td class="money">(<?php echo  number_format($total_devoluciones_electronico,2,'.',',');?>)</td>
						<td></td>
						<td></td>
					</tr>
					<tr class="border-div">
						<td colspan="2"><b>INGRESOS</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td class="money"><b><?php echo  number_format($totalNetoMedios,2,'.',',');?></b></td>
					</tr>
					<tr class="border-div">
						<td colspan="2">Dotaciones</td>
						<td></td>
						<td></td>
						<td>$</td>
						<td class="money"><?php echo number_format($dotacion,2,'.',',');?></td>
					</tr>
					<tr class="border-div">
						<td colspan="2"><b>INGRESO BRUTO</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td class="money"><b><?php echo  number_format($totalNetoMedios+$dotacion,2,'.',',');?></b></td>
					</tr>
					<tr class="border-div">
						<td colspan="2">Anticipos anteriores</td>
						<td></td>
						<td></td>
						<td>$</td>
						<td class="money">(<?php echo number_format($total_anticipos_anteriores,2,'.',',');?>)</td>
					</tr>
					<tr class="border-div">
						<td colspan="2"><b>TOTAL</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td class="money"><b><?php echo number_format(($totalNetoMedios+$dotacion)-$total_anticipos_anteriores,2,'.',',');?></b></td>
					</tr>
				</table>
			</div>
			<?php endif; if(isset($anexoDocumento) && $anexoDocumento):?>
			<!--Anexo 2 documento y forma-->
			<div id="cortes-app-documento-tab" class="tab-pane">
				<table class="table table-hover">
					<!--CONTADO-->
					<tr>
						<td colspan="2"><b>Ingresos contado</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php $total_contado_docs=$total_contado_factura+$total_contado_ccf+$total_contado_ticket+$total_contado_ticketrecibo+$total_contado_nremision+$total_contado_nenvio+$total_recibos+$total_abonos_pedido+$total_contado_sdocumento; echo number_format($total_contado_docs,2,'.',',');?></b></td>
					</tr>
					<!--Facturas-->
					<tr>
						<td></td>
						<td>Facturas</td>
						<td>$</td>
						<td><?php echo number_format($total_contado_factura,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>	
					<!--CCF-->
					<tr>
						<td></td>
						<td>CCFs</td>
						<td>$</td>
						<td><?php echo number_format($total_contado_ccf,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Tickets-->
					<tr>
						<td></td>
						<td>Tickets</td>
						<td>$</td>
						<td><?php echo number_format($total_contado_ticket,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Tickets-->
					<tr>
						<td></td>
						<td>Comprobantes</td>
						<td>$</td>
						<td><?php echo number_format($total_contado_ticketrecibo,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Notas de remision-->
					<tr>
						<td></td>
						<td>Notas de remisi&oacute;n</td>
						<td>$</td>
						<td><?php echo number_format($total_contado_nremision,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Notas de envio-->
					<tr>
						<td></td>
						<td>Notas de env&iacute;o</td>
						<td>$</td>
						<td><?php echo number_format($total_contado_nenvio,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Recibos-->
					<tr>
						<td></td>
						<td>Recibos</td>
						<td>$</td>
						<td><?php echo number_format($total_recibos,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Ant. orden de pedido-->
					<tr>
						<td></td>
						<td>Ant. orden de pedido</td>
						<td>$</td>
						<td><?php echo number_format($total_abonos_pedido,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Sin Documento-->
					<tr class="border-div">
						<td></td>
						<td>Sin Documento</td>
						<td>$</td>
						<td><?php echo number_format($total_contado_sdocumento,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--DEVOLUCIONES CONTADO-->
					<tr>
						<td colspan="2"><b>Devoluciones contado</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php $total_contado_dev_docs=$total_devolucion_factura_contado+$total_devolucion_ccf_contado+$total_devolucion_ncredito_contado+$total_devolucion_ticket_contado+$total_devolucion_ticketrecibo_contado+$total_devolucion_nremision_contado+$total_devolucion_nenvio_contado+$total_devolucion_sdocumento_contado; echo "(".number_format($total_contado_dev_docs,2,'.',',').")";?></b></td>
					</tr>
					<!--Facturas-->
					<tr>
						<td></td>
						<td>Facturas</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_factura_contado,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>	
					<!--CCF-->
					<tr>
						<td></td>
						<td>CCFs</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_ccf_contado,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Notas de credito-->
					<tr>
						<td></td>
						<td>Notas de cr&eacute;dito</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_ncredito_contado,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Tickets-->
					<tr>
						<td></td>
						<td>Tickets</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_ticket_contado,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Tickets-->
					<tr>
						<td></td>
						<td>Comprobantes</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_ticketrecibo_contado,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Notas de remision-->
					<tr>
						<td></td>
						<td>Notas de remisi&oacute;n</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_nremision_contado,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Notas de envio-->
					<tr>
						<td></td>
						<td>Notas de env&iacute;o</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_nenvio_contado,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Sin Documento-->
					<tr class="border-div">
						<td></td>
						<td>Sin Documento</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_sdocumento_contado,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<tr class="border-div">
						<td colspan="2"><b>TOTAL CONTADO BRUTO</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php echo number_format($total_contado_docs-$total_contado_dev_docs,2,'.',',');?></b></td>
					</tr>
					<tr class="border-div">
						<td colspan="2"><b>Dotacion</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php echo number_format($dotacion,2,'.',',');?></b></td>
					</tr>
					<tr class="border-div">
						<td colspan="2"><b>TOTAL CONTADO BRUTO + DOTACION</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php echo number_format($dotacion+$total_contado_docs-$total_contado_dev_docs,2,'.',',');?></b></td>
					</tr>
					<tr class="border-div">
						<td colspan="2"><b>Anticipos anteriores</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b>(<?php echo number_format($total_anticipos_anteriores,2,'.',',');?>)</b></td>
					</tr>
					<tr class="border-div">
						<td colspan="2"><b>TOTAL CONTADO NETO</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php echo number_format($dotacion+$total_contado_docs-($total_contado_dev_docs+$total_anticipos_anteriores),2,'.',',');?></b></td>
					</tr>
					<!---->
					<tr>
						<td colspan="6"></td>
					</tr>
					<!--CREDITO-->
					<tr>
						<td colspan="2"><b>Cr&eacute;dito generado</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php $total_credito_docs=$total_credito_factura+$total_credito_ccf+$total_credito_ticket+$total_credito_ticketrecibo+$total_credito_nremision+$total_credito_nenvio+$total_credito_sdocumento; echo number_format($total_credito_docs,2,'.',',');?></b></td>
					</tr>
					<!--Facturas-->
					<tr>
						<td></td>
						<td>Facturas</td>
						<td>$</td>
						<td><?php echo number_format($total_credito_factura,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>	
					<!--CCF-->
					<tr>
						<td></td>
						<td>CCFs</td>
						<td>$</td>
						<td><?php echo number_format($total_credito_ccf,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Tickets-->
					<tr>
						<td></td>
						<td>Tickets</td>
						<td>$</td>
						<td><?php echo number_format($total_credito_ticket,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td></td>
						<td>Comprobantes</td>
						<td>$</td>
						<td><?php echo number_format($total_credito_ticketrecibo,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Notas de remision-->
					<tr>
						<td></td>
						<td>Notas de remisi&oacute;n</td>
						<td>$</td>
						<td><?php echo number_format($total_credito_nremision,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Notas de envio-->
					<tr>
						<td></td>
						<td>Notas de env&iacute;o</td>
						<td>$</td>
						<td><?php echo number_format($total_credito_nenvio,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Sin Documento-->
					<tr class="border-div">
						<td></td>
						<td>Sin Documento</td>
						<td>$</td>
						<td><?php echo number_format($total_credito_sdocumento,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--DEVOLUCIONES CREDITO-->
					<tr>
						<td colspan="2"><b>Devoluciones cr&eacute;dito</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php $total_credito_dev_docs=$total_devolucion_factura_credito+$total_devolucion_ccf_credito+$total_devolucion_ncredito_credito+$total_devolucion_ticket_credito+$total_devolucion_ticketrecibo_credito+$total_devolucion_nremision_credito+$total_devolucion_nenvio_credito+$total_devolucion_sdocumento_credito; echo "(".number_format($total_credito_dev_docs,2,'.',',').")";?></b></td>
					</tr>
					<!--Facturas-->
					<tr>
						<td></td>
						<td>Facturas</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_factura_credito,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>	
					<!--CCF-->
					<tr>
						<td></td>
						<td>CCFs</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_ccf_credito,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Notas de credito-->
					<tr>
						<td></td>
						<td>Notas de cr&eacute;dito</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_ncredito_credito,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Tickets-->
					<tr>
						<td></td>
						<td>Tickets</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_ticket_credito,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td></td>
						<td>Comprobantes</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_ticketrecibo_credito,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Notas de remision-->
					<tr>
						<td></td>
						<td>Notas de remisi&oacute;n</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_nremision_credito,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Notas de envio-->
					<tr>
						<td></td>
						<td>Notas de env&iacute;o</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_nenvio_credito,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Sin Documento-->
					<tr class="border-div">
						<td></td>
						<td>Sin Documento</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_sdocumento_credito,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<tr class="border-div">
						<td colspan="2"><b>TOTAL CR&Eacute;DITO NETO</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php echo number_format($total_credito_docs-$total_credito_dev_docs,2,'.',',');?></b></td>
					</tr>
					<!---->
					<tr>
						<td colspan="6"></td>
					</tr>
					
					<!--A COBRO-->
					<tr>
						<td colspan="2"><b>Ventas a cobro</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php $total_acobro=$total_acobro_factura+$total_acobro_ccf+$total_acobro_ticket+$total_acobro_ticketrecibo; echo number_format($total_acobro,2,'.',',');?></b></td>
					</tr>
					<!--Facturas-->
					<tr>
						<td></td>
						<td>Facturas</td>
						<td>$</td>
						<td><?php echo number_format($total_acobro_factura,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--CCF-->
					<tr>
						<td></td>
						<td>CCFs</td>
						<td>$</td>
						<td><?php echo number_format($total_acobro_ccf,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Tickets-->
					<tr>
						<td></td>
						<td>Tickets</td>
						<td>$</td>
						<td><?php echo number_format($total_acobro_ticket,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<tr  class="border-div">
						<td></td>
						<td>Comprobantes</td>
						<td>$</td>
						<td><?php echo number_format($total_acobro_ticketrecibo,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td colspan="2" ><b>Devoluciones ventas a cobro</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php $total_dev_acobro=$total_devolucion_factura_acobro+$total_devolucion_ccf_acobro+$total_devolucion_ticket_acobro+$total_devolucion_ticketrecibo_acobro; echo "(".number_format($total_dev_acobro,2,'.',',').")";?></b></td>
					</tr>
					<!--Facturas-->
					<tr>
						<td></td>
						<td>Facturas</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_factura_acobro,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--CCF-->
					<tr>
						<td></td>
						<td>CCFs</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_ccf_acobro,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Tickets-->
					<tr>
						<td></td>
						<td>Tickets</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_ticket_acobro,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<tr class="border-div">
						<td></td>
						<td>Comprobantes</td>
						<td>$</td>
						<td><?php echo number_format($total_devolucion_ticketrecibo_acobro,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<tr class="border-div">
						<td colspan="2"><b>TOTAL A COBRO</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php echo number_format($total_acobro-$total_dev_acobro,2,'.',',');?></b></td>
					</tr>
					<!---->
					<tr>
						<td colspan="6"></td>
					</tr>
					<!--SIN INGRESO-->
					<tr>
						<td colspan="2"><b>TOTAL SIN INGRESO</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php $total_singreso_docs=$total_singreso_factura+$total_singreso_ccf+$total_singreso_ticket+$total_singreso_ticketrecibo; echo number_format($total_singreso_docs,2,'.',',');?></b></td>
					</tr>
					<!--Facturas-->
					<tr>
						<td></td>
						<td>Facturas</td>
						<td>$</td>
						<td><?php echo number_format($total_singreso_factura,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>	
					<!--CCF-->
					<tr>
						<td></td>
						<td>CCFs</td>
						<td>$</td>
						<td><?php echo number_format($total_singreso_ccf,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<!--Tickets-->
					<tr>
						<td></td>
						<td>Tickets</td>
						<td>$</td>
						<td><?php echo number_format($total_singreso_ticket,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td></td>
						<td>Comprobantes</td>
						<td>$</td>
						<td><?php echo number_format($total_singreso_ticketrecibo,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
				</table>
			</div>
			<?php endif; if(isset($anexoTipo) && $anexoTipo):?>
			<!--Anexo 3 tipo-->
			<div id="cortes-app-ingreso-tab" class="tab-pane">
				<table class="table table-hover">
					<!--Ventas contado-->
					<tr>
						<td colspan="2"><b>Ventas netas contado</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php $total_neto_venta_contado=$total_venta_contado-$total_dev_contado; echo number_format($total_neto_venta_contado,2,'.',',');?></b></td>
					</tr>
					<tr>
						<td></td>
						<td>Ventas</td>
						<td>$</td>
						<td><?php echo number_format($total_venta_contado,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>				
					<tr class="border-div">
						<td></td>
						<td>Devoluciones</td>
						<td>$</td>
						<td>(<?php echo number_format($total_dev_contado,2,'.',',');?>)</td>
						<td></td>
						<td></td>
					</tr>
					<!--Abonos a credito-->
					<tr>
						<td colspan="2"><b>Abono a cr&eacute;dito</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php echo number_format($total_abonos_cred_contado,2,'.',',');?></b></td>
					</tr>
					<!--Pagos de a cobro-->
					<tr>
						<td colspan="2"><b>Pago de facturas a cobro</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php echo number_format($total_abonos_acobro_contado,2,'.',',');?></b></td>
					</tr>
					<!--Anticipos a pedidos-->
					<tr class="border-div">
						<td colspan="2"><b>Ant. a pedido</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php echo number_format($total_abonos_pedido_contado,2,'.',',');?></b></td>
					</tr>
					<!--TOTAL CONTADO NETO-->
					<tr class="border-div">
						<td colspan="2"><b>TOTAL CONTADO NETO</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php echo number_format($total_neto_venta_contado+$total_abonos_cred_contado+$total_abonos_acobro_contado+$total_abonos_pedido_contado,2,'.',',');?></b></td>
					</tr>
					<tr class="border-div">
						<td colspan="2">Dotaci&oacute;n</td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><?php echo number_format($dotacion_contado,2,'.',',');?></td>
					</tr>
					<tr class="border-div">
						<td colspan="2"><b>TOTAL CONTADO</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php echo number_format($total_neto_venta_contado+$total_abonos_cred_contado+$total_abonos_acobro_contado+$total_abonos_pedido_contado+$dotacion_contado,2,'.',',');?></b></td>
					</tr>
					<!---->
					<tr>
						<td colspan="6"></td>
					</tr>
					<!--Ventas credito-->
					<tr>
						<td colspan="2"><b>Ventas netas cr&eacute;dito</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php $total_neto_venta_credito=$total_venta_credito-$total_dev_credito; echo number_format($total_neto_venta_credito,2,'.',',');?></b></td>
					</tr>
					<tr>
						<td></td>
						<td>Ventas netas cr&eacute;dito</td>
						<td>$</td>
						<td><?php echo number_format($total_venta_credito,2,'.',',');?></td>
						<td></td>
						<td></td>
					</tr>
					<tr class="border-div">
						<td></td>
						<td>Dev. C/Abono Cr&eacute;dito</td>
						<td>$</td>
						<td>(<?php echo number_format($total_dev_credito,2,'.',',');?>)</td>
						<td></td>
						<td></td>
					</tr>
					<!--Pagos de creditos-->
					<tr class="border-div">
						<td colspan="2"><b>Abonos a cr&eacute;ditos</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b>(<?php echo number_format($total_abonos_cred_contado,2,'.',',');?>)</b></td>
					</tr>
					<!--Evolucion del credito-->
					<tr class="border-div">
						<td colspan="2"><b>EVOLUCI&Oacute;N DEL CR&Eacute;DITO</b></td>
						<td></td>
						<td></td>
						<td>$</td>
						<td><b><?php echo number_format($total_neto_venta_credito-$total_abonos_cred_contado,2,'.',',');?></b></td>
					</tr>
				</table>
			</div>
			<?php endif;?>
			<input type="hidden" id="id_corte" value="<?php echo $id_corte;?>">
		</div>
	</div>
	<?php if(isset($modal) && $modal):?>
	</div>
	<?php endif;?>
<?php if(isset($modal) && $modal):?>
	<div class="text-center m-t-sm">
		<button type="button" class="btn btn-danger" onclick="Custombox.close();">Salir</button>
		<button type="button" id="cortes-app-exportar-imprimir" class="btn btn-primary">Exportar/Imprimir</button>
	</div>
	<!--Modales-->
	<div>
		<div class="modal inmodal fade" id="cortes-app-exportar-opciones" tabindex="-1" role="dialog"  aria-hidden="true">
			<div class="modal-dialog modal-sm">
				<div class="modal-content">
					<div class="modal-header">
						<h4 class="">Opciones de cortes</h4>
					</div>
					<div class="modal-body">
						<label class="control-label">Incluir</label>
						<div>
							<label><input type="checkbox"  id="corte-fiscal" checked> Corte Fiscal</label>
						</div>
						<div>
							<label><input type="checkbox"  id="corte-anexo1" checked> Anexo 1</label>
						</div>
						<div>
							<label><input type="checkbox"  id="corte-anexo2" checked> Anexo 2</label>
						</div>
						<div>
							<label><input type="checkbox"  id="corte-anexo3" checked> Anexo 3</label>
						</div>
						<div class="hr-line-dashed"></div>
						<label class="control-label">Acci&oacute;n:</label>
						<select class="form-control" id="cortes-app-exportar-opcion">
							<option value="0" selected>Imprimir</option>
							<option value="1">Exportar</option>
						</select>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-white" data-dismiss="modal">Cancelar</button>
						<button type="button" id="cortes-app-exportar-continuar-btn" class="btn btn-primary">Continuar</button>
					</div>
				</div>
			</div>
		</div>
	</div>
<?php endif;?>
</div>
<script>
<?php if(isset($modal) && $modal):?>
	var transacciones_cortes_app=new Transacciones_cortes_app();
	transacciones_cortes_app.initializeEnviroment("<?php echo base_url();?>","<?php echo $windowid;?>",null);
<?php endif;?>
</script>