<ul class="list-group">
	<li class="list-group-item">
		<?php
			$data['a'] = 'u';
			$data['ua'] = 'b';
			$this->load->view('ventas/navigation', $data);
		?>
	</li>
	<?php /*
	<li class="list-group-item">
		<div class="row">
			<div class="col-0  col-md-8">
			</div>
			<div class="col-12  col-md-4">
				<select name ="meses_ventas" class="form-control select-meses-ventas">
					<?php
						foreach ($meses_ventas as $k => $v) {
							$selected = '';
							if (!empty($periodo)) {
								if ($periodo == $v) {
									$selected =' selected="selected"';
								}
							}
							echo '<option value="' . $v . '"' . $selected . '>' . mtt($v) . '</option>';
						}
					?>
				</select>
			</div>
		</div>
	</li>
	*/?>
	<li class="list-group-item">
		<?php /*
			if (!empty($balance['cant_boletas'])) {
				?>
					<div class="row">
						<div class="col-6 row">
							&nbsp;
						</div>
						<div class="col-6 row">
							<div class="col-6">
								Nro de boletas
							</div>
							<div class="col-6 text-right">
								<?php echo $balance['cant_boletas']; ?>
							</div>
							<div class="col-6">
								Total Neto
							</div>
							<div class="col-6 text-right">
								$<?php echo clp($balance['neto_boletas']); ?>
							</div>
							<div class="col-6">
								Total IVA
							</div>
							<div class="col-6 text-right">
								$<?php echo clp($balance['iva_boletas']); ?>
							</div>
						</div>
						<div class="col-6 row">
						</div>
					</div>
					<hr>
				<?php
			}
			if (!empty($balance['cant_eboletas'])) {
				?>
					<div class="row">
						<div class="col-6 row">
							&nbsp;
						</div>
						<div class="col-6 row">
							<div class="col-6">
								Nro de e-Boletas
							</div>
							<div class="col-6 text-right">
								<?php echo $balance['cant_eboletas']; ?>
							</div>
							<div class="col-6">
								Total Neto e-Boletas
							</div>
							<div class="col-6 text-right">
								$<?php echo clp($balance['neto_eboletas']); ?>
							</div>
							<div class="col-6">
								Total IVA e-Boletas
							</div>
							<div class="col-6 text-right">
								$<?php echo clp($balance['iva_eboletas']); ?>
							</div>
						</div>
						<div class="col-6 row">
						</div>
					</div>
					<hr>
				<?php
			}
		*/ ?>
		<div class="row">
			<div class="col-6 row">
				<h4 class="col-12">Compra</h4>
				<?php if(!empty($balance['recibidos']['facturas']['cantidad'])) { ?>
					<div class="col-6">
						Factura
					</div>
					<div class="col-2 text-right">
						<?php echo $balance['recibidos']['facturas']['cantidad']; ?>
					</div>
					<div class="col-4 text-right">
						<?php echo clp($balance['recibidos']['facturas']['total']); ?>
					</div>
				<?php } ?>
				
				<?php if(!empty($balance['recibidos']['exentas']['cantidad'])) { ?>
					<div class="col-6">
						Factura No Afecta
					</div>
					<div class="col-2 text-right">
						<?php echo $balance['recibidos']['exentas']['cantidad']; ?>
					</div>
					<div class="col-4 text-right">
						<?php echo clp($balance['recibidos']['exentas']['total']); ?>
					</div>
				<?php } ?>

				<?php if(!empty($balance['recibidos']['debito']['cantidad'])) { ?>
					<div class="col-6">
						Nota de Débito
					</div>
					<div class="col-2 text-right">
						<?php echo $balance['recibidos']['debito']['cantidad']; ?>
					</div>
					<div class="col-4 text-right">
						<?php echo clp($balance['recibidos']['debito']['total']); ?>
					</div>
				<?php } ?>

				<?php if(!empty($balance['recibidos']['credito']['cantidad'])) { ?>
					<div class="col-6">
						Nota de Crédito
					</div>
					<div class="col-2 text-right">
						<?php echo $balance['recibidos']['credito']['cantidad']; ?>
					</div>
					<div class="col-4 text-right">
						<?php echo clp($balance['recibidos']['credito']['total']); ?>
				</div>
				<?php } ?>

				<?php if(!empty($balance['recibidos']['dins']['cantidad'])) { ?>
					<div class="col-6">
						Declaración de Ingreso
					</div>
					<div class="col-2 text-right">
						<?php echo $balance['recibidos']['dins']['cantidad']; ?>
					</div>
					<div class="col-4 text-right">
						<?php echo clp($balance['recibidos']['dins']['total']); ?>
					</div>
				<?php } ?>
