DBA Data[Home] [Help]

PACKAGE BODY: APPS.PSA_MF_UPD_PST_CTRL_PKG

Source


1 package body PSA_MF_UPD_PST_CTRL_PKG
2 /* $Header: PSAMFUPB.pls 120.4 2006/09/13 14:03:55 agovil ship $ */
3 as
4 
5 
6 procedure update_posting_control(errbuf out NOCOPY varchar2, retcode out NOCOPY varchar2,
7                                  p_posting_control_id in number)
8 is
9   l_gl_posted_date date;
10 begin
11 
12   select gl_posted_date
13   into l_gl_posted_date
14   from ar_posting_control
15   where posting_control_id = p_posting_control_id;
16 
17   update ra_cust_trx_line_gl_dist
18   set gl_posted_date = l_gl_posted_date,
19       posting_control_id= p_posting_control_id,
20       last_update_date = sysdate
21   where customer_trx_id  in (select customer_trx_id
22 			    from psa_mf_trx_rec_buf
23 			    where pst_ctrl_id = p_posting_control_id);
24 
25   update ar_receivable_applications
26   set gl_posted_date = l_gl_posted_date,
27       posting_control_id= p_posting_control_id,
28       last_update_date = sysdate
29   where receivable_application_id in (select ra_receivable_application_id
30 				      from psa_mf_rct_rec_buf
31 			              where pst_ctrl_id = p_posting_control_id);
32 
33   update ar_adjustments
34   set gl_posted_date = l_gl_posted_date,
35       posting_control_id= p_posting_control_id,
36       last_update_date = sysdate
37   where adjustment_id in (select adjustment_id
38 			  from psa_mf_adj_rec_buf
39 			  where pst_ctrl_id = p_posting_control_id);
40 
41 
42             delete from psa_mf_trx_rec_buf
43             where last_update_date + 2 < sysdate;
44 
45             delete from psa_mf_rct_rec_buf
46             where last_update_date + 2 < sysdate;
47 
48             delete from psa_mf_adj_rec_buf
49             where last_update_date + 2 < sysdate;
50 
51   commit;
52 end update_posting_control;
53 
54 end PSA_MF_UPD_PST_CTRL_PKG;