财务模块

本文档基于Oracle EBS R12版本测试。所有R12的查询在12.0.4下验证,11i的在11.5.10.1下测试
一、企业采购业务
采购业务是一般企业都会有的业务,主要包括请购、采购、接收、入库、发票、付款几个步骤。分别对应采购、库存、成本、应付以及总账模块。
Oracle是财务业务一体化的系统,只要录入了相应的业务,则会自动生成相应的财务信息。

1、采购接收
采购模块主要功能是帮助业务部门管理采购订单,控制采购流程,审批层次,在请购单、和采购订单录入审批阶段是不产生财务信息的。

现假设企业采购两批原材料,价格50*2=100元。企业当前的银行存款为100元,库存成本为0。

在采购订单接收时,实际上表示物料采购已既成事实,我们将因此产生一笔因采购产生的应计负债,同时记一笔帐到我们的采购接收帐户。
采购接收的会计分录为:
商品采购             DR 100¥
应付帐款-应付暂估 CR 100¥

商品采购和应付帐款-应付暂估都是中转科目,相关科目的余额变化如下:
科目                  初 发生    末
商品采购             0 +100   100¥
应付帐款-应付暂估 0 +100   100¥
入库和创建发票分录后,这两个科目余额将会结平为0。

这里为了更直观显示财务变化境况,而实时计算了各科目的余额,并同时假设所有科目的期初金额为0,这样做的目的仅仅是为了更好理解一些中转科目的余额变化情况,EBS实际业务中科目余额的变动都是要在子模块传送至总账,并过账以后才发生的。

具体的分录产生流程如下:
1) 接收事务处理器
采购接收以后会自动运行“接收事务处理器”。接收事务处理器会在rcv_receiving_sub_ledger中产生采购接收的会计分录。
11i和R12中都会在rcv_receiving_sub_ledger中产生分录,可以通过附件po_rcv_ledger.sql查询 。
这也就是我们“接收事务处理汇总”界面查看到的分录。
2) 传送总账
此时,R12中运行“创建会计科目 - 成本管理”请求,会产生子模块的会计分录,可以通过如下po_rcv_xla_ledger.sql查询 。
再提交“将日记帐分录传送至 GL - 成本管理”请求,则会插入分录信息至总账接口,则可以导入日记账过账。
注意:
11i中,采购接收在总账日记账中的来源是“Purchasing”,类别是“Receiving”;而在R12中,采购接收在总账日记账的来源为“Cost Management”,类别是“Receiving”。

2、交货入库
采购接收以后则可以进一步交货入库。同样会执行“接收事务处理器”,不过这一次做的事情更多,取成本(成本核算方式不同,取成本的逻辑亦不同),插入记录至mtl_material_transactions表等。
此时还不会立刻产生入库的分录,成本管理器运行以后,则会产生库存模块的分录, 将商品采购科目的余额转移至库存成本帐户。
同时,如果采用标准成本,采购价格和入库成本的不同则可能产生PPV(采购价格差异Purchase Price Variance)。假设物料的标准成本为80¥,分录如下:
库存商品成本  DR   80¥
PPV             DR   20¥
商品采购       CR   100¥
相关科目的余额变化如下:
科目            初        发生      末
库存商品成本 0         +80      80¥
PPV            0         +20      20¥
商品采购      100      -100      0¥
中转科目商品采购科目的余额已结平为0。

具体如何查询分录参考如下sql。
1) 子模块
所有的库存物料事务处理(包括采购收货、字库转移、组织间转移、销售发放等等)的会计分录信息都在mtl_transaction_accounts表中,采购收货的分录信息则可以如下查询po_rcv_inv_ledger.sql 。
同时,xla中的分录可以从如下sql查看po_rcv_inv_xla_ledger.sql 。
2) 总账
提交请求“将日记帐分录传送至 GL - 成本管理”,将子模块分录传送至总账。
此时总账将生成来源为je_source=’Cost Management’ and je_category=’Inventory‘的日记账分录。
到这里,东西已经买到并入库计入成本,接下来到付钱了。

3、应付发票
应付发票可以手工录入。与采购有关的发票需要通过匹配采购订单生成应付发票。根据采购项目的税码,会自动或手工产生税行。

