Primer commit del sistema avantika sin cambios
This commit is contained in:
52
modules/descuentos-nuevo.php
Executable file
52
modules/descuentos-nuevo.php
Executable file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
$empresa->AuthUser();
|
||||
|
||||
if(!$usuario->AllowPage($page, $_SESSION['loginKey'])){
|
||||
header('Location: '.WEB_ROOT);
|
||||
exit;
|
||||
}
|
||||
|
||||
$ventaId = intval($_GET['ventaId']);
|
||||
$sucursalId = $_SESSION['idSuc'];
|
||||
|
||||
$venta->setVentaId($ventaId);
|
||||
$info = $venta->Info();
|
||||
|
||||
$usuario->setUsuarioId($info['vendedorId']);
|
||||
$info['vendedor'] = $usuario->GetFullNameById();
|
||||
|
||||
$usuario->setUsuarioId($info['usuarioId']);
|
||||
$info['usuario'] = $usuario->GetFullNameById();
|
||||
|
||||
$sucursal->setSucursalId($info['sucursalId']);
|
||||
$info['sucursal'] = utf8_decode(urldecode($sucursal->GetNameById()));
|
||||
|
||||
$venta->setVentaId($ventaId);
|
||||
$resProds = $venta->GetSingleProds();
|
||||
|
||||
$_SESSION['prodDesc'] = array();
|
||||
|
||||
$productos = array();
|
||||
foreach($resProds as $res){
|
||||
|
||||
$venta->setVentaId($ventaId);
|
||||
$venta->setProdItemId($res['prodItemId']);
|
||||
$res['cantidad'] = $venta->GetCantProdsByItem();
|
||||
$res['precioUnitario'] = $venta->GetMaxPrecioByItem();
|
||||
$res['total'] = $venta->GetTotalByItem();
|
||||
|
||||
$producto->setProductoId($res['productoId']);
|
||||
$res['nombre'] = $producto->GetModeloById();
|
||||
|
||||
$res['tipoDesc'] = '';
|
||||
|
||||
$productos[] = $res;
|
||||
}
|
||||
|
||||
$_SESSION['prodDesc'] = $productos;
|
||||
|
||||
$smarty->assign('productos', $productos);
|
||||
$smarty->assign('info', $info);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user