WIP->离散->离散任务
任务Kevin13这张工单的所有组件的信息:
select msi.segment1,
msi.description,
wdj.class_code,
wdj.status_type,
wdj.start_quantity,
wdj.net_quantity,
wdj.quantity_completed,
wdj.quantity_scrapped,
wdj.scheduled_start_date,
wdj.scheduled_completion_date,
wro.operation_seq_num,
dept.department_code,
wro.date_required,
msi1.segment1,
msi1.description,
wro.required_quantity,
wro.quantity_issued,
(wro.required_quantity - wro.quantity_issued) quantity_open
from wip_discrete_jobs wdj,
wip_entities we,
mtl_system_items_b msi,
wip_requirement_operations wro,
mtl_system_items_b msi1,
bom_departments dept
where wdj.wip_entity_id = we.wip_entity_id
and wdj.primary_item_id = msi.inventory_item_id
and wdj.organization_id = msi.organization_id
and wdj.wip_entity_id = wro.wip_entity_id
and wro.inventory_item_id = msi1.inventory_item_id
and wro.organization_id = msi1.organization_id
and wro.department_id = dept.department_id
and wro.organization_id = 103
and wdj.organization_id = 103
and we.wip_entity_name = 'kevin13';
现有量要关联mtl_onhand_quantities或mtl_onhand_quantities_detail。
这个表是不包括在途之类的库存的。
如需包括在途量等等类似的库存量,最好是用API去计算。