Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1851187
  • 博文数量: 334
  • 博客积分: 11301
  • 博客等级: 上将
  • 技术积分: 3452
  • 用 户 组: 普通用户
  • 注册时间: 2006-10-18 10:19
个人简介

路虽弥,不行不至;事虽少,不做不成。

文章分类

全部博文(334)

文章存档

2013年(4)

2012年(19)

2011年(27)

2010年(71)

2009年(45)

2008年(15)

2007年(84)

2006年(69)

分类: Oracle

2012-06-16 16:42:55

 
/*Create by Richard.Liu on 2012-06-12  for XXXX Company */
/*FOR DEPRN in XDL:
            source_distribution_id_num_1 as asset_id,
            source_distribution_id_num_2 as period_counter,
            source_distribution_id_num_5 as distribution_id in fa_distribution_accounts  */
SELECT UNIQUE xte.source_id_char_1 book_type_code,
       xah.period_name,
       fab.tag_number,
       gcc.segment4        account,
       xal.ae_line_num,
       xal.entered_dr,
       xal.entered_cr,
       xal.accounted_dr,
       xal.accounted_cr,
       xal.description,
       xte.entity_code,
       xah.event_type_code
  FROM xla_transaction_entities xte,
       xla_distribution_links   xdl,
       xla_ae_headers           xah,
       xla_ae_lines             xal,
       xla_events               xe,
       fa_books                 fb,
       fa_additions_b           fab,
       gl_code_combinations     gcc
 WHERE xah.ae_header_id = xal.ae_header_id
   AND xah.application_id = xal.application_id
   AND xdl.application_id = xah.application_id
   AND xdl.ae_header_id = xah.ae_header_id
   AND xdl.ae_line_num = xal.ae_line_num
   AND xah.application_id = xe.application_id
   AND xah.event_id = xe.event_id
   AND xe.event_id = xdl.event_id
   AND xah.application_id = xte.application_id
   AND xal.code_combination_id = gcc.code_combination_id
   AND xah.entity_id = xte.entity_id
   AND xe.application_id = 140
   AND xah.Ledger_Id = '&Ledger_Id'
   AND xah.event_type_code = 'DEPRECIATION'
   AND fb.book_type_code = xte.source_id_char_1
   AND fb.book_type_code = UPPER('&book_type_code')
   AND xte.source_id_int_1 = fb.asset_id
   AND fb.asset_id = fab.asset_id
   AND fab.tag_number = '&tag_number'
UNION ALL
 /*For Transaction IN XDL:
          source_distribution_id_num_1 as transaction_id in FA_TRANSACTION_HEADERS*/
SELECT UNIQUE xte.source_id_char_1 book_type_code,
       xah.period_name,
       fab.tag_number,
       gcc.segment4,
       xal.ae_line_num,
       xal.entered_dr,
       xal.entered_cr,
       xal.accounted_dr,
       xal.accounted_cr,
       xal.description,
       xte.entity_code,
       xah.event_type_code
  FROM xla_transaction_entities xte,
       xla_distribution_links   xdl,
       xla_ae_headers           xah,
       xla_ae_lines             xal,
       xla_events               xe,
       fa_books                 fb,
       fa_additions_b           fab,
       fa_transaction_headers   fth,
       gl_code_combinations     gcc
 WHERE xah.ae_header_id = xal.ae_header_id
   AND xah.application_id = xal.application_id
   AND xdl.application_id = xah.application_id
   AND xdl.ae_header_id = xah.ae_header_id
   AND xdl.ae_line_num = xal.ae_line_num
   AND xah.application_id = xe.application_id
   AND xah.event_id = xe.event_id
   AND xah.application_id = xte.application_id
   AND xah.entity_id = xte.entity_id
   AND xal.code_combination_id = gcc.code_combination_id
   AND xe.application_id = 140
   AND xah.Ledger_Id = '&Ledger_Id'
   AND xah.event_type_code != 'DEPRECIATION'
   AND fb.book_type_code = xte.source_id_char_1
   AND fb.book_type_code = UPPER('&book_type_code')
   AND fb.book_type_code = fth.book_type_code
   AND fab.asset_id = fth.asset_id
   AND xte.source_id_int_1 = fth.transaction_header_id
   AND fb.asset_id = fab.asset_id
   AND fab.tag_number = '&tag_number'
 ORDER BY 12
 
/////////////////////////////////////////////////////////////////////////////////////
/*Create by Richard.Liu on 2012-06-12  for XXXX Company */
__***********************************************************************************
--*********** All reverse line has been removal**************************************
--***********************************************************************************
/*FOR DEPRN in XDL:
            source_distribution_id_num_1 as asset_id,
            source_distribution_id_num_2 as period_counter,
            source_distribution_id_num_5 as distribution_id in fa_distribution_accounts
  For DEPRN IN XDL:
          source_distribution_type='DEPRN' */
