131: Current_Time := sysdate;
132: fnd_message_cache.set_name('FND' , 'UTIL-CURRENT TIME');
133: fnd_message_cache.set_token('DATE' , fnd_date.date_to_displaydate(Current_Time));
134: fnd_message_cache.set_token('TIME' , to_char(Current_Time , 'HH24:MI:SS'));
135: PJM_CONC.put_line(fnd_message_cache.get);
136: PJM_CONC.new_line(1);
137: EXCEPTION
138: WHEN OTHERS THEN
139: NULL;
132: fnd_message_cache.set_name('FND' , 'UTIL-CURRENT TIME');
133: fnd_message_cache.set_token('DATE' , fnd_date.date_to_displaydate(Current_Time));
134: fnd_message_cache.set_token('TIME' , to_char(Current_Time , 'HH24:MI:SS'));
135: PJM_CONC.put_line(fnd_message_cache.get);
136: PJM_CONC.new_line(1);
137: EXCEPTION
138: WHEN OTHERS THEN
139: NULL;
140: END Timestamp;
273: else l_trx_status_code := X_trx_status_code;
274: end if;
275:
276: fnd_message.set_name('PJM','CONC-APINV IPV Transfer');
277: PJM_CONC.put_line(fnd_message.get || ' ...');
278: PJM_CONC.new_line(1);
279:
280: PJM_CONC.put_line('[PROJECT_ID] = ' || X_Project_Id);
281: PJM_CONC.put_line('[START_DATE] = ' || X_Start_Date);
274: end if;
275:
276: fnd_message.set_name('PJM','CONC-APINV IPV Transfer');
277: PJM_CONC.put_line(fnd_message.get || ' ...');
278: PJM_CONC.new_line(1);
279:
280: PJM_CONC.put_line('[PROJECT_ID] = ' || X_Project_Id);
281: PJM_CONC.put_line('[START_DATE] = ' || X_Start_Date);
282: PJM_CONC.put_line('[END_DATE] = ' || X_End_Date);
276: fnd_message.set_name('PJM','CONC-APINV IPV Transfer');
277: PJM_CONC.put_line(fnd_message.get || ' ...');
278: PJM_CONC.new_line(1);
279:
280: PJM_CONC.put_line('[PROJECT_ID] = ' || X_Project_Id);
281: PJM_CONC.put_line('[START_DATE] = ' || X_Start_Date);
282: PJM_CONC.put_line('[END_DATE] = ' || X_End_Date);
283: PJM_CONC.put_line('[SUBMIT_TRX_IMPORT] = ' || X_Submit_Trx_Import);
284:
277: PJM_CONC.put_line(fnd_message.get || ' ...');
278: PJM_CONC.new_line(1);
279:
280: PJM_CONC.put_line('[PROJECT_ID] = ' || X_Project_Id);
281: PJM_CONC.put_line('[START_DATE] = ' || X_Start_Date);
282: PJM_CONC.put_line('[END_DATE] = ' || X_End_Date);
283: PJM_CONC.put_line('[SUBMIT_TRX_IMPORT] = ' || X_Submit_Trx_Import);
284:
285: l_request_id := fnd_global.conc_request_id;
278: PJM_CONC.new_line(1);
279:
280: PJM_CONC.put_line('[PROJECT_ID] = ' || X_Project_Id);
281: PJM_CONC.put_line('[START_DATE] = ' || X_Start_Date);
282: PJM_CONC.put_line('[END_DATE] = ' || X_End_Date);
283: PJM_CONC.put_line('[SUBMIT_TRX_IMPORT] = ' || X_Submit_Trx_Import);
284:
285: l_request_id := fnd_global.conc_request_id;
286: l_user_id := fnd_global.user_id;
279:
280: PJM_CONC.put_line('[PROJECT_ID] = ' || X_Project_Id);
281: PJM_CONC.put_line('[START_DATE] = ' || X_Start_Date);
282: PJM_CONC.put_line('[END_DATE] = ' || X_End_Date);
283: PJM_CONC.put_line('[SUBMIT_TRX_IMPORT] = ' || X_Submit_Trx_Import);
284:
285: l_request_id := fnd_global.conc_request_id;
286: l_user_id := fnd_global.user_id;
287: l_Start_Date := fnd_date.canonical_to_date(X_Start_Date);
286: l_user_id := fnd_global.user_id;
287: l_Start_Date := fnd_date.canonical_to_date(X_Start_Date);
288: l_End_Date := fnd_date.canonical_to_date(X_End_Date);
289:
290: PJM_CONC.put_line('[REQUEST_ID] = ' || l_request_id);
291: PJM_CONC.new_line(1);
292:
293: l_IPV_Exp_Comment := fnd_message.get_string('PJM','CONC-APINV IPV');
294: l_ERV_Exp_Comment := fnd_message.get_string('PJM','CONC-APINV ERV');
287: l_Start_Date := fnd_date.canonical_to_date(X_Start_Date);
288: l_End_Date := fnd_date.canonical_to_date(X_End_Date);
289:
290: PJM_CONC.put_line('[REQUEST_ID] = ' || l_request_id);
291: PJM_CONC.new_line(1);
292:
293: l_IPV_Exp_Comment := fnd_message.get_string('PJM','CONC-APINV IPV');
294: l_ERV_Exp_Comment := fnd_message.get_string('PJM','CONC-APINV ERV');
295:
294: l_ERV_Exp_Comment := fnd_message.get_string('PJM','CONC-APINV ERV');
295:
296: l_Batch_Name := PJM_Transfer_IPV_Pkg.batch_name;
297:
298: PJM_CONC.put_line('Batch_Name = ' || l_batch_name);
299: PJM_CONC.new_line(1);
300:
301: ----------------------------------------------------------------------
302: -- Get Accounting Currency Code
295:
296: l_Batch_Name := PJM_Transfer_IPV_Pkg.batch_name;
297:
298: PJM_CONC.put_line('Batch_Name = ' || l_batch_name);
299: PJM_CONC.new_line(1);
300:
301: ----------------------------------------------------------------------
302: -- Get Accounting Currency Code
303: ----------------------------------------------------------------------
326: -- in IPV, causing the processing of such lines in the IPV/ERV
327: -- cycle.
328: ----------------------------------------------------------------------
329: fnd_message.set_name('PJM', 'CONC-APINV Flag Inv Dists');
330: PJM_CONC.put_line(fnd_message.get || ' ...');
331:
332: l_progress := 20;
333:
334: -- UPDATE /*+ index(DIST AP_INVOICE_DISTRIBUTIONS_N14) */
364: -- Eliminate all pairing of reversed invoice distributions
365: ----------------------------------------------------------------------
366:
367: -- fnd_message.set_name('PJM', 'CONC-APINV Elim NetZero');
368: -- PJM_CONC.put_line(fnd_message.get || ' ...');
369:
370: l_progress := 30;
371:
372: ----------------------------------------------------------------------
403: -- PA_Transaction_Interfaces
404: ----------------------------------------------------------------------
405:
406: fnd_message.set_name('PJM','CONC-APINV Start Loop');
407: PJM_CONC.put_line(fnd_message.get || ' ...');
408:
409: Timestamp;
410:
411: OPEN Inv_Curs;
426: , InvRec.Destination_Type_Code
427: , InvRec.Project_Id );
428: END IF;
429:
430: PJM_CONC.put_line(' invoice_id ............ '||InvRec.Invoice_Id);
431: PJM_CONC.put_line(' line_num .............. '||
432: InvRec.Distribution_Line_Number);
433: PJM_CONC.put_line(' project_id ............ '||InvRec.Project_ID);
434: PJM_CONC.put_line(' task_id ............... '||l_Task_Id);
427: , InvRec.Project_Id );
428: END IF;
429:
430: PJM_CONC.put_line(' invoice_id ............ '||InvRec.Invoice_Id);
431: PJM_CONC.put_line(' line_num .............. '||
432: InvRec.Distribution_Line_Number);
433: PJM_CONC.put_line(' project_id ............ '||InvRec.Project_ID);
434: PJM_CONC.put_line(' task_id ............... '||l_Task_Id);
435: PJM_CONC.put_line(' expenditure_org_id .... '||
429:
430: PJM_CONC.put_line(' invoice_id ............ '||InvRec.Invoice_Id);
431: PJM_CONC.put_line(' line_num .............. '||
432: InvRec.Distribution_Line_Number);
433: PJM_CONC.put_line(' project_id ............ '||InvRec.Project_ID);
434: PJM_CONC.put_line(' task_id ............... '||l_Task_Id);
435: PJM_CONC.put_line(' expenditure_org_id .... '||
436: InvRec.Expenditure_Organization_ID);
437:
430: PJM_CONC.put_line(' invoice_id ............ '||InvRec.Invoice_Id);
431: PJM_CONC.put_line(' line_num .............. '||
432: InvRec.Distribution_Line_Number);
433: PJM_CONC.put_line(' project_id ............ '||InvRec.Project_ID);
434: PJM_CONC.put_line(' task_id ............... '||l_Task_Id);
435: PJM_CONC.put_line(' expenditure_org_id .... '||
436: InvRec.Expenditure_Organization_ID);
437:
438: Timestamp;
431: PJM_CONC.put_line(' line_num .............. '||
432: InvRec.Distribution_Line_Number);
433: PJM_CONC.put_line(' project_id ............ '||InvRec.Project_ID);
434: PJM_CONC.put_line(' task_id ............... '||l_Task_Id);
435: PJM_CONC.put_line(' expenditure_org_id .... '||
436: InvRec.Expenditure_Organization_ID);
437:
438: Timestamp;
439:
463: l_ERV_Exp_Type := Get_ERV_Expenditure_Type
464: ( InvRec.Project_Id
465: , InvRec.Expenditure_Organization_Id );
466:
467: PJM_CONC.put_line(' ipv_expenditure_type .. '||l_ipv_exp_type);
468: PJM_CONC.put_line(' ipv_amount ............ '||
469: InvRec.Invoice_Price_Variance);
470: PJM_CONC.put_line(' erv_expenditure_type .. '||l_erv_exp_type);
471: PJM_CONC.put_line(' erv_amount ............ '||
464: ( InvRec.Project_Id
465: , InvRec.Expenditure_Organization_Id );
466:
467: PJM_CONC.put_line(' ipv_expenditure_type .. '||l_ipv_exp_type);
468: PJM_CONC.put_line(' ipv_amount ............ '||
469: InvRec.Invoice_Price_Variance);
470: PJM_CONC.put_line(' erv_expenditure_type .. '||l_erv_exp_type);
471: PJM_CONC.put_line(' erv_amount ............ '||
472: InvRec.Exchange_Rate_Variance);
466:
467: PJM_CONC.put_line(' ipv_expenditure_type .. '||l_ipv_exp_type);
468: PJM_CONC.put_line(' ipv_amount ............ '||
469: InvRec.Invoice_Price_Variance);
470: PJM_CONC.put_line(' erv_expenditure_type .. '||l_erv_exp_type);
471: PJM_CONC.put_line(' erv_amount ............ '||
472: InvRec.Exchange_Rate_Variance);
473: PJM_CONC.put_line(' expenditure_comment ... '||
474: InvRec.Expenditure_Comment);
467: PJM_CONC.put_line(' ipv_expenditure_type .. '||l_ipv_exp_type);
468: PJM_CONC.put_line(' ipv_amount ............ '||
469: InvRec.Invoice_Price_Variance);
470: PJM_CONC.put_line(' erv_expenditure_type .. '||l_erv_exp_type);
471: PJM_CONC.put_line(' erv_amount ............ '||
472: InvRec.Exchange_Rate_Variance);
473: PJM_CONC.put_line(' expenditure_comment ... '||
474: InvRec.Expenditure_Comment);
475: PJM_CONC.new_line(1);
469: InvRec.Invoice_Price_Variance);
470: PJM_CONC.put_line(' erv_expenditure_type .. '||l_erv_exp_type);
471: PJM_CONC.put_line(' erv_amount ............ '||
472: InvRec.Exchange_Rate_Variance);
473: PJM_CONC.put_line(' expenditure_comment ... '||
474: InvRec.Expenditure_Comment);
475: PJM_CONC.new_line(1);
476:
477: ----------------------------------------------------------------------
471: PJM_CONC.put_line(' erv_amount ............ '||
472: InvRec.Exchange_Rate_Variance);
473: PJM_CONC.put_line(' expenditure_comment ... '||
474: InvRec.Expenditure_Comment);
475: PJM_CONC.new_line(1);
476:
477: ----------------------------------------------------------------------
478: -- Getting Receipt Num from RCV_TRANSACTION_ID if exists
479: ----------------------------------------------------------------------
510: -- Insert into PA_TRANSACTION_INTERFACES table
511: ----------------------------------------------------------------------
512:
513: fnd_message.set_name('PJM','CONC-APINV Insert');
514: PJM_CONC.put_line('... ' || fnd_message.get);
515:
516: if not ( InvRec.Price_Var_Code_Combination_Id is not null AND
517: nvl(nvl(InvRec.Base_Invoice_Price_Variance,
518: InvRec.Invoice_Price_Variance) , 0) <> 0 ) then
516: if not ( InvRec.Price_Var_Code_Combination_Id is not null AND
517: nvl(nvl(InvRec.Base_Invoice_Price_Variance,
518: InvRec.Invoice_Price_Variance) , 0) <> 0 ) then
519:
520: PJM_CONC.put_line('...... IPV amount not available, skipping...');
521:
522: elsif ( l_IPV_Exp_Type is null) then
523:
524: PJM_CONC.put_line('...... Inv Org not setup to transfer IPV, skipping...');
520: PJM_CONC.put_line('...... IPV amount not available, skipping...');
521:
522: elsif ( l_IPV_Exp_Type is null) then
523:
524: PJM_CONC.put_line('...... Inv Org not setup to transfer IPV, skipping...');
525:
526: else
527:
528: BEGIN
555: l_transaction_source := 'Inventory';
556: END IF; /* check for BP org */
557:
558:
559: PJM_CONC.put_line('...... Processing IPV');
560:
561: -- Insert for IPV
562: INSERT INTO pa_transaction_interface
563: (transaction_source,
653: -- Insert for ERV
654: if not ( InvRec.Rate_Var_Code_Combination_Id is not null AND
655: InvRec.Exchange_Rate_Variance <> 0 ) then
656:
657: PJM_CONC.put_line('...... ERV amount not available, skipping...');
658:
659: elsif ( l_ERV_Exp_Type is null ) then
660:
661: PJM_CONC.put_line('...... Inv Org not setup to transfer ERV, skipping...');
657: PJM_CONC.put_line('...... ERV amount not available, skipping...');
658:
659: elsif ( l_ERV_Exp_Type is null ) then
660:
661: PJM_CONC.put_line('...... Inv Org not setup to transfer ERV, skipping...');
662:
663: else
664:
665: BEGIN
665: BEGIN
666:
667: l_progress := 120;
668:
669: PJM_CONC.put_line('...... Processing ERV');
670:
671: INSERT INTO pa_transaction_interface
672: (transaction_source,
673: batch_name,
760: -- Update pa_addition_flag to 'Y' for successful invoice distributions
761: ----------------------------------------------------------------------
762:
763: fnd_message.set_name('PJM','CONC-APINV Flag Comp');
764: PJM_CONC.put_line('... ' || fnd_message.get);
765: PJM_CONC.new_line(1);
766:
767: l_progress := 130;
768:
761: ----------------------------------------------------------------------
762:
763: fnd_message.set_name('PJM','CONC-APINV Flag Comp');
764: PJM_CONC.put_line('... ' || fnd_message.get);
765: PJM_CONC.new_line(1);
766:
767: l_progress := 130;
768:
769: UPDATE AP_Invoice_Distributions
778: CLOSE Inv_Curs;
779:
780: COMMIT;
781: fnd_message.set_name('PJM','CONC-APINV Finish Loop');
782: PJM_CONC.put_line(fnd_message.get || ' ...');
783: PJM_CONC.new_line(1);
784:
785: Timestamp;
786:
779:
780: COMMIT;
781: fnd_message.set_name('PJM','CONC-APINV Finish Loop');
782: PJM_CONC.put_line(fnd_message.get || ' ...');
783: PJM_CONC.new_line(1);
784:
785: Timestamp;
786:
787: l_progress := 140;
793: 'Inventory',
794: l_Batch_Name);
795: end if;
796:
797: retcode := PJM_CONC.G_conc_success;
798: return;
799:
800:
801: EXCEPTION
800:
801: EXCEPTION
802: when OTHERS then
803: errbuf := 'IPV-'||l_progress||': '||sqlerrm;
804: retcode := PJM_CONC.G_conc_failure;
805: return;
806:
807: END Transfer_IPV_to_PA;
808: