[Home] [Help]
PACKAGE BODY: APPS.JAI_PA_COSTING_PKG
Source
1 package body jai_pa_costing_pkg as
2 /* $Header: jai_pa_costing.plb 120.4 2008/01/21 11:27:09 ssumaith noship $*/
3 /*------------------------------------------------------------------------------------------------------------
4 CHANGE HISTORY
5 ------------------------------------------------------------------------------------------------------------
6 Sl.No. Date Developer BugNo Version Remarks
7 ------------------------------------------------------------------------------------------------------------
8 1. 17/JAN/2007 brathod 5765161 115.0 Created the initial version
9 2. 05/APR/2007 cbabu 5765161 115.1 Changes done as required for Budget07
10
11 1. 24-APR-2007 cbabu 6012567 120.0 Forward ported to R12 from R11i taking 115.1 version
12 2. 08/Aug/2007 brathod 6321215 120.1 Using deiver transaction quantity instead of
13 quantity as populated in PA_TRANSACTION_INTERFACE
14 for deriving the apportion factor
15
16 3. 28-SEP-2007 Bgowrava 6452772 120.3 For the Transaction type as 'RETURN TO RECEIVING'
17 the non recoverable tax amount is returned as negative.
18 4. 27-NOV-2007 Jia Li Changed function get_nonrec_tax_amount
19 for Tax inclusive Computations.
20 --------------------------------------------------------------------------------------------------------------*/
21 /*----------------------------------------- PRIVATE MEMBERS DECLRATION -------------------------------------*/
22
23 /** Package level variables used in debug package*/
24 lv_object_name jai_cmn_debug_contexts.log_context%type := 'JAI_PA_COSTING_PKG';
25 lv_member_name jai_cmn_debug_contexts.log_context%type;
26 lv_context jai_cmn_debug_contexts.log_context%type;
27 --
28 -- Global variables used throught the package
29 --
30 lv_user_id fnd_user.user_id%type default fnd_global.user_id;
31 lv_login_id fnd_logins.login_id%type default fnd_global.login_id;
32
33 -- Package constants
34 GV_TRX_SRC_PO_RECEIPT constant varchar2 (30) := 'PO RECEIPT';
35 GV_TRX_SRC_PO_RCPT_PRICE_ADJ constant varchar2 (30) := 'PO RECEIPT PRICE ADJ';
36
37 gn_func_amount number;
38 gn_trx_amount number;
39 gv_trx_source varchar2(100);
40 gv_line_type varchar2(30);
41 gn_trx_id number;
42
43
44 procedure set_debug_context
45 is
46
47 begin
48 lv_context := rtrim(lv_object_name || '.'||lv_member_name,'.');
49 end set_debug_context;
50
51
52 function get_func_curr_indicator return varchar2 is
53 begin
54 return gv_functional_currency;
55 end get_func_curr_indicator;
56
57 function get_trx_curr_indicator return varchar2 is
58 begin
59 return gv_transaction_currency;
60 end get_trx_curr_indicator;
61
62 function get_nonrec_tax_amount(
63
64 pv_transaction_source in varchar2,
65 pv_line_type in varchar2,
66 pn_transaction_header_id in number,
67 pn_transaction_dist_id in number, /* One of PO_REQ_DISTRIBUTIONS_ALL.distribution_id, PO_DISTRIBUTIONS_ALL.po_distribution_id, RCV_TRANSACTIONS.transaction_id, AP_INVOICE_DISTRIBUTIONS_ALL.invoice_distribution_id */
68 pv_currency_of_return_tax_amt in varchar2 default null, /* no value is passed, then tax amount in transaction currency is returned */
69 pv_transaction_uom in varchar2 default null, /* if not given, then conversion of UOM w.r.to main transaction will not be performed */
70 pn_transaction_qty in number default null,
71 pn_currency_conv_rate in number default null
72
73 ) return number is
74
75 ln_nonreco_tax_amt number;
76 ln_trx_nonreco_tax_amt number;
77 ln_func_nonreco_tax_amt number;
78
79 ln_currency_conv_rate number;
80 lv_currency_of_return_tax_amt varchar2(30);
81
82 ln_apportion_factor number;
83 lv_src_type_rtr VARCHAR2(50); --bgowrava for Bug#6452772
84
85 cursor c_get_reqn_dist_dtl(pn_req_dist_id in number) is
86 select requisition_line_id, req_line_quantity
87 from po_req_distributions_all
88 where distribution_id = pn_req_dist_id;
89 r_get_reqn_dist_dtl c_get_reqn_dist_dtl%rowtype;
90
91 cursor c_get_reqn_line_dtl(pn_req_line_id in number) is
92 select quantity
93 from po_requisition_lines_all
94 where requisition_line_id = pn_req_line_id;
95 r_get_reqn_line_dtl c_get_reqn_line_dtl%rowtype;
96
97 cursor c_get_po_dist_dtl(pn_po_dist_id in number) is
98 select line_location_id, quantity_ordered
99 from po_distributions_all
100 where po_distribution_id = pn_po_dist_id;
101 r_get_po_dist_dtl c_get_po_dist_dtl%rowtype;
102
103 cursor c_get_po_line_loc_dtl(pn_line_loc_id in number) is
104 select quantity
105 from po_line_locations_all
106 where line_location_id = pn_line_loc_id;
107 r_get_po_line_loc_dtl c_get_po_line_loc_dtl%rowtype;
108
109 cursor c_ja_in_rcv_trx(cp_transaction_id in number) is
110 select *
111 from JAI_RCV_TRANSACTIONS
112 where transaction_id = cp_transaction_id;
113 r_ja_in_receive_trx c_ja_in_rcv_trx%rowtype;
114 r_ja_in_deliver_trx c_ja_in_rcv_trx%rowtype;
115
116 ln_reg_id number;
117
118 -- Added by Jia Li for Tax inclusive Computations on 2007/11/27, Begin
119 -- TD16-Changed Project Costing
120 -- these variables storage inclusive reco and non-reco tax amt
121 -----------------------------------------------------------------------
122 ln_trx_inclu_reco_tax_amt NUMBER;
123 ln_func_inclu_reco_tax_amt NUMBER;
124 ---------------------------------------------------------------------------------------
125 -- Added by Jia Li for Tax inclusive Computations on 2007/11/27, End
126
127 begin
128 lv_src_type_rtr := 'RETURN TO RECEIVING'; --bgowrava for Bug#6452772
129 lv_member_name := 'GET_NONREC_TAX_AMOUNT';
130 set_debug_context;
131 jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context
132 , pn_reg_id => ln_reg_id
133 );
134 if pn_currency_conv_rate is null or pn_currency_conv_rate = 0 then
135 ln_currency_conv_rate := 1;
136 else
137 ln_currency_conv_rate := nvl(pn_currency_conv_rate, 1);
138 end if;
139 lv_currency_of_return_tax_amt := nvl(pv_currency_of_return_tax_amt, gv_transaction_currency);
140
141 jai_cmn_debug_contexts_pkg.print (ln_reg_id, 'lv_currency_of_return_tax_amt='||lv_currency_of_return_tax_amt );
142
143 /* this logic is to avoid recalculation of amounts if called multiple times for the same transaction dtls consecutively*/
144 if gv_trx_source = pv_transaction_source
145 and gv_line_type = pv_line_type
146 and gn_trx_id = pn_transaction_dist_id
147 then
148 ln_func_nonreco_tax_amt := gn_func_amount;
149 ln_trx_nonreco_tax_amt := gn_trx_amount;
150 ln_func_inclu_reco_tax_amt := gn_func_amount; -- Added by Jia Li for Tax inclusive Computations on 2007/11/27
151 ln_trx_inclu_reco_tax_amt := gn_trx_amount; -- Added by Jia Li for Tax inclusive Computations on 2007/11/27
152 goto return_amount;
153 else
154 gv_trx_source := pv_transaction_source;
155 gv_line_type := pv_line_type;
156 gn_trx_id := pn_transaction_dist_id;
157 end if;
158
159
160 /* find the apportion factor */
161 /* apportion should consider only quantity */
162 -- NULL;
163
164 /* calculate the non recoverable tax */
165 /* this should consider currency, recoverable percentage and apportion factor when calculating the tax */
166
167 jai_cmn_debug_contexts_pkg.print (ln_reg_id, 'pv_line_type='||pv_line_type || ', pv_transaction_source='||pv_transaction_source);
168
169 if pv_transaction_source = JAI_PA_COSTING_PKG.gv_src_oracle_purchasing then
170
171 /* 1 - REQUISITONS */
172 if pv_line_type = JAI_PA_COSTING_PKG.gv_line_type_requisition then
173
174 open c_get_reqn_dist_dtl(pn_transaction_dist_id);
175 fetch c_get_reqn_dist_dtl into r_get_reqn_dist_dtl;
176 close c_get_reqn_dist_dtl;
177
178 select
179 nvl(
180 sum(
181 decode(nvl(a.currency, 'INR'), 'INR',
182 a.tax_amount * decode( nvl(a.modvat_flag, 'N'), 'N', 1, (1- nvl(b.mod_cr_percentage,0)/100)),
183 a.tax_amount * decode( nvl(a.modvat_flag, 'N'), 'N', 1, (1- nvl(b.mod_cr_percentage,0)/100)) * ln_currency_conv_rate
184 )
185 ),0) functional_tax_amount ,
186 nvl(
187 sum(
188 decode(nvl(a.currency, 'INR'), 'INR',
189 a.tax_amount * decode( nvl(a.modvat_flag, 'N'), 'N', 1, (1- nvl(b.mod_cr_percentage,0)/100)) / ln_currency_conv_rate,
190 a.tax_amount * decode( nvl(a.modvat_flag, 'N'), 'N', 1, (1- nvl(b.mod_cr_percentage,0)/100))
191 )
192 ),0) transaction_tax_amount
193 into ln_func_nonreco_tax_amt, ln_trx_nonreco_tax_amt
194 from JAI_PO_REQ_LINE_TAXES a, JAI_CMN_TAXES_ALL b
195 where a.tax_id = b.tax_id
196 and (
197 ( pn_transaction_dist_id is not null and a.requisition_line_id = r_get_reqn_dist_dtl.requisition_line_id )
198 or (pn_transaction_dist_id is null and a.requisition_header_id = pn_transaction_header_id)
199 );
200
201 -- Added by Jia Li for Tax inclusive Computations on 2007/11/27, Begin
202 -- TD16-Changed Project Costing
203 -- Get inclusive tax amount
204 -----------------------------------------------------------------------
205 SELECT
206 NVL(
207 SUM( DECODE(NVL(a.currency, 'INR'), 'INR', a.tax_amount,
208 a.tax_amount * ln_currency_conv_rate)
209 ),0) functional_tax_amount,
210 NVL(
211 SUM( DECODE(NVL(a.currency, 'INR'), 'INR', a.tax_amount/ln_currency_conv_rate,
212 a.tax_amount)
213 ),0) transaction_tax_amount
214 INTO
215 ln_func_inclu_reco_tax_amt
216 , ln_trx_inclu_reco_tax_amt
217 FROM
218 jai_po_req_line_taxes a
219 , jai_cmn_taxes_all b
220 WHERE a.tax_id = b.tax_id
221 AND NVL(b.inclusive_tax_flag, 'N') = 'Y'
222 AND ( ( pn_transaction_dist_id IS NOT NULL
223 AND
224 a.requisition_line_id = r_get_reqn_dist_dtl.requisition_line_id )
225 OR
226 ( pn_transaction_dist_id IS NULL
227 AND
228 a.requisition_header_id = pn_transaction_header_id )
229 );
230 ---------------------------------------------------------------------------------------
231 -- Added by Jia Li for Tax inclusive Computations on 2007/11/27, End
232
233 open c_get_reqn_line_dtl(r_get_reqn_dist_dtl.requisition_line_id);
234 fetch c_get_reqn_line_dtl into r_get_reqn_line_dtl;
235 close c_get_reqn_line_dtl;
236
237 jai_cmn_debug_contexts_pkg.print (ln_reg_id, 'pn_transaction_qty='||pn_transaction_qty ||',r_get_reqn_line_dtl.quantity='||r_get_reqn_line_dtl.quantity );
238
239 if pn_transaction_qty is not null
240 and pn_transaction_qty <> 0
241 and r_get_reqn_line_dtl.quantity is not null
242 and r_get_reqn_line_dtl.quantity <> 0
243 and r_get_reqn_line_dtl.quantity <> pn_transaction_qty
244 then
245 ln_apportion_factor := pn_transaction_qty / r_get_reqn_line_dtl.quantity;
246 else
247 ln_apportion_factor := 1;
248 end if;
249
250 jai_cmn_debug_contexts_pkg.print (ln_reg_id, 'ln_apportion_factor='||ln_apportion_factor);
251
252 ln_func_nonreco_tax_amt := ln_func_nonreco_tax_amt * ln_apportion_factor;
253 ln_trx_nonreco_tax_amt := ln_trx_nonreco_tax_amt * ln_apportion_factor;
254
255 ln_func_inclu_reco_tax_amt := ln_func_inclu_reco_tax_amt * ln_apportion_factor; -- Added by Jia Li for Tax inclusive Computations on 2007/11/27
256 ln_trx_inclu_reco_tax_amt := ln_trx_inclu_reco_tax_amt * ln_apportion_factor; -- Added by Jia Li for Tax inclusive Computations on 2007/11/27
257
258
259 /* 2 - PURCHASE ORDERS */
260 elsif pv_line_type = JAI_PA_COSTING_PKG.gv_line_type_purchasing then
261
262 open c_get_po_dist_dtl(pn_transaction_dist_id);
263 fetch c_get_po_dist_dtl into r_get_po_dist_dtl;
264 close c_get_po_dist_dtl;
265
266 select
267 nvl(
268 sum(
269 decode(nvl(a.currency, 'INR'), 'INR',
270 a.tax_amount * decode( nvl(a.modvat_flag, 'N'), 'N', 1,(1- nvl(b.mod_cr_percentage,0)/100)),
271 a.tax_amount * decode( nvl(a.modvat_flag, 'N'), 'N', 1,(1- nvl(b.mod_cr_percentage,0)/100)) * ln_currency_conv_rate
272 )
273 ),0) functional_tax_amount ,
274 nvl(
275 sum(
276 decode(nvl(a.currency, 'INR'), 'INR',
277 a.tax_amount * decode( nvl(a.modvat_flag, 'N'), 'N', 1,(1- nvl(b.mod_cr_percentage,0)/100)) / ln_currency_conv_rate,
278 a.tax_amount * decode( nvl(a.modvat_flag, 'N'), 'N', 1,(1- nvl(b.mod_cr_percentage,0)/100))
279 )
280 ),0) transaction_tax_amount
281 into ln_func_nonreco_tax_amt, ln_trx_nonreco_tax_amt
282 from JAI_PO_TAXES a, JAI_CMN_TAXES_ALL b
283 where a.tax_id = b.tax_id
284 and (
285 ( pn_transaction_dist_id is not null and a.line_location_id = r_get_po_dist_dtl.line_location_id )
286 or ( pn_transaction_dist_id is null and a.po_header_id = pn_transaction_header_id)
287 );
288
289 -- Added by Jia Li for Tax inclusive Computations on 2007/11/27, Begin
290 -- TD16-Changed Project Costing
291 -- Get inclusive tax amount
292 -----------------------------------------------------------------------
293 SELECT
294 NVL(
295 SUM( DECODE(NVL(a.currency, 'INR'), 'INR', a.tax_amount ,
296 a.tax_amount * ln_currency_conv_rate)
297 ),0) functional_tax_amount ,
298 NVL(
299 SUM( DECODE(NVL(a.currency, 'INR'), 'INR', a.tax_amount/ln_currency_conv_rate,
300 a.tax_amount)
301 ),0) transaction_tax_amount
302 INTO
303 ln_func_inclu_reco_tax_amt
304 , ln_trx_inclu_reco_tax_amt
305 FROM
306 jai_po_taxes a
307 , jai_cmn_taxes_all b
308 WHERE a.tax_id = b.tax_id
309 AND NVL(b.inclusive_tax_flag, 'N') = 'Y'
310 AND ( ( pn_transaction_dist_id IS NOT NULL
311 AND
312 a.line_location_id = r_get_po_dist_dtl.line_location_id )
313 OR
314 ( pn_transaction_dist_id IS NULL
315 AND
316 a.po_header_id = pn_transaction_header_id )
317 );
318 ---------------------------------------------------------------------------------------
319 -- Added by Jia Li for Tax inclusive Computations on 2007/11/27, End
320
321 open c_get_po_line_loc_dtl(r_get_po_dist_dtl.line_location_id);
322 fetch c_get_po_line_loc_dtl into r_get_po_line_loc_dtl;
323 close c_get_po_line_loc_dtl;
324
325 jai_cmn_debug_contexts_pkg.print (ln_reg_id, 'pn_transaction_qty='||pn_transaction_qty ||',r_get_po_line_loc_dtl.quantity='||r_get_po_line_loc_dtl.quantity);
326
327 if pn_transaction_qty is not null
328 and pn_transaction_qty <> 0
329 and r_get_po_line_loc_dtl.quantity is not null
330 and r_get_po_line_loc_dtl.quantity <> 0
331 and r_get_po_line_loc_dtl.quantity <> pn_transaction_qty
332 then
333 ln_apportion_factor := pn_transaction_qty / r_get_po_line_loc_dtl.quantity;
334 else
335 ln_apportion_factor := 1;
336 end if;
337
338 jai_cmn_debug_contexts_pkg.print (ln_reg_id, 'ln_apportion_factor='||ln_apportion_factor);
339
340 ln_func_nonreco_tax_amt := ln_func_nonreco_tax_amt * ln_apportion_factor;
341 ln_trx_nonreco_tax_amt := ln_trx_nonreco_tax_amt * ln_apportion_factor;
342
343 ln_func_inclu_reco_tax_amt := ln_func_inclu_reco_tax_amt * ln_apportion_factor; -- Added by Jia Li for Tax inclusive Computations on 2007/11/27
344 ln_trx_inclu_reco_tax_amt := ln_trx_inclu_reco_tax_amt * ln_apportion_factor; -- Added by Jia Li for Tax inclusive Computations on 2007/11/27
345
346 /* 3 - PURCHASE RECEIPTS */
347 elsif pv_line_type = JAI_PA_COSTING_PKG.gv_line_type_po_receipt then
348
349
350 open c_ja_in_rcv_trx(pn_transaction_dist_id);
351 fetch c_ja_in_rcv_trx into r_ja_in_deliver_trx;
352 close c_ja_in_rcv_trx;
353
354 select
355 /* functional tax amount calc */
356 nvl(
357 sum(
358 decode(nvl(a.currency, 'INR'), 'INR',
359 a.tax_amount
360 * decode(
361 decode(
362 r_ja_in_deliver_trx.attribute2, 'Y',
363 decode(upper(b.tax_type), 'EXCISE', 'N', 'OTHER EXCISE', 'N', 'ADDL. EXCISE', 'N'
364 , 'CVD', 'N', 'EXCISE_EDUCATION_CESS', 'N', 'CVD_EDUCATION_CESS', 'N'
365 , 'ADDITIONAL_CVD', 'N'
366 , jai_constants.tax_type_sh_exc_edu_cess, 'N'
367 , jai_constants.tax_type_sh_cvd_edu_cess, 'N'
368 , a.modvat_flag)
369 , a.modvat_flag
370 ),
371 'N', 1,(1- nvl(b.mod_cr_percentage,0)/100)),
372 /* if not INR, then following logic will be applied */
373 a.tax_amount
374 * decode(
375 decode(
376 r_ja_in_deliver_trx.attribute2, 'Y',
377 decode(upper(b.tax_type), 'EXCISE', 'N', 'OTHER EXCISE', 'N', 'ADDL. EXCISE', 'N'
378 , 'CVD', 'N', 'EXCISE_EDUCATION_CESS', 'N', 'CVD_EDUCATION_CESS', 'N'
379 , 'ADDITIONAL_CVD', 'N'
380 , jai_constants.tax_type_sh_exc_edu_cess, 'N'
381 , jai_constants.tax_type_sh_cvd_edu_cess, 'N'
382 , a.modvat_flag)
383 , a.modvat_flag
384 ),
385 'N', 1,(1- nvl(b.mod_cr_percentage,0)/100)
386 )
387 * ln_currency_conv_rate
388 )
389 ),0) functional_tax_amount ,
390 /* transaction tax amount calc */
391 nvl(
392 sum(
393 decode(nvl(a.currency, 'INR'), 'INR',
394 a.tax_amount
395 * decode(
396 decode(
397 r_ja_in_deliver_trx.attribute2, 'Y',
398 decode(upper(b.tax_type), 'EXCISE', 'N', 'OTHER EXCISE', 'N', 'ADDL. EXCISE', 'N'
399 , 'CVD', 'N', 'EXCISE_EDUCATION_CESS', 'N', 'CVD_EDUCATION_CESS', 'N'
400 , 'ADDITIONAL_CVD', 'N'
401 , jai_constants.tax_type_sh_exc_edu_cess, 'N'
402 , jai_constants.tax_type_sh_cvd_edu_cess, 'N'
403 , a.modvat_flag)
404 , a.modvat_flag
405 ),
406 'N', 1,(1- nvl(b.mod_cr_percentage,0)/100))
407 / ln_currency_conv_rate,
408 /* if not INR, then following logic will be applied */
409 a.tax_amount
410 * decode(
411 decode(
412 r_ja_in_deliver_trx.attribute2, 'Y',
413 decode(upper(b.tax_type), 'EXCISE', 'N', 'OTHER EXCISE', 'N', 'ADDL. EXCISE', 'N'
414 , 'CVD', 'N', 'EXCISE_EDUCATION_CESS', 'N', 'CVD_EDUCATION_CESS', 'N'
415 , 'ADDITIONAL_CVD', 'N'
416 , jai_constants.tax_type_sh_exc_edu_cess, 'N'
417 , jai_constants.tax_type_sh_cvd_edu_cess, 'N'
418 , a.modvat_flag)
419 , a.modvat_flag
420 ),
421 'N', 1,(1- nvl(b.mod_cr_percentage,0)/100)
422 )
423 )
424 ),0) transaction_tax_amount
425 into ln_func_nonreco_tax_amt, ln_trx_nonreco_tax_amt
426 from JAI_RCV_LINE_TAXES a, JAI_CMN_TAXES_ALL b
427 where a.tax_id = b.tax_id
428 and (
429 -- ( pn_transaction_dist_id is not null and a.transaction_id = r_ja_in_deliver_trx.tax_transaction_id )
430 ( pn_transaction_dist_id is not null and a.shipment_line_id = r_ja_in_deliver_trx.shipment_line_id )
431 or ( pn_transaction_dist_id is null and a.shipment_header_id = pn_transaction_header_id)
432 );
433
434
435 -- Added by Jia Li for Tax inclusive Computations on 2007/11/27, Begin
436 -- TD16-Changed Project Costing
437 -- Get inclusive tax amount
438 -----------------------------------------------------------------------
439 SELECT
440 /* functional inclusive tax amount calc */
441 NVL(
442 SUM(
443 DECODE(NVL(a.currency, 'INR'), 'INR', a.tax_amount ,
444 a.tax_amount * ln_currency_conv_rate)
445 ), 0) functional_tax_amount ,
446 /* transaction inclusive tax amount calc */
447 NVL(
448 SUM(
449 DECODE(NVL(a.currency, 'INR'), 'INR', a.tax_amount / ln_currency_conv_rate,
450 a.tax_amount)
451 ), 0) transaction_tax_amount
452 INTO
453 ln_func_inclu_reco_tax_amt
454 , ln_trx_inclu_reco_tax_amt
455 FROM
456 jai_rcv_line_taxes a
457 , jai_cmn_taxes_all b
458 WHERE a.tax_id = b.tax_id
459 AND NVL(b.inclusive_tax_flag, 'N') = 'Y'
460 AND ( ( pn_transaction_dist_id IS NOT NULL
461 -- AND a.transaction_id = r_ja_in_deliver_trx.tax_transaction_id )
462 AND a.shipment_line_id = r_ja_in_deliver_trx.shipment_line_id )
463 OR
464 ( pn_transaction_dist_id IS NULL
465 AND a.shipment_header_id = pn_transaction_header_id)
466 );
467 ---------------------------------------------------------------------------------------
468 -- Added by Jia Li for Tax inclusive Computations on 2007/11/27, End
469
470
471 open c_ja_in_rcv_trx(r_ja_in_deliver_trx.tax_transaction_id);
472 fetch c_ja_in_rcv_trx into r_ja_in_receive_trx;
473 close c_ja_in_rcv_trx;
474
475 /* Cases to be taken care
476 1. Non bonded delivery -- Implemented in the SELECT query for amounts itself using attribute2 of DELIVER transaction
477 2. UOM Conversion
478 3. Quantity change between receive and deliver -- Implemented with below apportion code
479 */
480
481 -- Bug# 6321215
482 -- Changed pn_transaction_qty to r_ja_in_receive_trx.quantity. This is done because in R12 PA populates amount
483 -- for quantity column if expenditure_type is not rate enabled. Hence refering to DELIVER quantity to determine the
484 -- apportion factor
485 jai_cmn_debug_contexts_pkg.print (ln_reg_id, 'r_ja_in_deliver_trx.quantity='||r_ja_in_deliver_trx.quantity ||
486 ', r_ja_in_receive_trx.quantity='||r_ja_in_receive_trx.quantity ||
487 ', pn_transaction_qty =' || pn_transaction_qty
488 );
489
490
491 if r_ja_in_deliver_trx.quantity is not null
492 and r_ja_in_deliver_trx.quantity <> 0
493 and r_ja_in_receive_trx.quantity is not null
494 and r_ja_in_receive_trx.quantity <> 0
495 and r_ja_in_receive_trx.quantity <> r_ja_in_deliver_trx.quantity
496 then
497 ln_apportion_factor := r_ja_in_deliver_trx.quantity / r_ja_in_receive_trx.quantity;
498 else
499 ln_apportion_factor := 1;
500 end if;
501 -- End Bug 6321215
502
503 jai_cmn_debug_contexts_pkg.print (ln_reg_id, 'ln_apportion_factor='||ln_apportion_factor);
504
505 ln_func_nonreco_tax_amt := ln_func_nonreco_tax_amt * ln_apportion_factor;
506 ln_trx_nonreco_tax_amt := ln_trx_nonreco_tax_amt * ln_apportion_factor;
507
508 ln_func_inclu_reco_tax_amt := ln_func_inclu_reco_tax_amt * ln_apportion_factor; -- Added by Jia Li for Tax inclusive Computations on 2007/11/27
509 ln_trx_inclu_reco_tax_amt := ln_trx_inclu_reco_tax_amt * ln_apportion_factor; -- Added by Jia Li for Tax inclusive Computations on 2007/11/27
510
511 /*START, Bgowrava for Bug#6452772*/
512 IF r_ja_in_deliver_trx.transaction_type = lv_src_type_rtr THEN
513 ln_func_nonreco_tax_amt := ln_func_nonreco_tax_amt*-1;
514 ln_trx_nonreco_tax_amt := ln_trx_nonreco_tax_amt*-1;
515
516 ln_func_inclu_reco_tax_amt := ln_func_inclu_reco_tax_amt * -1; -- Added by Jia Li for Tax inclusive Computations on 2007/11/27
517 ln_trx_inclu_reco_tax_amt := ln_trx_inclu_reco_tax_amt * -1; -- Added by Jia Li for Tax inclusive Computations on 2007/11/27
518
519 END IF;
520 /*END, Bgowrava for Bug#6452772*/
521
522 end if;
523
524 /* 4 - PAYABLE INVOICES */
525 elsif pv_transaction_source = JAI_PA_COSTING_PKG.gv_src_oracle_payables
526 and pv_line_type = JAI_PA_COSTING_PKG.gv_line_type_invoice
527 then
528
529 select
530 nvl(sum(a.base_amount),0) functional_tax_amount,
531 nvl(sum(a.tax_amount),0) transaction_tax_amount
532 into ln_func_nonreco_tax_amt, ln_trx_nonreco_tax_amt
533 from JAI_AP_MATCH_INV_TAXES a, JAI_CMN_TAXES_ALL b
534 where a.tax_id = b.tax_id
535 and nvl(b.mod_cr_percentage, 0) = 0
536 and (a.invoice_id, a.parent_invoice_distribution_id) =
537 ( select invoice_id, invoice_distribution_id from ap_invoice_distributions_all
538 where invoice_id = pn_transaction_header_id and distribution_line_number = pn_transaction_dist_id);
539
540 -- Added by Jia Li for Tax inclusive Computations on 2007/11/27, Begin
541 -- TD16-Changed Project Costing
542 -- Get inclusive recoverable tax amount
543 -----------------------------------------------------------------------
544 SELECT
545 NVL(SUM(a.base_amount),0) functional_tax_amount,
546 NVL(SUM(a.tax_amount),0) transaction_tax_amount
547 INTO
548 ln_func_inclu_reco_tax_amt
549 , ln_trx_inclu_reco_tax_amt
550 FROM
551 jai_ap_match_inv_taxes a
552 , jai_cmn_taxes_all b
553 WHERE a.tax_id = b.tax_id
554 AND NVL(b.inclusive_tax_flag, 'N') = 'Y'
555 AND a.recoverable_flag = 'Y'
556 AND ( a.invoice_id, a.parent_invoice_distribution_id) =
557 ( SELECT
558 invoice_id
559 , invoice_distribution_id
560 FROM
561 ap_invoice_distributions_all
562 WHERE invoice_id = pn_transaction_header_id
563 AND distribution_line_number = pn_transaction_dist_id);
564 ---------------------------------------------------------------------------------------
565 -- Added by Jia Li for Tax inclusive Computations on 2007/11/27, End
566
567 end if;
568
569 -- Added by Jia Li for Tax inclusive Computations on 2007/11/27, Begin
570 ------------------------------------------------------------------------
571 ln_func_nonreco_tax_amt := ln_func_nonreco_tax_amt - ln_func_inclu_reco_tax_amt;
572 ln_trx_nonreco_tax_amt := ln_trx_nonreco_tax_amt - ln_trx_inclu_reco_tax_amt;
573 ------------------------------------------------------------------------------
574 -- Added by Jia Li for Tax inclusive Computations on 2007/11/27, End
575 gn_func_amount := ln_func_nonreco_tax_amt ;
576 gn_trx_amount := ln_trx_nonreco_tax_amt ;
577
578 <<return_amount>>
579
580 if pv_currency_of_return_tax_amt is null
581 or pv_currency_of_return_tax_amt = JAI_PA_COSTING_PKG.gv_transaction_currency
582 then
583 return (ln_trx_nonreco_tax_amt);
584 else
585 return (ln_func_nonreco_tax_amt);
586 end if;
587
588 end get_nonrec_tax_amount;
589
590
591 /*------------------------------------------------------------------------------------------------------------*/
592 procedure pre_process
593 ( p_transaction_source in varchar2,
594 p_batch in varchar2,
595 p_xface_id in number,
596 p_user_id in number
597 )
598 is
599 lv_process_flag varchar2 (2);
600 lv_process_message varchar2 (2000);
601 ln_reg_id number;
602
603 begin <<pre_process>>
604 lv_member_name := 'PRE_PROCESS';
605 set_debug_context;
606 jai_cmn_debug_contexts_pkg.register ( pv_context => lv_context
607 , pn_reg_id => ln_reg_id
608 );
609
610 jai_cmn_debug_contexts_pkg.print (ln_reg_id, 'Call Parameters:' || fnd_global.local_chr(10) ||
611 'p_transaction_source='|| p_transaction_source ||fnd_global.local_chr(10) ||
612 'p_batch ='|| p_batch ||fnd_global.local_chr(10) ||
613 'p_xface_id ='|| p_xface_id ||fnd_global.local_chr(10) ||
614 'p_user_id ='|| p_user_id
615 );
616
617 if p_transaction_source not in (GV_TRX_SRC_PO_RECEIPT)
618 -- This source need not be implemented as it is for retroactive pricing functionality, GV_TRX_SRC_PO_RCPT_PRICE_ADJ)
619 then
620 return;
621 end if;
622
623 -- delegate call to update_interface_costs
624 update_interface_costs ( p_transaction_source => p_transaction_source
625 , p_batch => p_batch
626 , p_xface_id => p_xface_id
627 , p_process_flag => lv_process_flag
628 , p_process_message => lv_process_message
629 );
630 if lv_process_flag <> jai_constants.SUCCESSFUL then
631 jai_cmn_debug_contexts_pkg.print (ln_reg_id, 'lv_process_flag='||lv_process_flag ||',Message='||lv_process_message);
632 return;
633 end if;
634 /** Deregister procedure and return*/
635 <<deregister_and_return>>
636 jai_cmn_debug_contexts_pkg.deregister (pn_reg_id => ln_reg_id);
637
638 exception
639 when others then
640 jai_cmn_debug_contexts_pkg.print(ln_reg_id,lv_context||'->'||sqlerrm,jai_cmn_debug_contexts_pkg.summary);
641 jai_cmn_debug_contexts_pkg.print_stack;
642
643 end pre_process;
644
645 /*------------------------------------------------------------------------------------------------------------*/
646
647 procedure update_interface_costs
648 ( p_transaction_source in varchar2
649 , p_batch in varchar2
650 , p_xface_id in varchar2
651 , p_process_flag out nocopy varchar2
652 , p_process_message out nocopy varchar2
653 )
654 is
655
656 cursor c_pa_trx_xface_records
657 is
658 select *
659 from pa_transaction_interface_all
660 where transaction_source = p_transaction_source
661 and batch_name = p_batch
662 and transaction_status_code = 'P'
663 and interface_id = p_xface_id;
664
665 ln_reg_id number;
666 ln_apportioned_txn_tax_amt number;
667 ln_apportioned_func_tax_amt number;
668
669 begin <<update_interface_costs>>
670
671 lv_member_name := 'UPDATE_INTERFACE_COSTS';
672 set_debug_context;
673
674 jai_cmn_debug_contexts_pkg.register (lv_context, ln_reg_id);
675 for r_po_rcpt in c_pa_trx_xface_records
676 loop
677
678 ln_apportioned_func_tax_amt := 0;
679 ln_apportioned_txn_tax_amt := 0;
680
681
682 jai_cmn_debug_contexts_pkg.print
683 ( ln_reg_id
684 , 'r_po_rcpt.cdl_system_reference4 (rcv_transaction_id)='||r_po_rcpt.cdl_system_reference4 || fnd_global.local_chr(10) ||
685 'r_po_rcpt.unit_of_measure='||r_po_rcpt.unit_of_measure|| fnd_global.local_chr(10) ||
686 'r_po_rcpt.quantity='||r_po_rcpt.quantity || fnd_global.local_chr(10) ||
687 'r_po_rcpt.txn_interface_id='||r_po_rcpt.txn_interface_id
688 );
689 ln_apportioned_txn_tax_amt := JAI_PA_COSTING_PKG.get_nonrec_tax_amount
690 ( pv_transaction_source => JAI_PA_COSTING_PKG.GV_SRC_ORACLE_PURCHASING
691 , pv_line_type => JAI_PA_COSTING_PKG.GV_LINE_TYPE_PO_RECEIPT
692 , pn_transaction_header_id => null -- ''
693 , pn_transaction_dist_id => r_po_rcpt.cdl_system_reference4 --> rcv_transaction_id
694 , pv_currency_of_return_tax_amt => JAI_PA_COSTING_PKG.gv_transaction_currency
695 , pv_transaction_uom => r_po_rcpt.unit_of_measure
696 , pn_transaction_qty => r_po_rcpt.quantity
697 , pn_currency_conv_rate => r_po_rcpt.receipt_exchange_rate
698 );
699
700 ln_apportioned_func_tax_amt := JAI_PA_COSTING_PKG.get_nonrec_tax_amount
701 ( pv_transaction_source => JAI_PA_COSTING_PKG.GV_SRC_ORACLE_PURCHASING
702 , pv_line_type => JAI_PA_COSTING_PKG.GV_LINE_TYPE_PO_RECEIPT
703 , pn_transaction_header_id => null -- ''
704 , pn_transaction_dist_id => r_po_rcpt.cdl_system_reference4 --> rcv_transaction_id
705 , pv_currency_of_return_tax_amt => JAI_PA_COSTING_PKG.gv_functional_currency
706 , pv_transaction_uom => r_po_rcpt.unit_of_measure /* this value is not being populated by costing. so we need to fetch from JAI_RCV_TRANSACTIONS */
707 , pn_transaction_qty => r_po_rcpt.quantity
708 , pn_currency_conv_rate => r_po_rcpt.receipt_exchange_rate
709 );
710
711 jai_cmn_debug_contexts_pkg.print
712 ( ln_reg_id
713 , 'ln_apportioned_txn_tax_amt='||ln_apportioned_txn_tax_amt
714 ||', ln_apportioned_func_tax_amt='||ln_apportioned_func_tax_amt
715 );
716
717 jai_cmn_debug_contexts_pkg.print
718 ( ln_reg_id
719 ,'Before update pa_transaction_interface_all'
720 );
721
722 /*
723 update pa_transaction_interface_all
724 set raw_cost = raw_cost + nvl(ln_apportioned_tax_amt,0)
725 -- commented after talking to PROJECTs DEV team
726 -- ,receipt_currency_amount = receipt_currency_amount + nvl(ln_apportioned_tax_amt,0)
727 , denom_raw_cost = denom_raw_cost + nvl(ln_apportioned_tax_amt,0)
728 , acct_raw_cost = acct_raw_cost + nvl(ln_apportioned_tax_amt,0)
729 where txn_interface_id = r_po_rcpt.txn_interface_id ;
730 */
731 INSERT INTO pa_transaction_interface_all(
732 TRANSACTION_SOURCE ,
733 BATCH_NAME ,
734 EXPENDITURE_ENDING_DATE ,
735 EMPLOYEE_NUMBER ,
736 ORGANIZATION_NAME ,
737 EXPENDITURE_ITEM_DATE ,
738 PROJECT_NUMBER ,
739 TASK_NUMBER ,
740 EXPENDITURE_TYPE ,
741 NON_LABOR_RESOURCE ,
742 NON_LABOR_RESOURCE_ORG_NAME ,
743 QUANTITY ,
744 RAW_COST ,
745 EXPENDITURE_COMMENT ,
746 TRANSACTION_STATUS_CODE ,
747 TRANSACTION_REJECTION_CODE ,
748 EXPENDITURE_ID ,
749 ORIG_TRANSACTION_REFERENCE ,
750 ATTRIBUTE_CATEGORY ,
751 ATTRIBUTE1 ,
752 ATTRIBUTE2 ,
753 ATTRIBUTE3 ,
754 ATTRIBUTE4 ,
755 ATTRIBUTE5 ,
756 ATTRIBUTE6 ,
757 ATTRIBUTE7 ,
758 ATTRIBUTE8 ,
759 ATTRIBUTE9 ,
760 ATTRIBUTE10 ,
761 RAW_COST_RATE ,
762 INTERFACE_ID ,
763 UNMATCHED_NEGATIVE_TXN_FLAG ,
764 EXPENDITURE_ITEM_ID ,
765 ORG_ID ,
766 DR_CODE_COMBINATION_ID ,
767 CR_CODE_COMBINATION_ID ,
768 CDL_SYSTEM_REFERENCE1 ,
769 CDL_SYSTEM_REFERENCE2 ,
770 CDL_SYSTEM_REFERENCE3 ,
771 GL_DATE ,
772 BURDENED_COST ,
773 BURDENED_COST_RATE ,
774 SYSTEM_LINKAGE ,
775 TXN_INTERFACE_ID ,
776 USER_TRANSACTION_SOURCE ,
777 CREATED_BY ,
778 CREATION_DATE ,
779 LAST_UPDATED_BY ,
780 LAST_UPDATE_DATE ,
781 RECEIPT_CURRENCY_AMOUNT ,
782 RECEIPT_CURRENCY_CODE ,
783 RECEIPT_EXCHANGE_RATE ,
784 DENOM_CURRENCY_CODE ,
785 DENOM_RAW_COST ,
786 DENOM_BURDENED_COST ,
787 ACCT_RATE_DATE ,
788 ACCT_RATE_TYPE ,
789 ACCT_EXCHANGE_RATE ,
790 ACCT_RAW_COST ,
791 ACCT_BURDENED_COST ,
792 ACCT_EXCHANGE_ROUNDING_LIMIT ,
793 PROJECT_CURRENCY_CODE ,
794 PROJECT_RATE_DATE ,
795 PROJECT_RATE_TYPE ,
796 PROJECT_EXCHANGE_RATE ,
797 ORIG_EXP_TXN_REFERENCE1 ,
798 ORIG_EXP_TXN_REFERENCE2 ,
799 ORIG_EXP_TXN_REFERENCE3 ,
800 ORIG_USER_EXP_TXN_REFERENCE ,
801 VENDOR_NUMBER ,
802 OVERRIDE_TO_ORGANIZATION_NAME,
803 REVERSED_ORIG_TXN_REFERENCE ,
804 BILLABLE_FLAG ,
805 PERSON_BUSINESS_GROUP_NAME ,
806 PROJFUNC_CURRENCY_CODE ,
807 PROJFUNC_COST_RATE_TYPE ,
808 PROJFUNC_COST_RATE_DATE ,
809 PROJFUNC_COST_EXCHANGE_RATE ,
810 PROJECT_RAW_COST ,
811 PROJECT_BURDENED_COST ,
812 ASSIGNMENT_NAME ,
813 WORK_TYPE_NAME ,
814 CDL_SYSTEM_REFERENCE4 ,
815 ACCRUAL_FLAG ,
816 PROJECT_ID ,
817 TASK_ID ,
818 PERSON_ID ,
819 ORGANIZATION_ID ,
820 NON_LABOR_RESOURCE_ORG_ID ,
821 VENDOR_ID ,
822 OVERRIDE_TO_ORGANIZATION_ID ,
823 ASSIGNMENT_ID ,
824 WORK_TYPE_ID ,
825 PERSON_BUSINESS_GROUP_ID ,
826 INVENTORY_ITEM_ID ,
827 WIP_RESOURCE_ID ,
828 UNIT_OF_MEASURE
829 ) VALUES (
830 r_po_rcpt.TRANSACTION_SOURCE , -- 'PO RECEIPT NRTAX', --
831 r_po_rcpt.BATCH_NAME ,
832 r_po_rcpt.EXPENDITURE_ENDING_DATE ,
833 r_po_rcpt.EMPLOYEE_NUMBER ,
834 r_po_rcpt.ORGANIZATION_NAME ,
835 r_po_rcpt.EXPENDITURE_ITEM_DATE ,
836 r_po_rcpt.PROJECT_NUMBER ,
837 r_po_rcpt.TASK_NUMBER ,
838 r_po_rcpt.EXPENDITURE_TYPE ,
839 r_po_rcpt.NON_LABOR_RESOURCE ,
840 r_po_rcpt.NON_LABOR_RESOURCE_ORG_NAME ,
841 r_po_rcpt.QUANTITY ,
842 decode(r_po_rcpt.RAW_COST, null, null, nvl(ln_apportioned_txn_tax_amt,0)),
843 r_po_rcpt.EXPENDITURE_COMMENT ,
844 r_po_rcpt.TRANSACTION_STATUS_CODE ,
845 r_po_rcpt.TRANSACTION_REJECTION_CODE ,
846 r_po_rcpt.EXPENDITURE_ID ,
847 r_po_rcpt.ORIG_TRANSACTION_REFERENCE ,
848 r_po_rcpt.ATTRIBUTE_CATEGORY ,
849 r_po_rcpt.ATTRIBUTE1 ,
850 r_po_rcpt.ATTRIBUTE2 ,
851 r_po_rcpt.ATTRIBUTE3 ,
852 r_po_rcpt.ATTRIBUTE4 ,
853 r_po_rcpt.ATTRIBUTE5 ,
854 r_po_rcpt.ATTRIBUTE6 ,
855 r_po_rcpt.ATTRIBUTE7 ,
856 r_po_rcpt.ATTRIBUTE8 ,
857 r_po_rcpt.ATTRIBUTE9 ,
858 'INDIA LOCALIZATION' , -- r_po_rcpt.ATTRIBUTE10 ,
859 r_po_rcpt.RAW_COST_RATE ,
860 r_po_rcpt.INTERFACE_ID ,
861 r_po_rcpt.UNMATCHED_NEGATIVE_TXN_FLAG ,
862 r_po_rcpt.EXPENDITURE_ITEM_ID ,
863 r_po_rcpt.ORG_ID ,
864 r_po_rcpt.DR_CODE_COMBINATION_ID ,
865 r_po_rcpt.CR_CODE_COMBINATION_ID ,
866 r_po_rcpt.CDL_SYSTEM_REFERENCE1 ,
867 r_po_rcpt.CDL_SYSTEM_REFERENCE2 ,
868 r_po_rcpt.CDL_SYSTEM_REFERENCE3 ,
869 r_po_rcpt.GL_DATE ,
870 r_po_rcpt.BURDENED_COST ,
871 r_po_rcpt.BURDENED_COST_RATE ,
872 r_po_rcpt.SYSTEM_LINKAGE ,
873 pa_txn_interface_s.nextval ,
874 r_po_rcpt.USER_TRANSACTION_SOURCE ,
875 r_po_rcpt.CREATED_BY ,
876 r_po_rcpt.CREATION_DATE ,
877 r_po_rcpt.LAST_UPDATED_BY ,
878 r_po_rcpt.LAST_UPDATE_DATE ,
879 r_po_rcpt.RECEIPT_CURRENCY_AMOUNT ,
880 r_po_rcpt.RECEIPT_CURRENCY_CODE ,
881 r_po_rcpt.RECEIPT_EXCHANGE_RATE ,
882 r_po_rcpt.DENOM_CURRENCY_CODE ,
883 decode(r_po_rcpt.DENOM_RAW_COST, null,null, nvl(ln_apportioned_txn_tax_amt,0)),
884 r_po_rcpt.DENOM_BURDENED_COST ,
885 r_po_rcpt.ACCT_RATE_DATE ,
886 r_po_rcpt.ACCT_RATE_TYPE ,
887 r_po_rcpt.ACCT_EXCHANGE_RATE ,
888 decode(r_po_rcpt.ACCT_RAW_COST,null, null, nvl(ln_apportioned_func_tax_amt,0)) ,
889 r_po_rcpt.ACCT_BURDENED_COST ,
890 r_po_rcpt.ACCT_EXCHANGE_ROUNDING_LIMIT ,
891 r_po_rcpt.PROJECT_CURRENCY_CODE ,
892 r_po_rcpt.PROJECT_RATE_DATE ,
893 r_po_rcpt.PROJECT_RATE_TYPE ,
894 r_po_rcpt.PROJECT_EXCHANGE_RATE ,
895 r_po_rcpt.ORIG_EXP_TXN_REFERENCE1 ,
896 r_po_rcpt.ORIG_EXP_TXN_REFERENCE2 ,
897 r_po_rcpt.ORIG_EXP_TXN_REFERENCE3 ,
898 r_po_rcpt.ORIG_USER_EXP_TXN_REFERENCE ,
899 r_po_rcpt.VENDOR_NUMBER ,
900 r_po_rcpt.OVERRIDE_TO_ORGANIZATION_NAME,
901 r_po_rcpt.REVERSED_ORIG_TXN_REFERENCE ,
902 r_po_rcpt.BILLABLE_FLAG ,
903 r_po_rcpt.PERSON_BUSINESS_GROUP_NAME ,
904 r_po_rcpt.PROJFUNC_CURRENCY_CODE ,
905 r_po_rcpt.PROJFUNC_COST_RATE_TYPE ,
906 r_po_rcpt.PROJFUNC_COST_RATE_DATE ,
907 r_po_rcpt.PROJFUNC_COST_EXCHANGE_RATE ,
908 r_po_rcpt.PROJECT_RAW_COST ,
909 r_po_rcpt.PROJECT_BURDENED_COST ,
910 r_po_rcpt.ASSIGNMENT_NAME ,
911 r_po_rcpt.WORK_TYPE_NAME ,
912 r_po_rcpt.CDL_SYSTEM_REFERENCE4 ,
913 r_po_rcpt.ACCRUAL_FLAG ,
914 r_po_rcpt.PROJECT_ID ,
915 r_po_rcpt.TASK_ID ,
916 r_po_rcpt.PERSON_ID ,
917 r_po_rcpt.ORGANIZATION_ID ,
918 r_po_rcpt.NON_LABOR_RESOURCE_ORG_ID ,
919 r_po_rcpt.VENDOR_ID ,
920 r_po_rcpt.OVERRIDE_TO_ORGANIZATION_ID ,
921 r_po_rcpt.ASSIGNMENT_ID ,
922 r_po_rcpt.WORK_TYPE_ID ,
923 r_po_rcpt.PERSON_BUSINESS_GROUP_ID ,
924 r_po_rcpt.INVENTORY_ITEM_ID ,
925 r_po_rcpt.WIP_RESOURCE_ID ,
926 r_po_rcpt.UNIT_OF_MEASURE
927 );
928
929 jai_cmn_debug_contexts_pkg.print
930 ( ln_reg_id
931 , 'Number of rows updated='||sql%rowcount
932 );
933
934
935 end loop;
936
937 /** Deregister procedure and return*/
938 <<deregister_and_return>>
939 jai_cmn_debug_contexts_pkg.deregister (pn_reg_id => ln_reg_id);
940
941 exception
942 when others then
943 p_process_flag := jai_constants.UNEXPECTED_ERROR;
944 p_process_message := sqlerrm;
945 jai_cmn_debug_contexts_pkg.print(ln_reg_id,lv_context||'->'||sqlerrm,jai_cmn_debug_contexts_pkg.summary);
946 jai_cmn_debug_contexts_pkg.print_stack;
947
948 end update_interface_costs;
949
950 end jai_pa_costing_pkg;