SELECT UNIQUE              xte.source_id_char_1 book_type_code,
       xah.period_name,
       fab.tag_number,
       gcc.segment4        account,
       xal.ae_line_num,
       xal.entered_dr,
       xal.entered_cr,
       xal.accounted_dr,
       xal.accounted_cr,
       xal.description,
       xte.entity_code,
       xah.event_type_code
  FROM xla_transaction_entities xte,
       xla_distribution_links   xdl,
       xla_ae_headers           xah,
       xla_ae_lines             xal,
       xla_events               xe,
       fa_books                 fb,
       fa_additions_b           fab,
       gl_code_combinations     gcc
 WHERE xah.ae_header_id = xal.ae_header_id
   AND xah.application_id = xal.application_id
   AND xdl.application_id = xah.application_id
   AND xdl.ae_header_id = xah.ae_header_id
   AND xdl.ae_line_num = xal.ae_line_num
   AND xah.application_id = xe.application_id
   AND xah.event_id = xe.event_id
   AND xe.event_id = xdl.event_id
   AND xah.application_id = xte.application_id
   AND xal.code_combination_id = gcc.code_combination_id
   AND xah.entity_id = xte.entity_id
   AND xe.application_id = 140
   AND xah.Ledger_Id = '&Ledger_Id'
   AND xah.event_type_code IN ('DEPRECIATION', 'ROLLBACK_DEPRECIATION')
   AND fb.book_type_code = xte.source_id_char_1
   AND fb.book_type_code = UPPER('&book_type_code')
   AND xte.source_id_int_1 = fb.asset_id
   AND fb.asset_id = fab.asset_id
   AND fab.tag_number = '&tag_number'
   AND NOT EXISTS
 (SELECT 'T'
          FROM xla_transaction_entities xte,
               xla_distribution_links   xdl2,
               xla_ae_headers           xah,
               xla_ae_lines             xal,
               xla_events               xe,
               fa_books                 fb,
               fa_additions_b           fab,
               gl_code_combinations     gcc
         WHERE xah.ae_header_id = xal.ae_header_id
           AND xah.application_id = xal.application_id
           AND xdl2.application_id = xah.application_id
           AND xdl2.ae_header_id = xah.ae_header_id
           AND xdl2.ae_line_num = xal.ae_line_num
           AND xah.application_id = xe.application_id
           AND xah.event_id = xe.event_id
           AND xe.event_id = xdl2.event_id
           AND xah.application_id = xte.application_id
           AND xal.code_combination_id = gcc.code_combination_id
           AND xah.entity_id = xte.entity_id
           AND xe.application_id = 140
           AND xah.Ledger_Id = '&Ledger_Id'
           AND xah.event_type_code IN
               ('DEPRECIATION', 'ROLLBACK_DEPRECIATION')
           AND fb.book_type_code = xte.source_id_char_1
           AND fb.book_type_code = UPPER('&book_type_code')
           AND xte.source_id_int_1 = fb.asset_id
           AND fb.asset_id = fab.asset_id
           AND fab.tag_number = '&tag_number'
           AND XDL.EVENT_ID = XDL2.REF_EVENT_ID --****
           )
