Архив

Публикации с меткой ‘организации’

Модуль ONT — Связь в заказах между складской и операционной организацией

18 Август 2010 Нет комментариев
select h.order_number,
       -- операционная единица
       h.org_id                 as operate_org_id,
       -- складская организация
       pla.organization_id      as inventory_org_id,
       l.header_id,
       l.line_id,
       l.ordered_quantity       as qty,
       l.request_date
       --
  from oe_order_headers_all         h,
       oe_order_lines_all           l,
       po_location_associations_all pla,
       mtl_system_items_b           msi
 where 1=1
       and h.header_id = l.header_id
       and h.sold_to_org_id = pla.customer_id
       -- msi
       and msi.inventory_item_id  = l.inventory_item_id
       and msi.organization_id    = pla.organization_id;

Список организаций

Select t.organization_id     as org_id,
       mpv.organization_code as org_code,
       t.name                as org_name
From hr.hr_all_organization_units t,
     mtl_parameters_view mpv
where mpv.organization_id = t.organization_id
order by t.organization_id, mpv.organization_code