1 PACKAGE BODY AR_MRC_ENGINE2 AS
2 /* $Header: ARMCEN2B.pls 120.6 2005/04/14 22:41:38 hyu noship $ */
3
4 /*=============================================================================
5 | Public Functions / Procedures
6 *============================================================================*/
7
8 /*=============================================================================
9 | PUBLIC PROCEDURE Maintain_MRC_Data2
10 |
11 | DESCRIPTION:
12 | Initial Entry point for all AR code in order to maintain,
13 | or create any MRC data for the following Tables:
14 | AR_DISTRIBTIONS
15 | AR_RECEIVABLE_APPLICATIONS
16 | RA_CUST_TRX_LINE_GL_DIST
17 |
18 | This procedure will call the appropriate MRC api with the
19 | information required.
20 |
21 | CALLS PROCEDURES / FUNCTIONS (local to this package body)
22 |
23 | PARAMETERS
24 | p_event_mode IN event to preform on MRC tables (INSERT/UPDATE)
25 | p_table_name IN Base Table Name.
26 | p_key_value IN primary key value (USED IN SINGLE MODE)
27 | p_row_info IN AR_DISTRIBTIONS%ROWTYPE
28 | p_mode IN SINGLE or BATCH MODE
29 | p_key_value_list IN Used in Batch Mode (list of values)
30 |
31 | KNOWN ISSUES:
32 |
33 | NOTES: DELETES TO THIS TABLES WILL NOT BE PROCESSED IN THIS MODULE
34 | THEY ARE HANDLED THE SAME FOR ALL TABLES AND WILL BE PROCESSED
35 | IN THE ORIGINAL AR_MRC_ENGINE
36 |
37 | MODIFICATION HISTORY
38 | Date Author Description of Change
39 | 04/25/02 Debbie Sue Jancis Created
40 *============================================================================*/
41 PG_DEBUG varchar2(1) := NVL(FND_PROFILE.value('AFLOG_ENABLED'), 'N');
42
43 PROCEDURE Maintain_MRC_Data2(
44 p_event_mode IN VARCHAR2,
45 p_table_name IN VARCHAR2,
46 p_mode IN VARCHAR,
47 p_key_value IN NUMBER default NULL,
48 p_key_value_list IN gl_ca_utility_pkg.r_key_value_arr default NULL,
49 p_row_info IN AR_DISTRIBUTIONS%ROWTYPE DEFAULT NULL
50 ) IS
51 BEGIN
52 --{BUG4301323
53 NULL;
54 -- IF PG_DEBUG in ('Y', 'C') THEN
55 -- arp_standard.debug( 'AR_MRC_ENGINE2.Maintain_MRC_Data2(+)');
56 -- END IF;
57
58 /*-----------------------------------------------------------------+
59 | Dump the input parameters for debugging purposes |
60 +-----------------------------------------------------------------*/
61
62 -- IF PG_DEBUG in ('Y', 'C') THEN
63 -- arp_standard.debug('Maintain_MRC_Data2: ' || ' EVENT Mode : ' || p_event_mode);
64 -- arp_standard.debug('Maintain_MRC_Data2: ' || ' Table Name : ' || p_table_name);
65 -- arp_standard.debug('Maintain_MRC_Data2: ' || 'key_value : ' || to_char(p_key_value));
66 -- arp_standard.debug('Maintain_MRC_Data2: ' || 'p_mode : ' || p_mode);
67 -- END IF;
68
69
70 /*-----------------------------------------------------------------+
71 | In order to work for backwards compatiability, we need to check |
72 | for the table names which have had the trigger replaced. So |
73 | each time a new table is added, it needs to be added here, |
74 | until all tables are added and this outside if statement can be |
75 | removed. |
76 +-----------------------------------------------------------------*/
77
78 -- IF (p_table_name = 'AR_DISTRIBUTIONS' ) THEN
79
80 -- IF PG_DEBUG in ('Y', 'C') THEN
81 -- arp_standard.debug('Maintain_MRC_Data2: ' || 'Called with one of the supported table names ');
82 -- END IF;
83 /*-----------------------------------------------------------------+
84 | First we need to check if MRC is enabled. If it is than we |
85 | continue processing. If it is not then we are finished. |
86 +-----------------------------------------------------------------*/
87 -- IF PG_DEBUG in ('Y', 'C') THEN
88 -- arp_standard.debug('Maintain_MRC_Data2: ' || 'before checking to see if mrc is enabled..');
89 -- END IF;
90 -- IF (gl_ca_utility_pkg.mrc_enabled(p_sob_id => ar_mc_info.primary_sob_id,
91 -- p_org_id => ar_mc_info.org_id,
92 -- p_appl_id => 222
93 -- )) THEN
94
95 -- IF PG_DEBUG in ('Y', 'C') THEN
96 -- arp_standard.debug('Maintain_MRC_Data2: ' || 'MRC is enabled... ');
97 -- END IF;
98
99 /*------------------------------------------------------------+
100 | Branch based upon the mode of operation |
101 +------------------------------------------------------------*/
102 -- IF (p_event_mode = 'DELETE') THEN
103 -- IF PG_DEBUG in ('Y', 'C') THEN
104 -- arp_standard.debug('Maintain_MRC_Data2: ' || 'THIS MODULE SHOULD NOT BE CALLED FOR Deletion');
105 -- END IF;
106 -- END IF; /* end p_event_mode = DELETE */
107
108 -- IF ( p_event_mode = 'INSERT') THEN
109 -- BEGIN
110 -- IF ( p_table_name = 'AR_DISTRIBUTIONS') THEN
111 -- arp_mrc_acct_main.derive_mrc_acctg(
112 -- p_line_id => p_key_value,
113 -- p_key_value_list => p_key_value_list,
114 -- p_row_info => p_row_info,
115 -- p_ddl_mode => p_event_mode,
116 -- p_process_mode => p_mode);
117 -- END IF;
118 -- EXCEPTION
119 -- WHEN OTHERS THEN
120 -- IF PG_DEBUG in ('Y', 'C') THEN
121 -- arp_standard.debug('Maintain_MRC_Data2: ' || SQLERRM);
122 -- arp_standard.debug('Maintain_MRC_Data2: ' || 'error during Insert for ' || p_table_name);
123 -- END IF;
124 -- APP_EXCEPTION.RAISE_EXCEPTION;
125 -- END;
126 -- END IF; /* end p_event_mode = INSERT */
127
128 -- IF (p_event_mode = 'UPDATE') THEN
129
130 -- IF PG_DEBUG in ('Y', 'C') THEN
131 -- arp_standard.debug('Maintain_MRC_Data2: ' || 'Before calling MRC api for Update');
132 -- END IF;
133 -- BEGIN
134
135 -- IF (p_table_name = 'AR_DISTRIBUTIONS') THEN
136 -- arp_mrc_acct_main.derive_mrc_acctg(
137 -- p_line_id => p_key_value,
138 -- p_key_value_list => p_key_value_list,
139 -- p_row_info => p_row_info,
140 -- p_ddl_mode => p_event_mode,
141 -- p_process_mode => p_mode);
142 -- END IF;
143 -- EXCEPTION
144 -- WHEN OTHERS THEN
145 -- IF PG_DEBUG in ('Y', 'C') THEN
146 -- arp_standard.debug('Maintain_MRC_Data2: ' || 'error during update for ' || p_table_name);
147 -- END IF;
148 -- APP_EXCEPTION.RAISE_EXCEPTION;
149 -- END;
150 -- END IF; /* end p_event_mode = UPDATE */
151
152 -- END IF; /* end of mrc is enabled */
153
154 -- END IF; /* end of checking for specific tables */
155 -- IF PG_DEBUG in ('Y', 'C') THEN
156 -- arp_standard.debug( 'AR_MRC_ENGINE2.Maintain_MRC_Data2(-)');
157 -- END IF;
158
159 END Maintain_MRC_Data2;
160
161 /*===========================================================================
162 | PROCEDURE mrc_bulk_process
163 |
164 | DESCRIPTION:
165 | This procedure will be called by auto receipts to insert
166 | records into MRC tables using BULK processing
167 |
168 | CALLS PROCEDURES / FUNCTIONS
169 |
170 | ar_mc_info.rec_mrc_bulk_process (MRC bulk processing API
171 | called from Auto Receipts
172 | for ar_cash_Receipts,
173 | ar_cash_Receipt_history,
174 | and ar_payment_schedules inserts)
175 | PARAMETERS
176 | p_prog_name IN VARCHAR (AUTOREC)
177 | p_request_id IN VARCHAR2
178 | p_batch_id IN VARCHAR2
179 | p_confirmed_flag IN VARCHAR2
180 | p_history_status IN VARCHAR2
181 |
182 | KNOWN ISSUES:
183 |
184 | NOTES:
185 | MODIFICATION HISTORY
186 | Date Author Description of Change
187 | 07/24/02 Debbie Sue Jancis Created
188 *============================================================================*/
189 PROCEDURE mrc_bulk_process(
190 p_prog_name IN VARCHAR2,
191 p_created_from IN VARCHAR2,
192 p_request_id IN VARCHAR2,
193 p_batch_id IN VARCHAR2,
194 p_confirmed_flag IN VARCHAR2,
195 p_history_status IN VARCHAR2)
196 IS
197
198 BEGIN
199 --{BUG#4301323
200 NULL;
201 -- IF PG_DEBUG in ('Y', 'C') THEN
202 -- arp_standard.debug('AR_MRC_ENGINE2.mrc_bulk_process(+)');
203 -- arp_standard.debug('mrc_bulk_process: ' || 'CALLING PROGRAM : ' || p_prog_name);
204 -- arp_standard.debug('mrc_bulk_process: ' || 'before checking to see if mrc is enabled..');
205 -- END IF;
206 -- IF (gl_ca_utility_pkg.mrc_enabled(p_sob_id => ar_mc_info.primary_sob_id,
207 -- p_org_id => ar_mc_info.org_id,
208 -- p_appl_id => 222
209 -- )) THEN
210
211 -- IF PG_DEBUG in ('Y', 'C') THEN
212 -- arp_standard.debug('mrc_bulk_process: ' || 'MRC is enabled... ');
213 -- END IF;
214
215 -- AR_MC_INFO.rec_mrc_bulk_process(
216 -- to_number(p_request_id),
217 -- to_number(p_batch_id),
218 -- p_confirmed_flag,
219 -- p_history_status,
220 -- p_created_from
221 -- );
222 -- END IF;
223
224 -- IF PG_DEBUG in ('Y', 'C') THEN
225 -- arp_standard.debug('AR_MRC_ENGINE2.mrc_bulk_process(-)');
226 -- END IF;
227 END mrc_bulk_process;
228
229 /*===========================================================================
230 | PROCEDURE mrc_correct_rounding
231 |
232 | DESCRIPTION:
233 | This procedure will be called by the rounding package to
234 | handle rounding in the MRC table
235 |
236 | CALLS PROCEDURES / FUNCTIONS
237 |
238 | ar_mc_info.correct_receivables_header
239 | ar_mc_info.correct_nonrule_line_records
240 | ar_mc_info.correct_receivables_records
241 | ar_mc_info.correct_round_records
242 | ar_mc_info.correct_rul_records_by_line
243 |
244 | PARAMETERS
245 | rounding_prog_name IN VARCHAR2,
246 | p_request_id IN NUMBER,
247 | p_customer_trx_id IN NUMBER,
248 | p_customer_trx_line_id IN NUMBER,
249 | p_trx_class_to_process IN VARCHAR2,
250 | concat_segs IN VARCHAR2 default null,
251 | balanced_round_ccid IN NUMBER default null,
252 | p_check_rules_flag IN VARCHAR2 default null,
253 | p_period_set_name IN VARCHAR2 default null
254 |
255 | KNOWN ISSUES:
256 |
257 | NOTES:
258 | MODIFICATION HISTORY
259 | Date Author Description of Change
260 | 08/20/02 Debbie Sue Jancis Created
261 | 05/27/04 Srinivasa Kini Added CORRECT_SUSPENSE
262 *============================================================================*/
263 PROCEDURE mrc_correct_rounding(
264 rounding_prog_name IN VARCHAR2,
265 p_request_id IN NUMBER,
266 p_customer_trx_id IN NUMBER,
267 p_customer_trx_line_id IN NUMBER,
268 p_trx_class_to_process IN VARCHAR2,
269 concat_segs IN VARCHAR2 default null,
270 balanced_round_ccid IN NUMBER default null,
271 p_check_rules_flag IN VARCHAR2 default null,
272 p_period_set_name IN VARCHAR2 default null
273 ) IS
274 BEGIN
275 --{BUG4301323
276 NULL;
277 -- IF PG_DEBUG in ('Y', 'C') THEN
278 -- arp_standard.debug('AR_MRC_ENGINE2.mrc_correct_rounding(+)');
279 -- arp_standard.debug('mrc_correct_rounding: ' || 'before checking to see if mrc is enabled..');
280 -- END IF;
281 -- IF (gl_ca_utility_pkg.mrc_enabled(p_sob_id => ar_mc_info.primary_sob_id,
282 -- p_org_id => ar_mc_info.org_id,
283 -- p_appl_id => 222
284 -- )) THEN
285 -- IF PG_DEBUG in ('Y', 'C') THEN
286 -- arp_standard.debug('mrc_correct_rounding: ' || 'MRC is enabled... ');
287 -- END IF;
288
289 -- IF (rounding_prog_name = 'CORRECT_NONRULE_LINE_RECORDS') THEN
290 -- ar_mc_info.correct_nonrule_line_records(
291 -- p_request_id,
292 -- p_customer_trx_id,
293 -- p_customer_trx_line_id,
294 -- p_trx_class_to_process);
295 -- ELSIF (rounding_prog_name = 'CORRECT_RECEIVABLES_RECORDS') THEN
296 -- ar_mc_info.correct_receivables_records(
297 -- p_request_id,
298 -- p_customer_trx_id,
299 -- p_customer_trx_line_id,
300 -- p_trx_class_to_process);
301 -- ELSIF (rounding_prog_name = 'CORRECT_ROUND_RECORDS') THEN
302 -- ar_mc_info.correct_round_records(
303 -- p_request_id,
304 -- p_customer_trx_id,
305 -- p_customer_trx_line_id,
306 -- p_trx_class_to_process,
307 -- concat_segs,
308 -- balanced_round_ccid);
309
310 -- ELSIF (rounding_prog_name = 'CORRECT_RULE_RECORDS_BY_LINE') THEN
311 -- ar_mc_info.correct_rule_records_by_line(
312 -- p_request_id,
313 -- p_customer_trx_id,
314 -- p_trx_class_to_process,
315 -- p_check_rules_flag,
316 -- p_period_set_name);
317
318 -- ELSIF (rounding_prog_name = 'CORRECT_REV_ADJ_BY_LINE') THEN
319 -- /* Bug 3879222 - enhancement to RAM Collectibility */
320 -- /* Note that this correction is done using a join
321 -- to ar_line_rev_adj_gt so no parameters are
322 -- required */
323 -- ar_mc_info.correct_rev_adj_by_line;
324
325 -- ELSIF (rounding_prog_name = 'CORRECT_RECEIVABLES_HEADER') THEN
326 -- ar_mc_info.correct_receivables_header(
327 -- p_request_id,
328 -- p_customer_trx_id,
329 -- p_customer_trx_line_id,
330 -- p_trx_class_to_process);
331 -- ELSIF (rounding_prog_name = 'CORRECT_SUSPENSE') THEN
332 -- ar_mc_info.correct_suspense(p_customer_trx_id);
333 -- ELSE
334 -- IF PG_DEBUG in ('Y', 'C') THEN
335 -- arp_standard.debug('INCORRECT arguments to mrc_correct_rounding');
336 -- END IF;
337 -- END IF;
338 -- END IF;
339
340 -- IF PG_DEBUG in ('Y', 'C') THEN
341 -- arp_standard.debug('AR_MRC_ENGINE2.mrc_correct_rounding(-)');
342 -- END IF;
343 END mrc_correct_rounding;
344
345
346 END AR_MRC_ENGINE2;