INTERSECT
SELECT UNIQUE              xte.source_id_char_1 book_type_code,
       xah.period_name,
       fab.tag_number,
       gcc.segment4        account,
       xal.ae_line_num,
       xal.entered_dr,
       xal.entered_cr,
       xal.accounted_dr,
       xal.accounted_cr,
       xal.description,
       xte.entity_code,
       xah.event_type_code
  FROM xla_transaction_entities xte,
       xla_distribution_links   xdl,
       xla_ae_headers           xah,
       xla_ae_lines             xal,
       xla_events               xe,
       fa_books                 fb,
       fa_additions_b           fab,
       gl_code_combinations     gcc
 WHERE xah.ae_header_id = xal.ae_header_id
   AND xah.application_id = xal.application_id
   AND xdl.application_id = xah.application_id
   AND xdl.ae_header_id = xah.ae_header_id
   AND xdl.ae_line_num = xal.ae_line_num
   AND xah.application_id = xe.application_id
   AND xah.event_id = xe.event_id
   AND xe.event_id = xdl.event_id
   AND xah.application_id = xte.application_id
   AND xal.code_combination_id = gcc.code_combination_id
   AND xah.entity_id = xte.entity_id
   AND xe.application_id = 140
   AND xah.Ledger_Id = '&Ledger_Id'
   AND xah.event_type_code IN ('DEPRECIATION', 'ROLLBACK_DEPRECIATION')
   AND fb.book_type_code = xte.source_id_char_1
   AND fb.book_type_code = UPPER('&book_type_code')
   AND xte.source_id_int_1 = fb.asset_id
   AND fb.asset_id = fab.asset_id
   AND fab.tag_number = '&tag_number'
   AND NOT EXISTS
 (SELECT 'T'
          FROM xla_transaction_entities xte,
               xla_distribution_links   xdl2,
               xla_ae_headers           xah,
               xla_ae_lines             xal,
               xla_events               xe,
               fa_books                 fb,
               fa_additions_b           fab,
               gl_code_combinations     gcc
         WHERE xah.ae_header_id = xal.ae_header_id
           AND xah.application_id = xal.application_id
           AND xdl2.application_id = xah.application_id
           AND xdl2.ae_header_id = xah.ae_header_id
           AND xdl2.ae_line_num = xal.ae_line_num
           AND xah.application_id = xe.application_id
           AND xah.event_id = xe.event_id
           AND xe.event_id = xdl2.event_id
           AND xah.application_id = xte.application_id
           AND xal.code_combination_id = gcc.code_combination_id
           AND xah.entity_id = xte.entity_id
           AND xe.application_id = 140
           AND xah.Ledger_Id = '&Ledger_Id'
           AND xah.event_type_code IN
               ('DEPRECIATION', 'ROLLBACK_DEPRECIATION')
           AND fb.book_type_code = xte.source_id_char_1
           AND fb.book_type_code = UPPER('&book_type_code')
           AND xte.source_id_int_1 = fb.asset_id
           AND fb.asset_id = fab.asset_id
           AND fab.tag_number = '&tag_number'
           AND XDL2.EVENT_ID = XDL.REF_EVENT_ID --****
           )
UNION ALL
/*For Transaction IN XDL:
       source_distribution_id_num_1 as transaction_id in FA_TRANSACTION_HEADERS
For Transaction IN XDL:
       source_distribution_type='TRX'*/
SELECT UNIQUE xte.source_id_char_1 book_type_code,
       xah.period_name,
       fab.tag_number,
       gcc.segment4,
       xal.ae_line_num,
       xal.entered_dr,
       xal.entered_cr,
       xal.accounted_dr,
       xal.accounted_cr,
       xal.description,
       xte.entity_code,
       xah.event_type_code
  FROM xla_transaction_entities xte,
       xla_distribution_links   xdl,
       xla_ae_headers           xah,
       xla_ae_lines             xal,
       xla_events               xe,
       fa_books                 fb,
       fa_additions_b           fab,
       fa_transaction_headers   fth,
       gl_code_combinations     gcc
 WHERE xah.ae_header_id = xal.ae_header_id
   AND xah.application_id = xal.application_id
   AND xdl.application_id = xah.application_id
   AND xdl.ae_header_id = xah.ae_header_id
   AND xdl.ae_line_num = xal.ae_line_num
   AND xah.application_id = xe.application_id
   AND xah.event_id = xe.event_id
   AND xah.application_id = xte.application_id
   AND xah.entity_id = xte.entity_id
   AND xal.code_combination_id = gcc.code_combination_id
   AND xe.application_id = 140
   AND xah.Ledger_Id = '&Ledger_Id'
   AND xah.event_type_code NOT IN ('DEPRECIATION', 'ROLLBACK_DEPRECIATION')
   AND fb.book_type_code = xte.source_id_char_1
   AND fb.book_type_code = UPPER('&book_type_code')
   AND fb.book_type_code = fth.book_type_code
   AND fab.asset_id = fth.asset_id
   AND xte.source_id_int_1 = fth.transaction_header_id
   AND fb.asset_id = fab.asset_id
   AND fab.tag_number = '&tag_number'
 ORDER BY 12
阅读(5178) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

最大行业软件2012-11-16 09:33:38

Oasys.Pile.V19.0
Oasys.Pilset.V19.1
Oasys.Safe.V19
Oasys.Slope.V19
Oasys.Xdisp.V19

Plaxis V8.5
Plaxis 3D Foundation V1.6
PLAXIS_3D_TUNNEL_V1.2
Plaxis.2D.V9.02.612
UDEC31 岩土分析软件
Z_soil2D V6.13 岩土分析软件
代尔夫特(DELFT)岩土所计算软件
DIGITAL_CANAL系列软件
LEAP_SOFTWARE_PRESTO_V8.6.1
LEAP_SOFTWARE_RC_PIER_V4.01桥梁工程软件
LEAP_SOFTWARe_LEAP_BRIDGE_V6.0
LEAP_SOFTWARE系列软件
SAM-LEAP5.V5.10D 桥梁设计