DBA Data[Home] [Help]

PACKAGE BODY: APPS.CE_XLA_ACCT_EVENTS_PKG

Source


4 PROCEDURE log(p_msg varchar2) is
1 PACKAGE BODY ce_xla_acct_events_pkg AS
2 /* $Header: cexlaevb.pls 120.20.12020000.2 2012/07/11 07:25:18 vnetan ship $ */
3 
5 BEGIN
6 --  FND_FILE.PUT_LINE(FND_FILE.LOG,p_msg);
7   cep_standard.debug(p_msg);
8 END log;
9 
10 
11 FUNCTION Validate_GL_Date(X_accounting_date DATE,
12 			  X_ledger_id       NUMBER,
13 		          X_cashflow_date   DATE) RETURN DATE IS
14   l_count		NUMBER;
15   l_accounting_date 	DATE;
16 BEGIN
17   IF X_accounting_date IS NULL THEN
18     log('No accounting date has been passed');
19   END IF;
20 
21   log('validate accounting date '|| X_accounting_date);
22   SELECT  count(*)
23   INTO	  l_count
24   FROM	  gl_period_statuses glp
25   WHERE	  glp.ledger_id = X_ledger_id
26   AND	  glp.closing_status in ('O','F')
27   AND	  glp.application_id = 101
28   AND	  glp.adjustment_period_flag = 'N'
29   AND	  X_accounting_date BETWEEN
30 		glp.start_date AND glp.end_date;
31 
32   IF l_count > 0 THEN
33     log('accounting date '|| X_accounting_date);
34     RETURN X_accounting_date;
35   ELSE
36     -- Return the next open GL date
37     SELECT  MIN(start_date)
38     INTO    l_accounting_date
39     FROM    gl_period_statuses
40     WHERE   closing_status = 'O'
41     AND     ledger_id = X_ledger_id
42     AND     application_id = 101
43     AND     adjustment_period_flag = 'N'
44     AND     start_date >= nvl(X_accounting_date, X_cashflow_date);
45     log('corrected accounting date '|| l_accounting_date);
46     RETURN l_accounting_date;
47   END IF;
48 EXCEPTION
49   WHEN NO_DATA_FOUND THEN
50      log('No Open period');
51      RETURN X_accounting_date;
52   WHEN OTHERS THEN
53      log('EXCEPTION Validate_GL_Date');
54      RAISE;
55 END Validate_GL_Date;
56 
57 
58 PROCEDURE Update_SLA_Event_Status(X_event_id		NUMBER,
59 				  X_event_status_code	VARCHAR2,
60 				  X_event_source_info   xla_events_pub_pkg.t_event_source_info,
61   				  X_security_context    xla_events_pub_pkg.t_security) IS
62   l_event_type_code	VARCHAR2(30);
63 BEGIN
64   log('Updating SLA event: '|| X_event_id);
65   log('260: ' || X_event_source_info.application_id);
66   log('Trx ID: '|| X_event_source_info.source_id_int_1);
67   log('CE_CASHFLOWS: '||X_event_source_info.entity_type_code);
68   log('LE: '||X_event_source_info.legal_entity_id);
69   log('Ledger: '||X_event_source_info.ledger_id);
70   log('trx num: '||X_event_source_info.transaction_number);
71 
72 
73   XLA_EVENTS_PUB_PKG.update_event(p_event_source_info 	=> X_event_source_info,
74 				  p_event_id 		=> X_event_id,
75 				  p_event_type_code	=> null,
76 				  p_event_date 		=> null,
77 				  p_event_status_code   => X_event_status_code,
78                        	 	  p_valuation_method  	=> '',
82 END Update_SLA_Event_Status;
79 				  p_security_context	=> X_security_context);
80 
81   log('Updated SLA event: '|| X_event_id);
83 
84 /*========================================================================
85  | PUBLIC PROCEDURE Raise_SLA_Event
86  |
87  | DESCRIPTION
88  |
89  |
90  | CALLED FROM PROCEDURES/FUNCTIONS (local to this package body)
91  |
92  | CALLS PROCEDURES/FUNCTIONS (local to this package body)
93  |
94  | PARAMETERS p_ev_rec which contains
95  |
96  |
97  | KNOWN ISSUES
98  |
99  | NOTES
100  |
101  | MODIFICATION HISTORY
102  | Date                  Author            Description of Changes
103  | 06-APR-2005           BHCHUNG           CREATED
104  | 11-APR-2012           CSUTARIA          Bug 13902100 changed the update by rowid with that of cashflow_id
105  |                                         and event_type
106  *=======================================================================*/
107 PROCEDURE Raise_SLA_Event(X_event_type_code	VARCHAR2,
108 		       X_event_date		DATE,
109                        X_event_status_code	VARCHAR2,
110 		       X_rowid			ROWID,
111 		       X_event_source_info	xla_events_pub_pkg.t_event_source_info,
112 		       X_security_context	xla_events_pub_pkg.t_security,
113 		       X_reference_info         xla_events_pub_pkg.t_event_reference_info,
114 		       x_trx_id number ) IS
115   l_event_id NUMBER;
116 BEGIN
117   log('Raise SLA event with event_type code: '|| X_event_type_code);
118   log('Raise SLA event with event_date: '|| X_event_date);
119   log('Raise SLA event with event_status_code: '|| X_event_status_code);
120   log('Raise SLA event with rowid: '|| X_rowid);
121   log('Raise SLA event with cashflow trx id: '|| x_trx_id ) ;
122 
123   l_event_id := XLA_EVENTS_PUB_PKG.create_event(
124 			p_event_source_info => X_event_source_info,
125 			p_event_type_code   => X_event_type_code,
126 			p_event_date	    => X_event_date,
127 			p_event_status_code => X_event_status_code,
128 			p_event_number      => NULL,
129 			p_reference_info    => X_reference_info,
130                         p_valuation_method  => '',
131 			p_security_context  => X_security_context);
132 
133   log('Event_id after xla api '||l_event_id);
134   log('Row ID: '||X_rowid);
135   -- Update event_id in history table
136 
137   UPDATE ce_cashflow_acct_h
138   SET event_id = l_event_id
139   WHERE cashflow_id = X_trx_id
140   and event_type = x_event_type_code
141   and event_id = 0 ; -- Bug 13902100
142 
143   log ( ' row count of update ' || sql%rowcount ) ;
144 
145 EXCEPTION
146   WHEN OTHERS THEN
147      log('EXCEPTION in Raise SLA Event');
148      RAISE;
149 END Raise_SLA_Event;
150 
151 /*========================================================================
152  | PUBLIC PROCEDURE Create_Event
153  |
154  | DESCRIPTION
155  |
156  |
157  | CALLED FROM PROCEDURES/FUNCTIONS (local to this package body)
158  |
159  | CALLS PROCEDURES/FUNCTIONS (local to this package body)
160  |
161  | PARAMETERS
162  |    X_trx_id:      cashflow_id
163  |    X_event_type:  Event Type Code
164  |    X_gl_date:  GL date for clearing and unclearing
165  |
166  | KNOWN ISSUES
167  |
168  | NOTES
169  |
170  | MODIFICATION HISTORY
171  | Date                  Author            Description of Changes
172  | 06-APR-2005           BHCHUNG           CREATED
173  *=======================================================================*/
174 PROCEDURE Create_Event( X_trx_id		NUMBER,
175 		        X_event_type_code	VARCHAR2,
176 		        X_gl_date		DATE DEFAULT NULL) IS
177   l_previous_row_id		ROWID;
178   l_previous_event_id		NUMBER;
179   l_previous_ae_status		VARCHAR2(30);
180   l_creation_event_id		NUMBER;
181   l_creation_ae_status		VARCHAR2(30);
182   l_accounting_date		DATE;
183   l_previous_acct_date		DATE;
184   l_creation_row_id		ROWID;
185   l_rowid			ROWID;
186 
187   l_event_source_info     xla_events_pub_pkg.t_event_source_info;
188   l_reference_info        xla_events_pub_pkg.t_event_reference_info;
189   l_security_context      xla_events_pub_pkg.t_security;
190 
191   l_cleared_date		DATE;
192   l_cleared_amount		NUMBER;
193   l_cleared_exchange_date	DATE;
194   l_cleared_exchange_rate_type	VARCHAR2(30);
195   l_cleared_exchange_rate 	NUMBER;
196   l_clearing_charges_amount	NUMBER;
197   l_clearing_error_amount	NUMBER;
198   l_cashflow_date		DATE;
199   l_ledger_id			NUMBER;
200   l_transfer_date		DATE;
201 
202 BEGIN
203   -- set parameters
204     --
205   -- initialize event source info
206   --
207   l_event_source_info.application_id := 260;
208   l_event_source_info.source_id_int_1 := X_trx_id;
209   l_event_source_info.entity_type_code := 'CE_CASHFLOWS';
210   --
211   -- Populate event source info record and security context
212   --
213   select  cf.cashflow_legal_entity_id,
214 	  cf.cashflow_ledger_id,
215 	  cf.cashflow_legal_entity_id,
216 	  cf.cashflow_id,
217 	  cf.cleared_date,
218 	  cf.cleared_amount,
219 	  cf.cleared_exchange_date,
220     	  cf.cleared_exchange_rate_type,
221  	  cf.cleared_exchange_rate,
222 	  cf.clearing_charges_amount,
223 	  cf.clearing_error_amount,
224           cf.cashflow_date,
225 	  cf.cashflow_ledger_id
226   into	  l_event_source_info.legal_entity_id,
227 	  l_event_source_info.ledger_id,
228           l_security_context.security_id_int_1,
229 	  l_event_source_info.transaction_number,
230   	  l_cleared_date,
231   	  l_cleared_amount,
232   	  l_cleared_exchange_date,
233   	  l_cleared_exchange_rate_type,
234   	  l_cleared_exchange_rate,
238 	  l_ledger_id
235   	  l_clearing_charges_amount,
236   	  l_clearing_error_amount,
237 	  l_cashflow_date,
239   from 	  ce_cashflows cf,
240 	  ce_payment_transactions trx
241   where   trx.trxn_reference_number(+) = cf.trxn_reference_number
242   and     cf.cashflow_id = X_trx_id;
243 
244   log('le '|| l_event_source_info.legal_entity_id);
245   log('ledger '|| l_event_source_info.ledger_id);
246   log('cashflow id '|| l_event_source_info.transaction_number);
247   log('cashflow date '|| l_cashflow_date);
248 
249   -- get the previous ae information and update the currect record flag to 'N'
250   BEGIN
251     SELECT rowid,
252 	   event_id,
253            status_code,
254 	   accounting_date
255     INTO   l_previous_row_id,
256 	   l_previous_event_id,
257 	   l_previous_ae_status,
258            l_previous_acct_date
259     FROM   ce_cashflow_acct_h
260     WHERE  cashflow_id = X_trx_id
261     AND    current_record_flag = 'Y';
262 
263     UPDATE ce_cashflow_acct_h
264     SET    current_record_flag = 'N'
265     WHERE  event_id = l_previous_event_id;
266   EXCEPTION
267     WHEN NO_DATA_FOUND THEN
268 	log('No accounting previous event exists for this cashflow');
269   END;
270 
271   --
272   -- Populate ce_cashflow_acct_h table with new event info.
273   -- Also, update current record flag to 'Y'.
274   --
275   IF X_event_type_code = 'CE_BAT_CREATED' THEN
276     log('Raise create event: ' ||X_event_type_code);
277     -- make sure accounting date is in open period. If not then use the first
278     -- available valid accounting date.
279 
280     l_accounting_date := l_cashflow_date;
281 
282     -- populate history table
283     CE_CASHFLOW_HIST_PKG.insert_row(l_rowid,
284 		 		0,
285  				X_trx_id,
286  				X_event_type_code,
287  				l_accounting_date,
288  				'UNACCOUNTED', -- Bug 7409147
289  				'Y',
290  				null,
291  				null,
292  				null,
293  				null,
294  				null,
295  				null,
296  				null,
297  				'N',
298  				null,
299  				null,
300  				nvl(fnd_global.user_id, -1),
301  				sysdate,
302  				nvl(fnd_global.user_id, -1),
303  				sysdate,
304  				nvl(fnd_global.user_id, -1));
305 
306     -- l_event_source_info.source_id_char_1 := l_rowid;
307     log('Row ID: '||l_rowid);
308 	log( 'x trx id ' || X_trx_id ) ;
309     -- Raise Create AE in SLA with unprocessed status
310     -- Cashflow date is used for accounting date
311     Raise_SLA_Event(X_event_type_code,
312 		    l_accounting_date,
313             XLA_EVENTS_PUB_PKG.c_event_unprocessed, --Bug 7387802
314 		    l_rowid,
315 		    l_event_source_info,
316 		    l_security_context,
317 		    l_reference_info,
318 			x_trx_id );
319 
320   ELSIF X_event_type_code IN ('CE_BAT_CLEARED','CE_STMT_RECORDED') THEN
321     log('Raise event: ' ||X_event_type_code);
322     -- make sure accounting date is in open period. If not then use the first
323     -- available valid accounting date.
324     IF X_event_type_code = 'CE_BAT_CLEARED' THEN
325       l_accounting_date := X_gl_date;
326     ELSE
327       l_accounting_date := l_cleared_date;
328     END IF;
329 
330     -- populate history table
331     CE_CASHFLOW_HIST_PKG.insert_row(l_rowid,
332 		 		0,
333  				X_trx_id,
334  				X_event_type_code,
335  				l_accounting_date,
336  				'UNACCOUNTED',
337  				'Y',
338 				l_cleared_date,
339   	  			l_cleared_amount,
340   	  			l_cleared_exchange_rate,
341   	  			l_cleared_exchange_date,
342   	  			l_cleared_exchange_rate_type,
343   	  			l_clearing_charges_amount,
344   	  			l_clearing_error_amount,
345  				'N',
346  				null,
347  				null,
348  				nvl(fnd_global.user_id, -1),
349  				sysdate,
350  				nvl(fnd_global.user_id, -1),
351  				sysdate,
352  				nvl(fnd_global.user_id, -1));
353 
354     -- l_event_source_info.source_id_char_1 := l_rowid;
355     log('Row ID: '||l_rowid);
356     -- Raise Clearing AE in SLA with unprocessed status
357     Raise_SLA_Event(X_event_type_code,
358 		    l_accounting_date,
359             XLA_EVENTS_PUB_PKG.c_event_unprocessed,
360 		    l_rowid,
361 		    l_event_source_info,
362 		    l_security_context,
363 		    l_reference_info,
364 			x_trx_id );
365   ELSIF X_event_type_code IN ('CE_BAT_UNCLEARED', 'CE_STMT_CANCELED') THEN
366     log('Raise event: ' ||X_event_type_code);
367     -- make sure accounting date is in open period. If not then use the first
368     -- available valid accounting date.
369     IF X_event_type_code = 'CE_BAT_UNCLEARED' THEN
370       l_accounting_date := X_gl_date;
371     ELSE
372       l_accounting_date := Validate_GL_Date(l_previous_acct_date, l_ledger_id, l_cashflow_date);
373     END IF;
374 
375     IF l_previous_ae_status <> 'ACCOUNTED' THEN  -- clearing event is unaccounted
376       -- Change AE status in SLA to 'no action'
377       -- l_event_source_info.source_id_char_1 := l_previous_row_id;
378       Update_SLA_Event_Status(l_previous_event_id,
379 	            	      XLA_EVENTS_PUB_PKG.c_event_noaction,
380 			      l_event_source_info,
381 			      l_security_context);
382 
383       -- Change AE status in history table to 'not applicable'.
384       UPDATE ce_cashflow_acct_h
385       SET    status_code = 'NOT_APPLICABLE'
386       WHERE  event_id = l_previous_event_id;
387 
388       -- populate history table with 'Not Applicable' status
389       CE_CASHFLOW_HIST_PKG.insert_row(l_rowid,
390 		 		0,
391  				X_trx_id,
392  				X_event_type_code,
393  				l_accounting_date,
394  				'NOT_APPLICABLE',
395  				'Y',
399  				null,
396  				null,
397  				null,
398  				null,
400  				null,
401  				null,
402  				null,
403  				'Y',
404  				X_trx_id,
405  				rowidtochar(l_previous_row_id),
406  				nvl(fnd_global.user_id, -1),
407  				sysdate,
408  				nvl(fnd_global.user_id, -1),
409  				sysdate,
410  				nvl(fnd_global.user_id, -1));
411 
412       -- l_event_source_info.source_id_char_1 := l_rowid;
413       log('Row ID: '||l_rowid);
414 
415       -- Raise Unclearing AE in SLA with status 'no action'
416       Raise_SLA_Event(X_event_type_code,
417 		    l_accounting_date,
418             XLA_EVENTS_PUB_PKG.c_event_noaction,
419 		    l_rowid,
420 		    l_event_source_info,
421 		    l_security_context,
422 		    l_reference_info,
423 			x_trx_id );
424 
425     ELSE  -- clearing event is accounted
426 
427       -- populate history table with 'UNACCOUNTED' status
428       CE_CASHFLOW_HIST_PKG.insert_row(l_rowid,
429 		 		0,
430  				X_trx_id,
431  				X_event_type_code,
432  				l_accounting_date,
433  				'UNACCOUNTED',
434  				'Y',
435  				null,
436  				null,
437  				null,
438  				null,
439  				null,
440  				null,
441  				null,
442  				'Y',
443  				X_trx_id,
444  				rowidtochar(l_previous_row_id),
445  				nvl(fnd_global.user_id, -1),
446  				sysdate,
447  				nvl(fnd_global.user_id, -1),
448  				sysdate,
449  				nvl(fnd_global.user_id, -1));
450 
451       -- l_event_source_info.source_id_char_1 := l_rowid;
452       log('Row ID: '||l_rowid);
453 
454       -- Raise Unclearing AE in SLA with status 'unprocessed'
455       Raise_SLA_Event(X_event_type_code,
456 		    l_accounting_date,
457             XLA_EVENTS_PUB_PKG.c_event_unprocessed,
458 		    l_rowid,
459 		    l_event_source_info,
460 		    l_security_context,
461 		    l_reference_info,
462 			x_trx_id );
463 
464     END IF;
465   ELSIF X_event_type_code = 'CE_BAT_CANCELED' THEN
466     log('Raise event: ' ||X_event_type_code);
467     -- get the creation ae information
468     BEGIN
469       --bug 7327306
470 	  SELECT event_id,
471              status_code,
472              accounting_date,
473 	     rowid
474       INTO   l_creation_event_id,
475 	     l_creation_ae_status,
476              l_accounting_date,
477              l_creation_row_id
478       FROM   ce_cashflow_acct_h
479 	  WHERE  event_id = (SELECT  Max(event_id)
480                          FROM    ce_cashflow_acct_h
481                          WHERE   cashflow_id = X_trx_id
482                          AND     event_type = 'CE_BAT_CREATED')
483 	  and    cashflow_id = x_trx_id;
484 
485     log('Creation event acct status: '|| l_creation_ae_status);
486     EXCEPTION
487       WHEN NO_DATA_FOUND THEN
488 	log('No creation accounting event exists');
489     END;
490 
491     -- make sure accounting date is in open period. If not then use the first
492     -- available valid accounting date.
493      l_accounting_date := Validate_GL_Date(l_accounting_date, l_ledger_id, l_cashflow_date);
494 
495      -- -- Bug 7409147 removed the if condition as the cancel event from BAT is unaccountable
496      -- like creation
497 
498   IF l_creation_ae_status = 'UNACCOUNTED' THEN  -- creation event is unaccounted
499       log('Creation event was unaccounted');
500       -- Change AE status in SLA to 'no action'
501       -- l_event_source_info.source_id_char_1 := l_creation_row_id;
502       Update_SLA_Event_Status(l_creation_event_id,
503 	            	      XLA_EVENTS_PUB_PKG.c_event_noaction,
504 			      l_event_source_info,
505 			      l_security_context);
506 
507       -- Change AE status in history table to 'not applicable'.
508       UPDATE ce_cashflow_acct_h
509       SET    status_code = 'NOT_APPLICABLE'
510       WHERE  event_id = l_creation_event_id;
511 
512      log('Inserting History with type code: ' ||X_event_type_code);
513       -- populate history table with 'Not Applicable' status
514       CE_CASHFLOW_HIST_PKG.insert_row(l_rowid,
515 		 		0,
516  				X_trx_id,
517  				X_event_type_code,
518  				l_accounting_date,
519  				'NOT_APPLICABLE',
520  				'Y',
521  				null,
522  				null,
523  				null,
524  				null,
525  				null,
526  				null,
527  				null,
528  				'Y',
529  				X_trx_id,
530  				rowidtochar(l_creation_row_id),
531  				nvl(fnd_global.user_id, -1),
532  				sysdate,
533  				nvl(fnd_global.user_id, -1),
534  				sysdate,
535  				nvl(fnd_global.user_id, -1));
536 
537       -- l_event_source_info.source_id_char_1 := l_rowid;
538       log('Row ID: '||l_rowid);
539 
540       -- Raise Cancel AE in SLA with status 'no action'
541       Raise_SLA_Event(X_event_type_code,
542 		    l_accounting_date,
543             XLA_EVENTS_PUB_PKG.c_event_noaction,
544 		    l_rowid,
545 		    l_event_source_info,
546 		    l_security_context,
547 		    l_reference_info,
548 			x_trx_id );
549     ELSE  -- creation event is accounted
550       -- populate history table with 'UNACCOUNTED' status
551       CE_CASHFLOW_HIST_PKG.insert_row(l_rowid,
552 		 		0,
553  				X_trx_id,
554  				X_event_type_code,
555  				l_accounting_date,
556  				'UNACCOUNTED',
557  				'Y',
558  				null,
559  				null,
560  				null,
561  				null,
562  				null,
563  				null,
567  				rowidtochar(l_creation_row_id),
564  				null,
565  				'Y',
566  				X_trx_id,
568  				nvl(fnd_global.user_id, -1),
569  				sysdate,
570  				nvl(fnd_global.user_id, -1),
571  				sysdate,
572  				nvl(fnd_global.user_id, -1));
573 
574       -- l_event_source_info.source_id_char_1 := l_rowid;
575       log('Row ID: '||l_rowid);
576 
577       -- Raise Cancel AE in SLA with status 'unprocessed'
578       Raise_SLA_Event(X_event_type_code,
579 		    l_accounting_date,
580             XLA_EVENTS_PUB_PKG.c_event_unprocessed,
581 		    l_rowid,
582 		    l_event_source_info,
583 		    l_security_context,
584 		    l_reference_info,
585 			x_trx_id );
586 
587     END IF;
588 
589 
590   ELSE
591     log('Exception incorrect event type code: '||X_event_type_code);
592   END IF;
593 
594 EXCEPTION
595   WHEN OTHERS THEN
596 	log('Exception in creating sla event');
597     RAISE;
598 END Create_Event;
599 
600 
601 /*========================================================================
602  | PRIVATE PROCEDURE postaccounting
603  |
604  | DESCRIPTION
605  |   Callout API to be called from SLA accounting engine.
606  |   As postaccounting action, API needs to perform the following:
607  |
608  |   The following is the API logic:
609  |
610  |   1.	If p_accounting_mode = 'D' (draft accounting) then don't do anything.
611  |   2.	Based on p_report_request_id, get the list of event ID from XLA_ENTITY_EVENTS_V
612  |   3.	For each event ID, check the PROCESS_STATUS_CODE column in XLA_ENTITY_EVENTS_V.
613  |	If process_status_code = 'E' then
614  |		Update cash flow acct history status (status_code) to 'Accounting Error'
615  |	Else if process_status_code = 'P' then
616  |		Update cash flow acct history status (status_code) to 'Accounted'
617  |
618  | KNOWN ISSUES
619  |
620  | NOTES
621  |
622  | MODIFICATION HISTORY
623  | Date                  Author            Description of Changes
624  | 06-APR-2005           BHCHUNG           CREATED
625  *=======================================================================*/
626 PROCEDURE postaccounting
627    (p_application_id     NUMBER
628    ,p_ledger_id          NUMBER
629    ,p_process_category   VARCHAR2
630    ,p_end_date           DATE
631    ,p_accounting_mode    VARCHAR2
632    ,p_valuation_method   VARCHAR2
633    ,p_security_id_int_1  NUMBER
634    ,p_security_id_int_2  NUMBER
635    ,p_security_id_int_3  NUMBER
636    ,p_security_id_char_1 VARCHAR2
637    ,p_security_id_char_2 VARCHAR2
638    ,p_security_id_char_3 VARCHAR2
639    ,p_report_request_id  NUMBER    ) IS
640 
641   CURSOR event_cur IS
642     SELECT event_id,
643            process_status_code
644     FROM   xla_entity_events_v
645     WHERE  request_id = p_report_request_id
646     AND    application_id = 260;
647 
648 BEGIN
649   log('Start postaccounting call-out API');
650   IF p_accounting_mode = 'D' THEN
651     RETURN;  -- draft accounting mode. Don't do anything
652   END IF;
653 
654   FOR c_rec IN event_cur LOOP
655     IF c_rec.process_status_code = 'E' THEN  -- accounting error
656       UPDATE ce_cashflow_acct_h
657       SET    status_code = 'ACCOUNTING_ERROR'
658       WHERE  event_id = c_rec.event_id;
659     ELSIF c_rec.process_status_code = 'P' THEN
660       UPDATE ce_cashflow_acct_h
661       SET    status_code = 'ACCOUNTED'
662       WHERE  event_id = c_rec.event_id;
663      -- and   status_code <> 'NOT_APPLICABLE'; -- Bug 7409147
664     END IF;
665   END LOOP;
666 
667 EXCEPTION
668 WHEN OTHERS THEN
669   log('Exception in postaccounting');
670   RAISE;
671 END postaccounting;
672 
673 /*========================================================================
674  | PRIVATE PROCEDURE preaccounting
675  |
676  | DESCRIPTION
677  |   Callout API to be called from SLA accounting engine.
678  |   No action requires. This is stubbed API.
679  |
680  | KNOWN ISSUES
681  |
682  | NOTES
683  |
684  | MODIFICATION HISTORY
685  | Date                  Author            Description of Changes
686  | 06-APR-2005           BHCHUNG           CREATED
687  *=======================================================================*/
688 PROCEDURE preaccounting
689    (p_application_id     NUMBER
690    ,p_ledger_id          NUMBER
691    ,p_process_category   VARCHAR2
692    ,p_end_date           DATE
693    ,p_accounting_mode    VARCHAR2
694    ,p_valuation_method   VARCHAR2
695    ,p_security_id_int_1  NUMBER
696    ,p_security_id_int_2  NUMBER
697    ,p_security_id_int_3  NUMBER
698    ,p_security_id_char_1 VARCHAR2
699    ,p_security_id_char_2 VARCHAR
700    ,p_security_id_char_3 VARCHAR2
701    ,p_report_request_id  NUMBER                    ) IS
702 BEGIN
703   log('Start preaccounting call-out API');
704 END preaccounting;
705 
706   /*========================================================================
707  | PRIVATE PROCEDURE extract
708  |
709  | DESCRIPTION
710  |   Callout API to be called from SLA accounting engine.
711  |   No action requires. This is stubbed API.
712  |
713  | KNOWN ISSUES
714  |
715  | NOTES
716  |
717  | MODIFICATION HISTORY
718  | Date                  Author            Description of Changes
719  | 06-APR-2005           BHCHUNG           CREATED
720  *=======================================================================*/
721 PROCEDURE extract
722    (p_application_id     NUMBER
723    ,p_accounting_mode    VARCHAR2                     ) IS
724 BEGIN
725   log('Start extract call-out API');
726 END extract;
727 
731  | DESCRIPTION
728 /*========================================================================
729  | PRIVATE PROCEDURE postprocessing
730  |
732  |   Callout API to be called from SLA accounting engine.
733  |   No action requires. This is stubbed API.
734  |
735  | KNOWN ISSUES
736  |
737  | NOTES
738  |
739  | MODIFICATION HISTORY
740  | Date                  Author            Description of Changes
741  | 06-APR-2005           BHCHUNG           CREATED
742  *=======================================================================*/
743 PROCEDURE postprocessing
744    (p_application_id     NUMBER
745    ,p_accounting_mode    VARCHAR2                     ) IS
746 BEGIN
747   log('Start postprocessing call-out API');
748 END postprocessing;
749 
750 FUNCTION ce_policy
751    (obj_schema VARCHAR2
752    ,obj_name VARCHAR2) RETURN VARCHAR2 IS
753 BEGIN
754   log('Start ce_policy');
755 
756   RETURN '1 =  CEP_STANDARD.check_ba_security(security_id_int_1,''CEBAA'')';
757   log('Exit ce_policy');
758 END ce_policy;
759 
760 END CE_XLA_ACCT_EVENTS_PKG;