AP期间例外检查脚本之一(其它例外)

SELECT xte.ledger_id           ledger_id
      ,xte.source_id_int_1     source_id_int_1
      ,xte.security_id_int_1   security_id_int_1
      ,xte.entity_code         entity_code
      ,xte.legal_entity_id     legal_entity_id
      ,xle.event_status_code   event_status_code
      ,xle.process_status_code process_status_code
      ,xle.event_id
      ,xle.application_id      application_id
      ,xle.event_id            event_id
      ,xle.event_number        event_number
      ,xle.on_hold_flag        on_hold_flag
      ,xle.event_type_code     event_type_code
      ,xle.event_date          event_date
      ,xte.transaction_number  transaction_number
      ,xle.last_update_date    last_update_date
      ,xle.creation_date       creation_date
      ,xle.transaction_date    transaction_date

  FROM xla_events               xle
      ,xla_transaction_entities xte
      ,xla_ledger_options       xlo
 WHERE xle.entity_id = xte.entity_id
   AND xle.application_id = xte.application_id
   --选择期间
   AND xle.event_date BETWEEN p_start_date AND p_end_date
   AND xle.application_id = 200
   AND xle.event_status_code IN ('I', 'U')
   AND xle.process_status_code IN ('I', 'U', 'R', 'D', 'E')
   AND xle.application_id = xlo.application_id
   AND xlo.capture_event_flag = 'Y'
   AND EXISTS (SELECT 1
          FROM gl_ledger_relationships glr1
              ,gl_ledger_relationships glr2
         WHERE glr1.target_ledger_id = xlo.ledger_id
           --选择帐套
           AND glr2.target_ledger_id = p_ledger_id
           AND glr2.source_ledger_id = glr1.source_ledger_id
           AND glr2.application_id = glr1.application_id
           AND (glr1.target_ledger_id = xte.ledger_id OR
               glr1.primary_ledger_id = xte.ledger_id)
           AND (glr1.relationship_type_code = 'SUBLEDGER' OR
               (glr1.target_ledger_category_code = 'PRIMARY' AND
               glr1.relationship_type_code = 'NONE'))
           AND glr2.application_id = 101)
   AND xte.application_id = 200;

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

转载于:http://blog.itpub.net/10359218/viewspace-754412/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值