如果收到的发票价格与采购价格有差异,还将产生IPV(发票价格差异Invoice Price Variance)。这里我们假设供应商给我们开出发票的价格为80¥,与我们的采购价格产生了20¥的IPV。税码为VAT17。
因此采购匹配的应付发票会计分录为:
应付帐款-应付暂估         DR    100¥
暂估与发票差异(IPV)      DR    -20¥
进项税                       DR     80*0.17¥
应付帐款-发票款           CR     93.6

相关科目的余额变化如下:
科目                         初        发生      余额
应付帐款-应付暂估       100       -100     0¥
暂估与发票差异(IPV)     0          -20      -20¥
进项税                      0          -13.6   -13.6¥(应交税费属于负债类科目)
应付帐款-发票款           0         +93.6    93.6¥
中转科目应付帐款-应付暂估科目的余额已结平为0。同时,由于供应商开出的发票价格为80,存在-20的IPV,因此我们实际的应付账款为80+80*1.17=93.6。

1) 录入发票
AP发票的分配记录了所有应付暂估和预付款核销的科目,再加上应付发票本身的应付账款科目,此时可以如下查询分录ap_inv_ledger.sql 。
2) 创建会计分录
创建会计分录后,会在xla中产生分录信息,可以通过如下sql查询ap_inv_xla_ledger.sql
3) 传送总账
接下来,运行请求”将日记帐分录传送至 GL”,将在总账产生日记账分录。来源为je_source=’ Payables’ and je_category=’Purchase Invoices‘。

4、应付贷项通知单
应付贷项通知单与应付借项通知单与对应应收的概念并不等同,可以参照我之前的<<应收业务与会计分录>>文档。

应付贷项通知单:指供应商开给我们的表示应付减少的通知,负数,冲原始发票,可用0支付结清
应付贷项通知单常用于做采购退货业务,发生采购退货业务后,在应付录入应付贷项通知单,同时匹配退货生成贷项通知单行。

为了更容易理解,我们结合整个退货流程来认识贷项通知单业务。
退货流程:
1) 接收->退货
假设我们交货后发现2批原材料中一批由于某种原因需要退货,通过接收->退货导航录入采购订单,执行退货业务。保存以后触发接收事务处理器,生成如下分录(与采购接收的分录方向恰恰相反):
商品采购             CR    50¥
应付帐款-应付暂估 DR    50¥
冲减商品采购中转科目的余额,同时减少应付暂估中转科目的余额。相关科目的余额变化如下:
科目                   初       发生     余额
商品采购              0        -50      -50¥
应付帐款-应付暂估  0        -50      -50¥
以上分录可以通过前面的po_rcv_ledger.sql和po_rcv_xla_ledger.sql查询。

同时,在成本管理器运行以后,退货产生库存成本变动的分录,如下(与采购接收入库的分录方向恰恰相反):
库存商品成本        CR         40¥
PPV                   CR         10¥
商品采购             DR          50¥
减少库存成本和PPV,增加商品采购,相关科目的余额变化如下:
科目                  初          发生        余额
库存商品成本       80          -40         40¥
PPV                 20           -10         10¥
商品采购           -50          +50         0¥
中转科目商品采购科目的余额已结平为0。
以上分录可以通过前面的po_rcv_inv_ledger.sql 和po_rcv_inv_xla_ledger.sql 查询。

2) 贷项通知单匹配退货
通过应付款发票界面录入类型为贷项通知单的应付发票,然后通过匹配采购退货产生贷项通知单行。
对于采购退货业务的分录如下(与应收发票的分录方向恰恰相反):
应付帐款-应付暂估            CR           50¥
暂估与发票差异(IPV)         CR          -10¥
进项税                          CR            40*0.17¥(应交税费属于负债类科目)
应付帐款-发票款               DR            93.6/2¥
相关科目的余额变化如下:
科目                            初           发生        余额
应付帐款-应付暂估          -50          +50          0¥
暂估与发票差异(IPV)       -20          +10         -10¥
进项税                        -13.6        +6.8        -6.8¥
应付帐款-发票款              93.6       -46.8        46.8¥
中转科目应付帐款-应付暂估科目的余额已结平为0。
这样,退货的最终结果就是使库存成本和应付账款-发票款相应减少。
可以通过上面ap_inv_ledger.sql和ap_inv_xla_ledger.sql查询贷项通知单有关的分录信息。

