总账库存科目明细追溯

/* Formatted on 2018/3/15 10:04:03 (QP5 v5.256.13226.35538) */

  SELECT xel.subinventory_code 子库

       , DECODE (xel.lot_number, '', '来源,非库存') 批次

       --       , cux_public_pkg.get_item_segment1 (81, xeh.inventory_item_id) 物料编码

       --       , cux_public_pkg.get_item_description (81, xeh.inventory_item_id) 物料品名

       , xeh.transaction_uom 单位

       , SUM (xdl.unrounded_entered_dr) 借方金额

       , SUM (xdl.unrounded_entered_cr) 贷方金额

    FROM xla_ae_headers ah

       , xla_ae_lines al

       , xla_distribution_links xdl

       , gmf_xla_extract_headers xeh

       , gmf_xla_extract_lines xel

   WHERE 1 = 1

     AND ah.ae_header_id = al.ae_header_id                                                                              

     --AND AH.APPLICATION_ID = 555

     AND ah.period_name = '2012-03'

     AND al.code_combination_id = (SELECT k.code_combination_id

                                     FROM gl_code_combinations_kfv k

                                    WHERE k.concatenated_segments = '10.0.141103.0.0.0.0')

     AND al.ae_header_id = xdl.ae_header_id

     AND al.ae_line_num = xdl.ae_line_num

     AND al.application_id = xdl.application_id

     AND xdl.source_distribution_id_num_1 = xel.line_id(+)

     AND xel.header_id = xeh.header_id(+)

GROUP BY xel.subinventory_code

       , xel.lot_number

       , xeh.inventory_item_id

       , xeh.transaction_uom

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值