有BOM且有采购自制件

select 
pha.segment1 po_num,
pha.creation_date,
pla.line_num,
msi.segment1 main_item,
msi.description main_desc,
pla.unit_price,
pha.currency_code,
nvl(pha.rate,'1') rate,
pla.unit_meas_lookup_code  uom_code,
pv.vendor_name
from
  po.po_lines_all pla,
  po.po_headers_all pha,
  inv.mtl_system_items msi,
  po.po_vendors pv
where
pla.org_id=pha.org_id
and pla.po_header_id=pha.po_header_id
and pha.org_id=msi.organization_id
and pla.item_id=msi.inventory_item_id
and pv.vendor_id=pha.vendor_id
and msi.organization_id=255
and msi.planning_make_buy_code=1
and pha.org_id=255
and nvl(pha.approved_flag,'N')='Y'
and pha.type_lookup_code='STANDARD'
and nvl(pHa.CANCEL_FLAG,'N')='N'
and nvl(pla.CANCEL_FLAG,'N')='N'
and exists (select 1 from
  bom.bom_bill_of_materials bom,
  bom.bom_inventory_components bic
  where bom.common_bill_sequence_id=bic.bill_sequence_id
  and  bom.organization_id=255
  and  pla.item_id=bom.assembly_item_id
  and bic.implementation_date is not null
  and nvl(bic.disable_date,sysdate+1)>sysdate
  and nvl(bic.effectivity_date,sysdate)<=sysdate)

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12122734/viewspace-462708/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/12122734/viewspace-462708/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值