<?php /*
				<div class="col-12">
					&nbsp;
				</div>
				*/?>
			</div>

			<div class="col-6 row">
				<h4 class="col-12">Venta</h4>
				<?php if(!empty($balance['emitidos']['facturas']['cantidad'])) { ?>
					<div class="col-6">
						Total Facturas
					</div>
					<div class="col-2 text-right">
						<?php echo $balance['emitidos']['facturas']['cantidad']; ?>
					</div>
					<div class="col-4 text-right">
						<?php echo clp($balance['emitidos']['facturas']['total']); ?>
					</div>
				<?php } ?>

				<?php
				if (!empty($balance['emitidos']['boletas']['cantidad'])) {
				?>
					<div class="col-2 text-right">
						<?php echo $balance['emitidos']['boletas']['cantidad']; ?>
					</div>
					<div class="col-4 text-right">
						<?php echo clp($balance['emitidos']['boletas']['total']); ?>
					</div>
				<?php
				}
				?>

				<div class="col-6">
					Boletas electrónicas
				</div>
				<div class="col-2 text-right">
					<?php echo $balance['emitidos']['eboletas']['cantidad']; ?>
				</div>
				<div class="col-4 text-right">
					<?php echo clp($balance['emitidos']['eboletas']['total']); ?>
				</div>

				<?php
				if (!empty($balance['emitidos']['comprobantes']['cantidad'])) {
				?>
					<div class="col-6">
						Comprobantes Electrónicos
					</div>
					<div class="col-2 text-right">
						<?php echo $balance['emitidos']['comprobantes']['cantidad']; ?>
					</div>
					<div class="col-4 text-right">
						<?php echo clp($balance['emitidos']['comprobantes']['total']); ?>
					</div>
				<?php
				} 
				?>

				<?php
				if (!empty($balance['emitidos']['credito']['cantidad'])) {
				?>
					<div class="col-6">
						Notas de Crédito
					</div>
					<div class="col-2 text-right">
						<?php echo $balance['emitidos']['credito']['cantidad']; ?>
					</div>
					<div class="col-4 text-right">
						<?php echo clp($balance['emitidos']['credito']['total']); ?>
					</div>
				<?php
				} 
				?>
				<?php
				/*
				if ($balance['cant_boletas'] == 0) {
				?>
					<div class="col-12">
						&nbsp;
					</div>
				<?php
				}*/
				?>
				<?php /*
				<div class="col-12">
					&nbsp;
				</div>
				<div class="col-12">
					&nbsp;
				</div>
				*/ ?>
			</div>
		</div>

		<?php /*
		<div class="row">
			<div class="col-6 row">
				<div class="col-6">
					<strong>Total Egresos</strong>
				</div>
				<div class="col-6 text-right">
					<strong>$<?php echo clp($balance['total_compras']); ?></strong>
				</div>
			</div>

			<div class="col-6 row">
				<div class="col-6">
					<strong>Total Ingresos</strong>
				</div>
				<div class="col-6 text-right">
					<strong>$<?php echo clp($balance['total_ventas']); ?></strong>
				</div>

				<div class="col-6">
					Total Balance
				</div>
				<div class="col-6 text-right">
					$<?php echo clp($balance['balance']); ?>
				</div>
			</div>
		</div>
		*/ ?>
	</li>
</ul>


<script>
	$(document).ready(function(){
		$('.select-meses-ventas').change(function(){
			window.location.href = $(this).val();
		});
	});
</script>