144:
145:
146: v_log_file_name VARCHAR2(50) := 'jai_ap_ida_t3.log';
147: v_utl_location VARCHAR2(512);
148: v_myfilehandle UTL_FILE.FILE_TYPE;
149: v_debug CHAR(1) := 'N';
150:
151: BEGIN
152: pv_return_code := jai_constants.successful ;
200: 10. 08-apr-2003 Aparajita for bug#2851123. Version#615.4
201: The request JAINDIST was submitted wrongly. The seventh parameter in the submit request has to be the po distributions id. It was being passed as transactions id in receipt matching cases.
202:
203: 11. 11-sep-2003 Vijay Shankar for bug#3138227. Version#616.1
204: The utl file related code is failing which is stopping the transaction to continue. If the utl file
205: opening fails, then v_debug has to be made 'N' so that the transaction goes on without any error
206:
207: 12 29-Nov-2004 Sanjikum for 4035297. Version 115.1
208: Changed the 'INR' check. Added the call to JA_IN_UTIL.CHECK_JAI_EXISTS
280: lv_name VARCHAR2 (10);
281: BEGIN
282: pv_return_code := jai_constants.successful ;
283: -- Modified by Brathod for SQL Literals
284: lv_name := 'utl_file_dir';
285: SELECT DECODE(SUBSTR (value,1,INSTR(value,',') -1),NULL,
286: Value,SUBSTR (value,1,INSTR(value,',') -1)) INTO v_utl_location
287: FROM v$parameter
288: WHERE name = lv_name;
286: Value,SUBSTR (value,1,INSTR(value,',') -1)) INTO v_utl_location
287: FROM v$parameter
288: WHERE name = lv_name;
289:
290: v_myfilehandle := UTL_FILE.FOPEN(v_utl_location, v_log_file_name ,'A');
291: UTL_FILE.PUT_LINE(v_myfilehandle, '********* Start TdsTemp_AfterInsert_Trg ('||TO_CHAR(SYSDATE,'DD/MM/RRRR HH24:MI:SS') ||') *********');
292:
293: EXCEPTION
294: WHEN OTHERS THEN
287: FROM v$parameter
288: WHERE name = lv_name;
289:
290: v_myfilehandle := UTL_FILE.FOPEN(v_utl_location, v_log_file_name ,'A');
291: UTL_FILE.PUT_LINE(v_myfilehandle, '********* Start TdsTemp_AfterInsert_Trg ('||TO_CHAR(SYSDATE,'DD/MM/RRRR HH24:MI:SS') ||') *********');
292:
293: EXCEPTION
294: WHEN OTHERS THEN
295: v_debug := 'N';
390: FETCH fetch_tax_distribution INTO v_count_tax_dist;
391: CLOSE fetch_tax_distribution;
392:
393: IF v_debug = 'Y' THEN
394: UTL_FILE.PUT_LINE(v_myfilehandle, 'invoice_id -> '|| pr_new.invoice_id
395: ||', po_distribution_id -> ' ||pr_new.po_distribution_id
396: || ', line_type_lookup_code -> ' ||pr_new.line_type_lookup_code
397: || ', amount -> ' ||pr_new.amount
398: || ', line_type_lookup_code -> ' ||pr_new.line_type_lookup_code
649: END IF;
650:
651:
652: IF v_debug = 'Y' THEN
653: UTL_FILE.PUT_LINE(v_myfilehandle, 'invoice_id -> '|| pr_new.invoice_id
654: ||', po_distribution_id -> ' ||pr_new.po_distribution_id
655: || ', line_type_lookup_code -> ' ||pr_new.line_type_lookup_code
656: || ', amount -> ' ||pr_new.amount
657: || ', line_type_lookup_code -> ' ||pr_new.line_type_lookup_code
659: || ', v_receipt_num -> ' ||v_receipt_num
660: || ', v_receipt_code -> ' ||v_receipt_code
661: || ', v_rematching -> ' ||v_rematching
662: );
663: UTL_FILE.PUT_LINE(v_myfilehandle, ', rcv_transaction_id -> ' ||pr_new.rcv_transaction_id
664: || ', amount -> ' ||pr_new.amount
665: || ', org_id -> ' ||pr_new.org_id
666: || ', v_source -> ' ||v_source
667: );
725: );
726: END IF; -- ITEM_TO_PO
727: ----------------------------------------------------------------------
728: IF v_debug = 'Y' THEN
729: UTL_FILE.fclose(v_myfilehandle);
730: END IF;
731: /* Added an exception block by Ramananda for bug#4570303 */
732: EXCEPTION
733: WHEN OTHERS THEN