5、应付借项通知单
借项通知单,指我们自己开出的表示应付减少的通知,同样是负数,冲原始发票,可用0支付结清。
我个人的理解是,应付借项通知单,适用于发票做错后的反冲。功能上它与贷项通知单基本相似。也可用于退货业务。在采购退货界面有是否生成借项通知单的复选框,通过采购系统选项控制是否启用。
付款
发票生成并验证通过以后,可以对发票进行付款。
可以在发票界面通过快速付款,付款界面录入人工付款,或者进行批付款对发票进行批量付款。批付款常应用于员工报销付款。
在付款界面,将蓝票(应付发票)和红票(贷项通知单)选入到同一个付款,先进行核销,再进行付款。

对发票付款,实际上就是用现金支付应付欠款,现金与应付款都减少,由于我们产生过退货业务,因此,产生分录如下:
应付帐款-发票款         DR      46.8¥
银行存款                  CR      46.8¥

相关科目的余额变化如下:
科目                        初       发生          余额
应付帐款-发票款         46.8     -46.8         0¥
银行存款                  100      -46.8         53.2¥

可以看到,经过各个阶段的业务流程,最终形成的分录实际上等效于如下分录,在企业仅上线财务而没上线业务模块的时候,需要手工做如下分录,由此可见,财务业务一体化提供了很大的便捷性:
库存商品成本             DR         40¥
PPV                        DR         10¥
IPV                         DR       -10¥
进项税                      DR        6.8¥
银行存款                   CR         46.8¥

最后,到月底,企业结账,手工做如下两笔分录调整IPV和PPV差异
1)
库存商品成本      DR      10¥
PPV                CR       10¥
2)
库存商品成本     CR       10¥
IPV                DR       10¥
调整后PPV和IPV分别结平为0。

1) 对发票付款
创建会计分录以后,可以通过如下sql查询到分录信息。ap_pay_xla_ledger.sql
2) 传送总账。
接下来,运行请求” 将日记帐分录传送至 GL”,将在总账产生日记账分录。来源为je_source=’ Payables’ and je_category=’ Payments ‘。

二、其他应付业务
其他应付业务,以及部分FA业务。
1、费用报表
费用报表是网上报销模块导入的一种类型的应付发票,当网上报销流程结束并审核通过后,可以通过请求“导入费用报表”导入应付发票。
除了与标准应付发票的科目有所不同。其他作用等同于标准应付发票。企业员工报销的分录通常如下:
员工报销科目          DR
其他应付款-报销      CR
具体如何查询分录信息参考前面标准发票通过ap_inv_ledger.sql和ap_inv_xla_ledger.sql查询。

2、手工应付发票
应付除了用于与采购模块集成外,还可以通过应付发票做些其他的杂项业务。记录些与采购无关的业务。
例如,企业招待客户时,员工张某代为支付客户招待费100元,为了之后偿还该员工供应商张某这100元,可以如下建应付发票:
直接用手工录入发票分配:招待费 100元;并指定负债帐户为:其他应付款。产生分录如下:
招待费             DR     100¥
其他应付款        CR     100¥

未上线网上报销模块时常常如上手工建立应付发票实现员工报销。

具体如何查询分录信息参考前面标准发票通过ap_inv_ledger.sql和ap_inv_xla_ledger.sql查询。

3、应付发票导入固定资产

应付发票可以成批增加为固定资产。有两种方式建立应付发票:
1) 直接定义固定资产型物料,其属性不可库存,并制定它的销售费用科目为固定资产中转科目。
该种类型物料接收、交货通常不会产生会计分录,然后通过应付发票匹配采购订单。这时候,应付发票的分录应为:
DR       固定资产中转
CR       应付帐款  
它的分录信息可以通过上面的ap_inv_ledger.sql和ap_inv_xla_ledger.sql查询。
2) 手工录入应付发票,并指定发票分配科目为固定资产中转科目。它的分录同上(1)。

最后,在应付模块提交请求“创建成批增加”后,则可以在FA模块成批增加资产。最终过账后,会形成如下分录。
DR  固定资产
CR  固定资产中转
固定资产中转科目结清为0.
FA创建会计分录后,有关固定资产的分录信息,可以通过fa_add_derp_ledger.sql查询。

4、预付款发票

