2: /* $Header: POXIVCRB.pls 120.9 2006/06/13 12:24:04 szaveri noship $ */
3:
4: -- Read the profile option that enables/disables the debug log
5: g_fnd_debug VARCHAR2(1) := NVL(FND_PROFILE.VALUE('AFLOG_ENABLED'),'N');
6: g_asn_debug VARCHAR2(1) := NVL(FND_PROFILE.VALUE('PO_RVCTP_ENABLE_TRACE'),'N');
7:
8: /*
9: g_log_head CONSTANT VARCHAR2(30) := 'po.plsql.PO_INVOICES_SV1.';
10: /*
274:
275:
276: BEGIN
277:
278: IF (g_asn_debug = 'Y') THEN
279: asn_debug.put_line('Obtain AP System Options ... ');
280: END IF;
281: X_progress := '010';
282:
275:
276: BEGIN
277:
278: IF (g_asn_debug = 'Y') THEN
279: asn_debug.put_line('Obtain AP System Options ... ');
280: END IF;
281: X_progress := '010';
282:
283: /* This select statement is used to obtain the AP_SYSTEM_PARAMETERS */
315:
316:
317: EXCEPTION
318: WHEN others THEN
319: IF (g_asn_debug = 'Y') THEN
320: asn_debug.put_line('Error in getting AP System Options ... ');
321: END IF;
322: po_message_s.sql_error('get_ap_parameters', x_progress,sqlcode);
323: RAISE;
316:
317: EXCEPTION
318: WHEN others THEN
319: IF (g_asn_debug = 'Y') THEN
320: asn_debug.put_line('Error in getting AP System Options ... ');
321: END IF;
322: po_message_s.sql_error('get_ap_parameters', x_progress,sqlcode);
323: RAISE;
324: END get_ap_parameters;
344: X_tmp_batch_id NUMBER;
345: X_batch_name ap_batches.batch_name%TYPE;
346:
347: BEGIN
348: IF (g_asn_debug = 'Y') THEN
349: asn_debug.put_line('Creating AP Invoice Batch ... ');
350: END IF;
351:
352: X_progress := '010';
345: X_batch_name ap_batches.batch_name%TYPE;
346:
347: BEGIN
348: IF (g_asn_debug = 'Y') THEN
349: asn_debug.put_line('Creating AP Invoice Batch ... ');
350: END IF;
351:
352: X_progress := '010';
353: /*** obtain the translated batch name ***/
403: X_batch_id := X_tmp_batch_id;
404:
405: EXCEPTION
406: WHEN others THEN
407: IF (g_asn_debug = 'Y') THEN
408: asn_debug.put_line('Error in creating AP Invoice Batch ... ');
409: END IF;
410: po_message_s.sql_error('create_ap_batches', x_progress,sqlcode);
411: RAISE;
404:
405: EXCEPTION
406: WHEN others THEN
407: IF (g_asn_debug = 'Y') THEN
408: asn_debug.put_line('Error in creating AP Invoice Batch ... ');
409: END IF;
410: po_message_s.sql_error('create_ap_batches', x_progress,sqlcode);
411: RAISE;
412: END create_ap_batches;
423:
424: IS
425: X_progress VARCHAR2(3) := null;
426: BEGIN
427: IF (g_asn_debug = 'Y') THEN
428: asn_debug.put_line('Updating current invoice batch ... ');
429: END IF;
430:
431: X_progress := '010';
424: IS
425: X_progress VARCHAR2(3) := null;
426: BEGIN
427: IF (g_asn_debug = 'Y') THEN
428: asn_debug.put_line('Updating current invoice batch ... ');
429: END IF;
430:
431: X_progress := '010';
432:
449: WHERE batch_id = X_batch_id;
450:
451: EXCEPTION
452: WHEN others THEN
453: IF (g_asn_debug = 'Y') THEN
454: asn_debug.put_line('Error in Updating current invoice batch ... ');
455: END IF;
456: po_message_s.sql_error('update_ap_batches', x_progress,sqlcode);
457: RAISE;
450:
451: EXCEPTION
452: WHEN others THEN
453: IF (g_asn_debug = 'Y') THEN
454: asn_debug.put_line('Error in Updating current invoice batch ... ');
455: END IF;
456: po_message_s.sql_error('update_ap_batches', x_progress,sqlcode);
457: RAISE;
458: END update_ap_batches;
537: /*** accounting date used does not fall into an open
538: or future accounting period. ***/
539:
540: X_progress := '040';
541: IF (g_asn_debug = 'Y') THEN
542: asn_debug.put_line('->Error: Invalid acctg date.');
543: END IF;
544:
545: po_interface_errors_sv1.handle_interface_errors(
538: or future accounting period. ***/
539:
540: X_progress := '040';
541: IF (g_asn_debug = 'Y') THEN
542: asn_debug.put_line('->Error: Invalid acctg date.');
543: END IF;
544:
545: po_interface_errors_sv1.handle_interface_errors(
546: X_transaction_type,
557: null,null,null,null,null,
558: X_curr_inv_process_flag);
559: ELSE
560: X_progress := '050';
561: IF (g_asn_debug = 'Y') THEN
562: asn_debug.put_line('Acctg Date = ' ||TO_CHAR(X_temp_accounting_date));
563: END IF;
564: X_accounting_date := X_temp_accounting_date;
565: X_period_name := X_temp_period_name;
558: X_curr_inv_process_flag);
559: ELSE
560: X_progress := '050';
561: IF (g_asn_debug = 'Y') THEN
562: asn_debug.put_line('Acctg Date = ' ||TO_CHAR(X_temp_accounting_date));
563: END IF;
564: X_accounting_date := X_temp_accounting_date;
565: X_period_name := X_temp_period_name;
566: END IF;
647: P_Token => l_token,
648: P_calling_sequence => 'rvtth.lpc'
649: )
650: ) THEN
651: IF (g_asn_debug = 'Y') THEN
652: asn_debug.put_line('AP_CANCEL_PKG.Ap_Cancel_Single_Invoice returned FALSE');
653: asn_debug.put_line('Token Value from AP API = ' || l_token);
654: END IF;
655: ELSE
648: P_calling_sequence => 'rvtth.lpc'
649: )
650: ) THEN
651: IF (g_asn_debug = 'Y') THEN
652: asn_debug.put_line('AP_CANCEL_PKG.Ap_Cancel_Single_Invoice returned FALSE');
653: asn_debug.put_line('Token Value from AP API = ' || l_token);
654: END IF;
655: ELSE
656: IF (g_asn_debug = 'Y') THEN
649: )
650: ) THEN
651: IF (g_asn_debug = 'Y') THEN
652: asn_debug.put_line('AP_CANCEL_PKG.Ap_Cancel_Single_Invoice returned FALSE');
653: asn_debug.put_line('Token Value from AP API = ' || l_token);
654: END IF;
655: ELSE
656: IF (g_asn_debug = 'Y') THEN
657: asn_debug.put_line('AP_CANCEL_PKG.Ap_Cancel_Single_Invoice returned TRUE');
652: asn_debug.put_line('AP_CANCEL_PKG.Ap_Cancel_Single_Invoice returned FALSE');
653: asn_debug.put_line('Token Value from AP API = ' || l_token);
654: END IF;
655: ELSE
656: IF (g_asn_debug = 'Y') THEN
657: asn_debug.put_line('AP_CANCEL_PKG.Ap_Cancel_Single_Invoice returned TRUE');
658: asn_debug.put_line('Token Value from AP API = ' || l_token);
659: END IF;
660: END IF; --AP Call ends
653: asn_debug.put_line('Token Value from AP API = ' || l_token);
654: END IF;
655: ELSE
656: IF (g_asn_debug = 'Y') THEN
657: asn_debug.put_line('AP_CANCEL_PKG.Ap_Cancel_Single_Invoice returned TRUE');
658: asn_debug.put_line('Token Value from AP API = ' || l_token);
659: END IF;
660: END IF; --AP Call ends
661:
654: END IF;
655: ELSE
656: IF (g_asn_debug = 'Y') THEN
657: asn_debug.put_line('AP_CANCEL_PKG.Ap_Cancel_Single_Invoice returned TRUE');
658: asn_debug.put_line('Token Value from AP API = ' || l_token);
659: END IF;
660: END IF; --AP Call ends
661:
662: IF (g_fnd_debug = 'Y') THEN
807: NULL, NULL, NULL, NULL, NULL, NULL, NULL);
808:
809: EXCEPTION
810: WHEN OTHERS THEN
811: IF (g_asn_debug = 'Y') THEN
812: ASN_DEBUG.put_line('Error in submit invoice import.');
813: END IF;
814: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
815: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name);
808:
809: EXCEPTION
810: WHEN OTHERS THEN
811: IF (g_asn_debug = 'Y') THEN
812: ASN_DEBUG.put_line('Error in submit invoice import.');
813: END IF;
814: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
815: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name);
816: END submit_invoice_import;