Files
ventas_php/modules/reportes-invparcial-detalles.php

85 lines
1.9 KiB
PHP
Executable File

<?php
$empresa->AuthUser();
if($Usr['type'] != 'admin'){
header('Location: '.WEB_ROOT);
exit;
}
$inventario->setRepInvParcialId($_GET['id']);
$infR = $inventario->InfoInvParcialById();
$sucursalId = $infR['sucursalId'];
$sucursal->setSucursalId($sucursalId);
$infR['sucursal'] = utf8_decode(urldecode($sucursal->GetNameById()));
$resProductos = $inventario->GetProdsByReport();
$totalIng = 0;
$totalreal = 0;
$items = array();
foreach($resProductos as $res){
$producto->setProductoId($res['productoId']);
$infP = $producto->Info();
$modelo = $infP['codigoBarra'].'<br>';
$modelo .= $infP['modelo'];
$res['modelo'] = $modelo;
$proveedor->setProveedorId($infP['proveedorId']);
$res['proveedor'] = $proveedor->GetNameById();
$producto->setProductoId($res['productoId']);
$resTallas = $producto->GetTallas();
$tallas = array();
foreach($resTallas as $val){
$atribVal->setAtribValId($val['tallaId']);
$tallas[] = $atribVal->GetNameById();
}
$res['talla'] = implode(', ',$tallas);
$producto->setProductoId($res['productoId']);
$resColores = $producto->GetColores();
$colores = array();
foreach($resColores as $val){
$atribVal->setAtribValId($val['colorId']);
$colores[] = $atribVal->GetNameById();
}
$res['color'] = implode(', ',$colores);
$producto->setProductoId($res['productoId']);
$resAtributos = $producto->GetAtributos();
$atributos = array();
foreach($resAtributos as $val){
$atribVal->setAtribValId($val['atribValId']);
$atributos[] = $atribVal->GetNameById();
}
$res['atributos'] = implode(', ',$atributos);
$totalIng += $res['cantidad'];
$totalReal += $res['cantReal'];
$items[] = $res;
}//foreach
$productos['items'] = $items;
$totales['ingresada'] = $totalIng;
$totales['real'] = $totalReal;
$smarty->assign('infR',$infR);
$smarty->assign('totales',$totales);
$smarty->assign('productos',$productos);
?>