预付款发票可以用以核销标准发票,他与标准发票的分录有所不同,不过技术实现上是一样的。它的分录通常是:
DR   预付账款
CR   应付帐款
当核销时,他的分录为
DR   应付账款
CR   预付账款
它的分录信息可以通过上面的ap_inv_ledger.sql和ap_inv_xla_ledger.sql查询。
--应付发票的应付账款贷项
SELECT ai.invoice_num
      ,ai.gl_date
      ,fnd_flex_ext.get_segs('SQLGL'
                            ,'GL#'
                            ,50328
                            ,ai.accts_pay_code_combination_id) acct
      ,xla_oa_functions_pkg.get_ccid_description(50328
                                                ,ai.accts_pay_code_combination_id) acct_desc
      ,0 dr
      ,ai.invoice_amount cr
  FROM ap_invoices_all ai
 WHERE ai.invoice_id = &p_invoice_id
UNION ALL
--由于预付核销产生的应付账款借项
SELECT ai.invoice_num
      ,aid.accounting_date
      ,fnd_flex_ext.get_segs('SQLGL'
                            ,'GL#'
                            ,50328
                            ,ai.accts_pay_code_combination_id) acct
      ,xla_oa_functions_pkg.get_ccid_description(50328
                                                ,ai.accts_pay_code_combination_id) acct_desc
      ,-1 * aid.amount dr
      ,0 cr
  FROM ap_invoices_all ai, ap_invoice_distributions_all aid
 WHERE ai.invoice_id = aid.invoice_id
   AND aid.line_type_lookup_code = 'PREPAY'
   AND ai.invoice_id = &p_invoice_id
UNION ALL
-- 应付发票分配(借项)
SELECT ai.invoice_num
      ,aid.accounting_date
      ,fnd_flex_ext.get_segs('SQLGL'
                            ,'GL#'
                            ,50328
                            ,aid.dist_code_combination_id) acct
      ,xla_oa_functions_pkg.get_ccid_description(50328
                                                ,aid.dist_code_combination_id) acct_desc
      ,aid.amount dr
      ,0 cr
  FROM ap_invoices_all ai, ap_invoice_distributions_all aid
 WHERE ai.invoice_id = aid.invoice_id
   AND ai.invoice_id = &p_invoice_id



SELECT gcc.segment3
      ,fnd_flex_ext.get_segs('SQLGL'
                            ,'GL#'
                            ,50328
                            ,gcc.code_combination_id) acct
      ,xla_oa_functions_pkg.get_ccid_description(50328
                                                ,gcc.code_combination_id) acct_desc
      ,l.accounted_dr
      ,l.accounted_cr
  FROM xla.xla_transaction_entities te
      ,xla_events                   e
      ,xla_ae_headers               h
      ,xla_ae_lines                 l
      ,gl_code_combinations         gcc
 WHERE te.entity_code = 'AP_INVOICES'
   AND te.application_id = 200
   AND te.ledger_id = 2022
   AND nvl(te.source_id_int_1, (-99)) = 106688
   AND te.entity_id = h.entity_id
   AND te.application_id = h.application_id
   AND e.event_id = h.event_id
   AND e.application_id = h.application_id
   AND h.ae_header_id = l.ae_header_id
   AND h.application_id = l.application_id
   AND l.code_combination_id = gcc.code_combination_id;



SELECT h.accounting_date
      ,fnd_flex_ext.get_segs('SQLGL'
                            ,'GL#'
                            ,50328
                            ,gcc.code_combination_id) acct
      ,xla_oa_functions_pkg.get_ccid_description(50328
                                                ,gcc.code_combination_id) acct_desc
      ,l.accounted_dr
      ,l.accounted_cr
  FROM xla.xla_transaction_entities te
      ,xla_events                   e
      ,xla_ae_headers               h
      ,xla_ae_lines                 l
      ,gl_code_combinations         gcc
 WHERE te.entity_code = 'AP_PAYMENTS'
   AND te.application_id = 200
   AND te.ledger_id = 2022
   AND nvl(te.source_id_int_1, (-99)) = 55638
   AND te.entity_id = h.entity_id
   AND te.application_id = h.application_id
   AND e.event_id = h.event_id
   AND e.application_id = h.application_id
   AND h.ae_header_id = l.ae_header_id
   AND h.application_id = l.application_id
   AND l.code_combination_id = gcc.code_combination_id;



