miércoles, 9 de octubre de 2013
List of products in Adempiere
-- select * from vw_listado_productos;
drop view if exists vw_listado_productos;
create view vw_listado_productos
as
select
p.m_product_id as id_producto,
p.value as cod_producto,
p.name as producto,
p.description as descripcion,
pc.m_product_category_id as id_categoria,
pc.name as categoria_producto,
um.c_uom_id as id_unidad,
um.name as unidad_medida,
p.producttype as id_tipo,
case p.producttype
when 'E' then 'Tipo de Gasto'
when 'I' then 'Artículo'
when 'R' then 'Recurso'
when 'S' then 'Servicio'
end as tipo_producto,
w.m_warehouse_id as id_almacen,
w.name as almacen,
l.m_locator_id as id_ubicacion,
l.name as ubicacion,
a.m_attributeset_id as id_conjunto,
a.description as conjunto_atributo
from m_product p
left outer join m_product_category pc
on p.m_product_category_id = pc.m_product_category_id
join c_uom um
on p.c_uom_id = um.c_uom_id
left outer join m_locator l
on p.m_locator_id = l.m_locator_id
left outer join m_warehouse w
on l.m_warehouse_id = w.m_warehouse_id
left outer join m_attributeset a
on p.m_attributeset_id = a.m_attributeset_id
where p.ad_client_id = 1000001
and p.isactive = 'Y';
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario