Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1851330
  • 博文数量: 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

2009-06-17 12:36:34

--  =============================================================================================
--  Trx_Number  ||   Customer_trx_id  | Payment_Schedule_id | Receivable_application_id | Type  |
--  =============================================================================================
--   747693(A)  ||    2615786         |   1618821           |    2512596                |  CM   |
--   747719(B)  ||    2615899         |   1618822           |    2512597                |  CM   |
--   747584(B)  ||    2615657         |   1618397           |                           |  INV  |
--   747561(A)  ||    2615629         |   1618365           |                           |  INV  |
--  =============================================================================================
-- Step1: Datafix AR invoice line
update ar.ra_customer_trx_lines_all
set extended_amount=-1010.26,
    revenue_amount=-1010.26
where customer_trx_id=2615899
  and line_type='LINE';
 
update ar.ra_customer_trx_lines_all
set extended_amount=-4117.95,
    revenue_amount=-4117.95
where customer_trx_id=2615786
  and line_type='LINE';  
 
-- Step2: Datafix AR invoice distribution line
alter trigger RA_CUST_TRX_LINE_GL_DIST_BRI disable;
 
update ar.ra_cust_trx_line_gl_dist_all
set amount=-4818,
    acctd_amount=-4818
where cust_trx_line_gl_dist_id=8149393
update ar.ra_cust_trx_line_gl_dist_all
set amount=-4117.95,
    acctd_amount=-4117.95
where cust_trx_line_gl_dist_id=8149395

update ar.ra_cust_trx_line_gl_dist_all
set amount=-1182,
    acctd_amount=-1182
where cust_trx_line_gl_dist_id=8149709
update ar.ra_cust_trx_line_gl_dist_all
set amount=-1010.26,
    acctd_amount=-1010.26
where cust_trx_line_gl_dist_id=8149711
alter trigger RA_CUST_TRX_LINE_GL_DIST_BRI enable;
-- Step3: Datafix AR Balance
update ar.ar_payment_schedules_all
set amount_credited=amount_credited+700.05,
    amount_due_remaining=amount_due_remaining+700.05
where customer_trx_id=2615629
update ar.ar_payment_schedules_all
set amount_credited=amount_credited+171.74,
    amount_due_remaining=amount_due_remaining+171.74
where customer_trx_id=2615657
update ar.ar_payment_schedules_all
set amount_due_original=amount_due_original+700.05,
    amount_line_items_original=amount_line_items_original+700.05,
    amount_applied=amount_applied+700.05
where customer_trx_id=2615786
  and payment_schedule_id =1618821
 
update ar.ar_payment_schedules_all
set amount_due_original=amount_due_original+171.74,
    amount_line_items_original=amount_line_items_original+171.74,
    amount_applied=amount_applied+171.74
where customer_trx_id=2615899
  and payment_schedule_id =1618822
-- Step4: Datafix AR Application
update ar.ar_receivable_applications_all
set ammount_applied=ammount_applied-700.05,
    line_applied=line_applied-700.05,
    acctd_amount_applied_from=acctd_amount_applied_from-700.05,
    acctd_amount_applied_to=acctd_amount_applied_to-700.05
where receivable_application_id=2512596
  and customer_trx_id=2615786

update ar.ar_receivable_applications_all
set ammount_applied=ammount_applied-700.05,
    line_applied=line_applied-171.74,
    acctd_amount_applied_from=acctd_amount_applied_from-171.74,
    acctd_amount_applied_to=acctd_amount_applied_to-171.74
where receivable_application_id=2512597
  and customer_trx_id=2615899
 
 -- Step5: to adjust the difference posted  between receivable account and revenue account
 
 DR
    81.CN.000.13110.0000  700.05
  CR
    81.GZ.501.51599.P024  700.05
   
 DR
    81.CN.000.13110.0000  171.74
  CR
    81.GZ.501.51599.P024  171.74
阅读(1386) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~