--事务处理
SELECT fa.asset_number
      ,fth.transaction_type_code
      ,h.period_name
      ,fnd_flex_ext.get_segs('SQLGL'
                            ,'GL#'
                            ,50328
                            ,gcc.code_combination_id) acct
      ,xla_oa_functions_pkg.get_ccid_description(50328
                                                ,gcc.code_combination_id) acct_desc
      ,l.accounted_dr
      ,l.accounted_cr
  FROM xla.xla_transaction_entities te
      ,xla_events                   e
      ,xla_ae_headers               h
      ,xla_ae_lines                 l
      ,gl_code_combinations         gcc
      ,fa_transaction_headers       fth
      ,fa_additions                 fa
 WHERE te.entity_code = 'TRANSACTIONS'
   AND te.application_id = 140
   AND te.ledger_id = 2022
   AND nvl(te.source_id_int_1, (-99)) = fth.transaction_header_id
   AND fth.asset_id = fa.asset_id
   AND te.entity_id = h.entity_id
   AND te.application_id = h.application_id
   AND e.event_id = h.event_id
   AND e.application_id = h.application_id
   AND h.ae_header_id = l.ae_header_id
   AND h.application_id = l.application_id
   AND l.code_combination_id = gcc.code_combination_id
      --
   AND fa.asset_number = '&p_asset_number'
UNION ALL
-- 折旧
SELECT fa.asset_number
      ,te.entity_code
      ,h.period_name
      ,fnd_flex_ext.get_segs('SQLGL'
                            ,'GL#'
                            ,50328
                            ,gcc.code_combination_id) acct
      ,xla_oa_functions_pkg.get_ccid_description(50328
                                                ,gcc.code_combination_id) acct_desc
      ,l.accounted_dr
      ,l.accounted_cr
  FROM xla.xla_transaction_entities te
      ,xla_events                   e
      ,xla_ae_headers               h
      ,xla_ae_lines                 l
      ,gl_code_combinations         gcc
      ,fa_additions                 fa
 WHERE te.entity_code = 'DEPRECIATION'
   AND te.application_id = 140
   AND te.ledger_id = 2022
   AND nvl(te.source_id_int_1, (-99)) = fa.asset_id
   AND te.entity_id = h.entity_id
   AND te.application_id = h.application_id
   AND e.event_id = h.event_id
   AND e.application_id = h.application_id
   AND h.ae_header_id = l.ae_header_id
   AND h.application_id = l.application_id
   AND l.code_combination_id = gcc.code_combination_id
      --
   AND fa.asset_number = '&p_asset_number';


SELECT fnd_flex_ext.get_segs('SQLGL', 'GL#', 50328, mta.reference_account) acct
      ,xla_oa_functions_pkg.get_ccid_description(50328
                                                ,mta.reference_account) acct_desc
      ,mtst.transaction_source_type_name
      ,mtt.transaction_type_name
      ,mta.transaction_date
      ,decode(sign(mta.transaction_value)
             ,1
             ,mta.transaction_value
             ,0
             ,decode(sign(mta.base_transaction_value)
                    ,1
                    ,0
                    ,0
                    ,decode(sign(mta.primary_quantity), 1, 0, 0, 0, NULL)
                    ,NULL)
             ,NULL
             ,decode(sign(mta.base_transaction_value)
                    ,1
                    ,mta.base_transaction_value
                    ,0
                    ,decode(sign(mta.primary_quantity), 1, 0, 0, 0, NULL)
                    ,NULL)
             ,NULL) entered_dr
      ,decode(sign(mta.transaction_value)
             ,-1
             ,(-1 * mta.transaction_value)
             ,0
             ,decode(sign(mta.base_transaction_value)
                    ,-1
                    ,0
                    ,0
                    ,decode(sign(mta.primary_quantity), -1, 0, NULL)
                    ,NULL)
             ,NULL
             ,decode(sign(mta.base_transaction_value)
                    ,-1
                    ,(-1 * mta.base_transaction_value)
                    ,0
                    ,decode(sign(mta.primary_quantity), -1, 0, NULL)
                    ,NULL)
             ,NULL) entered_cr
      ,mmt.subinventory_code
  FROM mtl_transaction_accounts  mta
      ,mtl_material_transactions mmt
      ,mtl_transaction_types     mtt
      ,mtl_txn_source_types      mtst
      ,mtl_system_items_vl       msi
 WHERE mmt.organization_id = mta.organization_id
   AND mmt.transaction_id = mta.transaction_id
   AND mtt.transaction_type_id = mmt.transaction_type_id
   AND mtst.transaction_source_type_id = mmt.transaction_source_type_id
   AND msi.inventory_item_id = mmt.inventory_item_id
   AND msi.organization_id = mmt.organization_id
   AND mtst.transaction_source_type_name = '采购订单'
   AND mmt.transaction_source_id = 2035;



