PAC工单科目金额明细

SELECT we.wip_entity_name,
        1 transaction_type_id,
        WT.TRANSACTION_QUANTITY,
         wt.transaction_date,
         fnd_flex_ext.get_segs('SQLGL',
                               'GL#',
                               cgacd.chart_of_accounts_id,
                               cal.code_combination_id) cc_code,
                               
         xla_oa_functions_pkg.get_ccid_description(cgacd.chart_of_accounts_id,
                                                   cal.code_combination_id) cc_desc,
         cal.accounted_dr,
         cal.accounted_cr
    FROM cst_ae_headers            cah,
         cst_ae_lines              cal,
         cux_gl_account_code_desc  cgacd,
         HR_ALL_ORGANIZATION_UNITS HAOU,
         wip_transactions          wt,
         WIP_ENTITIES              WE
   WHERE 1 = 1
     and cah.organization_id = HAOU.Organization_Id
   --  and cah.gl_transfer_flag = 'Y'
     AND cah.ae_header_id = cal.ae_header_id
     AND cal.code_combination_id = cgacd.code_combination_id
     and cah.ae_category = 'WIP' -- <> 'Accrual' ---Accrual在GL中将被冲销/* MTL,      WIP,      Receiving*/            
     and cah.organization_id = wt.organization_id
     and cal.source_id = wt.transaction_id
     and we.wip_entity_name = 'WI-2310003'
     and cah.set_of_books_id = 2023
     AND WT.WIP_ENTITY_ID = WE.WIP_ENTITY_ID
     AND WT.ORGANIZATION_ID = WE.ORGANIZATION_ID
    -- AND cgacd.segment3 = '5002'
    -- AND cgacd.segment4= '1001'
   --  and cah.period_name <= '2022-01'
  union all
  SELECT we.wip_entity_name,
  mmt.transaction_type_id,
  MMT.TRANSACTION_QUANTITY,
         mmt.transaction_date,
         fnd_flex_ext.get_segs('SQLGL',
                               'GL#',
                               cgacd.chart_of_accounts_id,
                               cal.code_combination_id) cc_code,
                               
         xla_oa_functions_pkg.get_ccid_description(cgacd.chart_of_accounts_id,
                                                   cal.code_combination_id) cc_desc,
         cal.accounted_dr,
         cal.accounted_cr
  
    FROM cst_ae_headers            cah,
         cst_ae_lines              cal,
         cux_gl_account_code_desc  cgacd,
         HR_ALL_ORGANIZATION_UNITS HAOU,
         mtl_material_transactions mmt,
         WIP_ENTITIES              WE
   WHERE 1 = 1
     and cah.organization_id = HAOU.Organization_Id
    -- and cah.gl_transfer_flag = 'Y'
     AND cah.ae_header_id = cal.ae_header_id
     AND cal.code_combination_id = cgacd.code_combination_id
     and cah.ae_category = 'MTL' -- <> 'Accrual' ---Accrual在GL中将被冲销/* MTL,      WIP,      Receiving*/            
     and cah.organization_id = mmt.organization_id
     AND MMT.TRANSACTION_SOURCE_TYPE_ID = 5
     AND MMT.TRANSACTION_SOURCE_ID = WE.WIP_ENTITY_ID
     AND MMT.ORGANIZATION_ID = WE.ORGANIZATION_ID
     and cal.source_id = mmt.transaction_id
     --   and cgacd.segment3 = '5002'
     and cah.set_of_books_id = 2023
    --  AND cgacd.segment4= '1001'
     -- and cah.period_name <= '2022-01'
     and we.wip_entity_name = 'WI-2310003'
 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值