Primer commit del sistema avantika sin cambios
This commit is contained in:
134
modules/inventario-detalles.php
Executable file
134
modules/inventario-detalles.php
Executable file
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
|
||||
$empresa->AuthUser();
|
||||
|
||||
if(!$usuario->AllowPage($page, $_SESSION['loginKey'])){
|
||||
header('Location: '.WEB_ROOT);
|
||||
exit;
|
||||
}
|
||||
|
||||
$productoId = intval($_GET['id']);
|
||||
$sucursalId = $_SESSION['idSuc'];
|
||||
|
||||
$producto->setProductoId($productoId);
|
||||
$info = $producto->Info();
|
||||
//$info = $util->DecodeRow($info);
|
||||
|
||||
$proveedor->setProveedorId($info['proveedorId']);
|
||||
$info['proveedor'] = $proveedor->GetNameById();
|
||||
|
||||
$prodCat->setProdCatId($info['prodCatId']);
|
||||
$info['departamento'] = $prodCat->GetNameById();
|
||||
|
||||
if($info['prodSubcatId']){
|
||||
$prodSubcat->setProdSubcatId($info['prodSubcatId']);
|
||||
$info['linea'] = $prodSubcat->GetNameById();
|
||||
}
|
||||
|
||||
$temporada->setTemporadaId($info['temporadaId']);
|
||||
$info['temporada'] = $temporada->GetNameById();
|
||||
|
||||
$porcUtilidad = ($info['utilidad'] * 100) / $info['costo'];
|
||||
$info['porcUtilidad'] = number_format($porcUtilidad,2,'.',',');
|
||||
|
||||
//Obtenemos las Tallas
|
||||
|
||||
$atribVal->setAtributoId(1);
|
||||
$resTallas = $atribVal->EnumerateAll();
|
||||
|
||||
$tallas = array();
|
||||
foreach($resTallas as $res){
|
||||
|
||||
$producto->setTallaId($res['atribValId']);
|
||||
if($producto->ExistTalla())
|
||||
$tallas[] = $res;
|
||||
}
|
||||
|
||||
$atribVal->setAtributoId(2);
|
||||
$resColores = $atribVal->EnumerateAll();
|
||||
|
||||
//Obtenemos los Colores
|
||||
|
||||
$colores = array();
|
||||
foreach($resColores as $res){
|
||||
|
||||
$producto->setColorId($res['atribValId']);
|
||||
if($producto->ExistColor())
|
||||
$colores[] = $res;
|
||||
|
||||
}
|
||||
|
||||
//Obtenemos los Atributos
|
||||
|
||||
$prodSubcat->setProdSubcatId($info['prodSubcatId']);
|
||||
$resAtributos = $prodSubcat->EnumAtributos();
|
||||
|
||||
$atributos = array();
|
||||
foreach($resAtributos as $res){
|
||||
|
||||
$atributo->setAtributoId($res['atributoId']);
|
||||
$res['nombre'] = $atributo->GetNameById();
|
||||
|
||||
$atribVal->setAtributoId($res['atributoId']);
|
||||
$resValores = $atribVal->EnumerateAll();
|
||||
|
||||
$valores = array();
|
||||
foreach($resValores as $val){
|
||||
|
||||
$producto->setAtribValId($val['atribValId']);
|
||||
if($producto->ExistAtributo())
|
||||
$valores[] = $val;
|
||||
|
||||
}
|
||||
|
||||
$res['valores'] = $valores;
|
||||
|
||||
$atributos[] = $res;
|
||||
}
|
||||
|
||||
//Obtenemos los Codigos de Barra
|
||||
|
||||
$resCodigos = $producto->GetCodigosBarra();
|
||||
$codigos = array();
|
||||
foreach($resCodigos as $res){
|
||||
|
||||
$card = $res;
|
||||
|
||||
$atribVal->setAtribValId($res['tallaId']);
|
||||
$nomTalla = $atribVal->GetNameById();
|
||||
|
||||
$atribVal->setAtribValId($res['colorId']);
|
||||
$card['nombre'] = $nomTalla.' '.$atribVal->GetNameById();
|
||||
$card['codigo'] = $res['codigoBarra'];
|
||||
|
||||
$inventario->setSucursalId($sucursalId);
|
||||
$inventario->setProdItemId($res['prodItemId']);
|
||||
$card['cantidad'] = $inventario->GetDisponible();
|
||||
|
||||
$codigos[] = $card;
|
||||
|
||||
}
|
||||
|
||||
//Obtenemos los materiales del Producto
|
||||
|
||||
$producto->setProductoId($productoId);
|
||||
$resMats = $producto->GetMaterials();
|
||||
|
||||
$prodMats = array();
|
||||
foreach($resMats as $res){
|
||||
|
||||
$material->setMaterialId($res['materialId']);
|
||||
$res['material'] = $material->GetNameById();
|
||||
|
||||
$prodMats[] = $res;
|
||||
|
||||
}
|
||||
|
||||
$smarty->assign('info', $info);
|
||||
$smarty->assign('tallas', $tallas);
|
||||
$smarty->assign('colores', $colores);
|
||||
$smarty->assign('codigos', $codigos);
|
||||
$smarty->assign('prodMats', $prodMats);
|
||||
$smarty->assign('atributos', $atributos);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user