SELECT h.event_type_code
      ,l.accounting_class_code
      ,h.accounting_date
      ,l.entered_dr
      ,l.entered_cr
      ,xla_oa_functions_pkg.get_ccid_description(50328
                                                ,l.code_combination_id) descr
      ,ph.segment1 po_number
  FROM xla_ae_headers               h
      ,xla_ae_lines                 l
      ,xla_events                   e
      ,xla.xla_transaction_entities te
      ,mtl_material_transactions    mmt
      ,po_headers_all               ph
 WHERE h.application_id = l.application_id
   AND h.ae_header_id = l.ae_header_id
   AND h.application_id = e.application_id
   AND h.event_id = e.event_id
   AND h.application_id = te.application_id
   AND h.entity_id = te.entity_id
   AND nvl(te.source_id_int_1, -99) = mmt.transaction_id
   AND mmt.transaction_source_id = ph.po_header_id
   AND te.application_id = 707
   AND te.ledger_id = 2022
   AND te.entity_code = 'MTL_ACCOUNTING_EVENTS'
   AND nvl(te.source_id_int_1, -99) = 5050414; -- 采购入库的mmt id



SELECT poh.segment1
      ,poh.po_header_id
      ,rct.transaction_id
      ,rct.transaction_type
      ,rsh.shipment_header_id
      ,rsl.shipment_line_id
      ,rrs.je_category_name
      ,rrs.period_name
      ,rct.quantity
      ,fnd_flex_ext.get_segs('SQLGL'
                            ,'GL#'
                            ,50328
                            ,rrs.code_combination_id) acct
      ,xla_oa_functions_pkg.get_ccid_description(50328
                                                ,rrs.code_combination_id) acct_desc
      ,rrs.entered_dr
      ,rrs.entered_cr
  FROM po_headers_all           poh
      ,po_lines_all             pol
      ,po_releases_all          pr
      ,po_line_locations_all    pll
      ,po_distributions_all     pod
      ,rcv_receiving_sub_ledger rrs
       --
      ,rcv_transactions             rct
      ,rcv_shipment_headers         rsh
      ,rcv_shipment_lines           rsl
      ,org_organization_definitions ood
 WHERE 1 = 1
      -- PO 
   AND poh.po_header_id = pol.po_header_id
   AND pol.po_line_id = pll.po_line_id
   AND pll.po_release_id = pr.po_release_id(+)
   AND pll.line_location_id = pod.line_location_id
      -- PO to Rcv
   AND to_char(pod.po_distribution_id) = rrs.reference3
   AND rrs.rcv_transaction_id = rct.transaction_id
   AND rct.shipment_header_id = rsh.shipment_header_id
   AND rct.shipment_line_id = rsl.shipment_line_id
      --
   AND rct.organization_id = ood.organization_id
   AND ood.set_of_books_id = rrs.set_of_books_id
   AND poh.segment1 = '2008000355'



SELECT te.entity_code
      ,te.application_id
      ,gcc.segment3
      ,fnd_flex_ext.get_segs('SQLGL'
                            ,'GL#'
                            ,50328
                            ,gcc.code_combination_id) acct
      ,xla_oa_functions_pkg.get_ccid_description(50328
                                                ,gcc.code_combination_id) acct_desc
      ,l.accounted_dr
      ,l.accounted_cr
  FROM xla.xla_transaction_entities te
      ,xla_events                   e
      ,xla_ae_headers               h
      ,xla_ae_lines                 l
      ,gl_code_combinations         gcc
      ,rcv_transactions             rct
      ,po_headers_all               poh
 WHERE te.entity_code = 'RCV_ACCOUNTING_EVENTS'
   AND te.application_id = 707
   AND te.ledger_id = 2022
   AND nvl(te.source_id_int_1, (-99)) = rct.transaction_id
   AND te.entity_id = h.entity_id
   AND te.application_id = h.application_id
   AND e.event_id = h.event_id
   AND e.application_id = h.application_id
   AND h.ae_header_id = l.ae_header_id
   AND h.application_id = l.application_id
   AND l.code_combination_id = gcc.code_combination_id
   AND rct.po_header_id = poh.po_header_id
   AND poh.segment1 = '2008000762';


原文地址:https://www.cnblogs.com/wanghang/p/6299311.html