Primer commit del sistema avantika sin cambios

This commit is contained in:
2026-01-06 19:42:24 -06:00
commit 3ae4be5957
7127 changed files with 440072 additions and 0 deletions

42
modules/descuentos.php Executable file
View File

@@ -0,0 +1,42 @@
<?php
$empresa->AuthUser();
if(!$usuario->AllowPage($page, $_SESSION['loginKey'])){
header('Location: '.WEB_ROOT);
exit;
}
$sucursalId = $_SESSION['idSuc'];
$msg = $_SESSION['msgI'];
$_SESSION['msgI'] = '';
$descuento->setPage(intval($_GET['p']));
$descuento->setSucursalId($sucursalId);
$ventas = $descuento->Enumerate();
$items = array();
foreach($ventas['items'] as $res){
$fecha = date('d-m-Y',strtotime($res['fecha']));
$hora = date('H:i:s',strtotime($res['fecha']));
$fecha = $util->FormatDateDMMMY($fecha);
$res['fecha'] = $fecha.' '.$hora;
$usuario->setUsuarioId($res['usuarioId']);
$res['usuario'] = $usuario->GetFullNameById();
$sucursal->setSucursalId($res['sucursalId']);
$res['sucursal'] = utf8_decode(urldecode($sucursal->GetNameById()));
if($res['status'] == 'DescAp')
$res['total'] = $res['totalDesc'];
$items[] = $res;
}
$ventas['items'] = $items;
$smarty->assign('ventas', $ventas);
?>