Primer commit del sistema avantika sin cambios
This commit is contained in:
77
modules/envios-tienda-agregar.php
Executable file
77
modules/envios-tienda-agregar.php
Executable file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
$empresa->AuthUser();
|
||||
|
||||
if($Usr['type'] != 'almacen' && $Usr['type'] != 'compras' && $Usr['type'] != 'gerente' && $Usr['type'] != 'direccion'){
|
||||
header('Location: '.WEB_ROOT);
|
||||
exit;
|
||||
}
|
||||
|
||||
$envioId = intval($_GET['id']);
|
||||
|
||||
$_SESSION['envProds'] = array();
|
||||
unset($_SESSION['envProds']);
|
||||
|
||||
if($envioId){
|
||||
|
||||
$envio->setEnvioId($envioId);
|
||||
$infE = $envio->Info();
|
||||
|
||||
$info['sucursalId'] = $infE['sucOrigen'];
|
||||
$info['sucursalId2'] = $infE['sucursalId'];
|
||||
|
||||
$products = $envio->GetProdsTienda();
|
||||
|
||||
$productos = array();
|
||||
foreach($products as $res){
|
||||
|
||||
$prodItemId = $res['prodItemId'];
|
||||
|
||||
$card['cantidad'] = $res['cantidad'];
|
||||
|
||||
$producto->setProdItemId($prodItemId);
|
||||
$infI = $producto->GetInfoItemById();
|
||||
|
||||
$card['productoId'] = $infI['productoId'];
|
||||
|
||||
$producto->setProductoId($infI['productoId']);
|
||||
$infP = $producto->Info();
|
||||
|
||||
$nombre = $infP['modelo'].', ';
|
||||
$nombre .= $producto->GetAtributosAll();
|
||||
|
||||
$atribVal->setAtribValId($infI['tallaId']);
|
||||
$nombre .= ', '.$atribVal->GetNameById();
|
||||
|
||||
$atribVal->setAtribValId($infI['colorId']);
|
||||
$nombre .= ', '.$atribVal->GetNameById();
|
||||
|
||||
$card['nombre'] = $nombre;
|
||||
$card['prodItemId'] = $prodItemId;
|
||||
|
||||
$inventario->setSucursalId($info['sucursalId']);
|
||||
$inventario->setProdItemId($prodItemId);
|
||||
$card['disponible'] = $inventario->GetDisponible();
|
||||
|
||||
$productos[] = $card;
|
||||
|
||||
}//foreach
|
||||
|
||||
$_SESSION['envProds'] = $util->EncodeResult($productos);
|
||||
|
||||
}//if
|
||||
|
||||
$resSuc = $sucursal->GetSucursalesByEmpresaId();
|
||||
$resSuc2 = $util->DecodeUrlResult($resSuc);
|
||||
$sucursales = $util->DecodeResult($resSuc2);
|
||||
|
||||
$proveedores = $proveedor->EnumerateAll();
|
||||
$categorias = $prodCat->EnumerateAll();
|
||||
|
||||
$smarty->assign('info',$info);
|
||||
$smarty->assign('productos',$productos);
|
||||
$smarty->assign('sucursales',$sucursales);
|
||||
$smarty->assign('categorias', $categorias);
|
||||
$smarty->assign('proveedores', $proveedores);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user