49 lines
1.2 KiB
PHP
Executable File
49 lines
1.2 KiB
PHP
Executable File
<?php
|
|
|
|
$empresa->AuthUser();
|
|
|
|
if(!$usuario->AllowPage($page, $_SESSION['loginKey'])){
|
|
header('Location: '.WEB_ROOT);
|
|
exit;
|
|
}
|
|
|
|
$Usr = $user->Info();
|
|
|
|
$envio->SetPage($_GET["p"]);
|
|
$envio->setSucursalId($Usr['sucursalId']);
|
|
$productos = $envio->EnumRepProd();
|
|
|
|
$items = array();
|
|
foreach($productos['items'] as $res){
|
|
$card = $res;
|
|
|
|
$producto->setProductoId($res['productoId']);
|
|
$infP = $producto->Info();
|
|
|
|
$card['codigoBarra'] = $infP['codigoBarra'];
|
|
$card['modelo'] = $infP['modelo'];
|
|
|
|
$sucursal->setSucursalId($res['sucursalId']);
|
|
$card['sucursal'] = urldecode($sucursal->GetNameById());
|
|
|
|
if($card['tipo'] == 'Faltante')
|
|
$card['recibido'] = $card['total'] - $card['cantidad'];
|
|
else
|
|
$card['recibido'] = $card['total'] + $card['cantidad'];
|
|
|
|
$items[] = $card;
|
|
}
|
|
$productos['items'] = $items;
|
|
|
|
$sucursal->setSucursalId($Usr['sucursalId']);
|
|
$info['sucursal'] = urldecode($sucursal->GetNameById());
|
|
|
|
$resSuc = $sucursal->GetSucursalesByEmpresaId();
|
|
$resSuc2 = $util->DecodeUrlResult($resSuc);
|
|
$sucursales = $util->DecodeResult($resSuc2);
|
|
|
|
$smarty->assign('info',$info);
|
|
$smarty->assign('sucursales',$sucursales);
|
|
$smarty->assign('productos',$productos);
|
|
|
|
?>
|