DBA Data[Home] [Help]

APPS.PO_INVOICES_SV2 dependencies on ASN_DEBUG

Line 5: -- g_asn_debug VARCHAR2(1) := NVL(FND_PROFILE.VALUE('PO_RVCTP_ENABLE_TRACE'),'N');

1: PACKAGE BODY po_invoices_sv2 AS
2: /* $Header: POXIVRPB.pls 120.26.12010000.8 2009/01/22 13:28:40 sadibhat ship $*/
3:
4: -- Read the profile option that enables/disables the debug log
5: -- g_asn_debug VARCHAR2(1) := NVL(FND_PROFILE.VALUE('PO_RVCTP_ENABLE_TRACE'),'N');
6: g_asn_debug VARCHAR2(1) := NVL(FND_PROFILE.VALUE('RCV_DEBUG_MODE'),'N'); --Bug 5197828
7:
8: create_invoice_error EXCEPTION; --SBI
9:

Line 6: g_asn_debug VARCHAR2(1) := NVL(FND_PROFILE.VALUE('RCV_DEBUG_MODE'),'N'); --Bug 5197828

2: /* $Header: POXIVRPB.pls 120.26.12010000.8 2009/01/22 13:28:40 sadibhat ship $*/
3:
4: -- Read the profile option that enables/disables the debug log
5: -- g_asn_debug VARCHAR2(1) := NVL(FND_PROFILE.VALUE('PO_RVCTP_ENABLE_TRACE'),'N');
6: g_asn_debug VARCHAR2(1) := NVL(FND_PROFILE.VALUE('RCV_DEBUG_MODE'),'N'); --Bug 5197828
7:
8: create_invoice_error EXCEPTION; --SBI
9:
10:

Line 38: IF (g_asn_debug = 'Y') THEN

34: FROM
35: po_line_locations_all
36: WHERE
37: line_location_id = p_po_line_location_id;
38: IF (g_asn_debug = 'Y') THEN
39: asn_debug.put_line('po_line_location_id = ' || p_po_line_location_id || ' has ship to location id = ' || l_ship_to_location_id);
40: END IF;
41: RETURN l_ship_to_location_id;
42: EXCEPTION

Line 39: asn_debug.put_line('po_line_location_id = ' || p_po_line_location_id || ' has ship to location id = ' || l_ship_to_location_id);

35: po_line_locations_all
36: WHERE
37: line_location_id = p_po_line_location_id;
38: IF (g_asn_debug = 'Y') THEN
39: asn_debug.put_line('po_line_location_id = ' || p_po_line_location_id || ' has ship to location id = ' || l_ship_to_location_id);
40: END IF;
41: RETURN l_ship_to_location_id;
42: EXCEPTION
43: WHEN NO_DATA_FOUND THEN

Line 44: IF (g_asn_debug = 'Y') THEN

40: END IF;
41: RETURN l_ship_to_location_id;
42: EXCEPTION
43: WHEN NO_DATA_FOUND THEN
44: IF (g_asn_debug = 'Y') THEN
45: asn_debug.put_line('po_line_location_id = ' || p_po_line_location_id || ' has no ship to location id');
46: END IF;
47: RETURN NULL;
48: WHEN OTHERS THEN

Line 45: asn_debug.put_line('po_line_location_id = ' || p_po_line_location_id || ' has no ship to location id');

41: RETURN l_ship_to_location_id;
42: EXCEPTION
43: WHEN NO_DATA_FOUND THEN
44: IF (g_asn_debug = 'Y') THEN
45: asn_debug.put_line('po_line_location_id = ' || p_po_line_location_id || ' has no ship to location id');
46: END IF;
47: RETURN NULL;
48: WHEN OTHERS THEN
49: IF (g_asn_debug = 'Y') THEN

Line 49: IF (g_asn_debug = 'Y') THEN

45: asn_debug.put_line('po_line_location_id = ' || p_po_line_location_id || ' has no ship to location id');
46: END IF;
47: RETURN NULL;
48: WHEN OTHERS THEN
49: IF (g_asn_debug = 'Y') THEN
50: asn_debug.put_line('po_line_location_id = ' || p_po_line_location_id || ' has some problem. This is not acceptable.');
51: END IF;
52: RETURN NULL;
53:

Line 50: asn_debug.put_line('po_line_location_id = ' || p_po_line_location_id || ' has some problem. This is not acceptable.');

46: END IF;
47: RETURN NULL;
48: WHEN OTHERS THEN
49: IF (g_asn_debug = 'Y') THEN
50: asn_debug.put_line('po_line_location_id = ' || p_po_line_location_id || ' has some problem. This is not acceptable.');
51: END IF;
52: RETURN NULL;
53:
54: END get_ship_to_location_id;

Line 84: IF (g_asn_debug = 'Y') THEN

80: WHERE
81: trx_id = p_trx_id
82: AND trx_line_id = p_trx_line_id
83: AND entity_code = p_entity_code;
84: IF (g_asn_debug = 'Y') THEN
85: asn_debug.put_line(p_entity_code || '=' || p_trx_id || ' has a tax classification code = ' || l_tax_classification_code);
86: END IF;
87: RETURN l_tax_classification_code;
88: EXCEPTION

Line 85: asn_debug.put_line(p_entity_code || '=' || p_trx_id || ' has a tax classification code = ' || l_tax_classification_code);

81: trx_id = p_trx_id
82: AND trx_line_id = p_trx_line_id
83: AND entity_code = p_entity_code;
84: IF (g_asn_debug = 'Y') THEN
85: asn_debug.put_line(p_entity_code || '=' || p_trx_id || ' has a tax classification code = ' || l_tax_classification_code);
86: END IF;
87: RETURN l_tax_classification_code;
88: EXCEPTION
89: WHEN NO_DATA_FOUND THEN

Line 90: IF (g_asn_debug = 'Y') THEN

86: END IF;
87: RETURN l_tax_classification_code;
88: EXCEPTION
89: WHEN NO_DATA_FOUND THEN
90: IF (g_asn_debug = 'Y') THEN
91: asn_debug.put_line(p_entity_code || '=' || p_trx_id || ' has no tax classification code');
92: END IF;
93: RETURN NULL;
94: WHEN OTHERS THEN

Line 91: asn_debug.put_line(p_entity_code || '=' || p_trx_id || ' has no tax classification code');

87: RETURN l_tax_classification_code;
88: EXCEPTION
89: WHEN NO_DATA_FOUND THEN
90: IF (g_asn_debug = 'Y') THEN
91: asn_debug.put_line(p_entity_code || '=' || p_trx_id || ' has no tax classification code');
92: END IF;
93: RETURN NULL;
94: WHEN OTHERS THEN
95: IF (g_asn_debug = 'Y') THEN

Line 95: IF (g_asn_debug = 'Y') THEN

91: asn_debug.put_line(p_entity_code || '=' || p_trx_id || ' has no tax classification code');
92: END IF;
93: RETURN NULL;
94: WHEN OTHERS THEN
95: IF (g_asn_debug = 'Y') THEN
96: asn_debug.put_line(p_entity_code || '=' || p_trx_id || ' has some problem. This is not acceptable.');
97: END IF;
98: RETURN NULL;
99: END get_tax_classification_code;

Line 96: asn_debug.put_line(p_entity_code || '=' || p_trx_id || ' has some problem. This is not acceptable.');

92: END IF;
93: RETURN NULL;
94: WHEN OTHERS THEN
95: IF (g_asn_debug = 'Y') THEN
96: asn_debug.put_line(p_entity_code || '=' || p_trx_id || ' has some problem. This is not acceptable.');
97: END IF;
98: RETURN NULL;
99: END get_tax_classification_code;
100:

Line 544: IF (g_asn_debug = 'Y') THEN

540:
541:
542: BEGIN
543: /**** BEGIN create_receipt_invoices ***/
544: IF (g_asn_debug = 'Y') THEN
545: asn_debug.put_line('Begin Create Receipt Invoices ... ');
546: END IF;
547:
548: X_invoice_count := 0;

Line 545: asn_debug.put_line('Begin Create Receipt Invoices ... ');

541:
542: BEGIN
543: /**** BEGIN create_receipt_invoices ***/
544: IF (g_asn_debug = 'Y') THEN
545: asn_debug.put_line('Begin Create Receipt Invoices ... ');
546: END IF;
547:
548: X_invoice_count := 0;
549: X_invoice_running_total := 0;

Line 573: IF (g_asn_debug = 'Y') THEN

569: END IF;
570:
571:
572: X_progress := '020';
573: IF (g_asn_debug = 'Y') THEN
574: asn_debug.put_line('Begin processing rcv txns ... [' || to_char(x_aging_period) || ']');
575: END IF;
576:
577:

Line 574: asn_debug.put_line('Begin processing rcv txns ... [' || to_char(x_aging_period) || ']');

570:
571:
572: X_progress := '020';
573: IF (g_asn_debug = 'Y') THEN
574: asn_debug.put_line('Begin processing rcv txns ... [' || to_char(x_aging_period) || ']');
575: END IF;
576:
577:
578: IF (X_rcv_shipment_header_id IS NULL) THEN

Line 580: IF (g_asn_debug = 'Y') THEN

576:
577:
578: IF (X_rcv_shipment_header_id IS NULL) THEN
579:
580: IF (g_asn_debug = 'Y') THEN
581: asn_debug.put_line('opening c_receipt_txns');
582: END IF;
583: OPEN c_receipt_txns;
584: ELSE

Line 581: asn_debug.put_line('opening c_receipt_txns');

577:
578: IF (X_rcv_shipment_header_id IS NULL) THEN
579:
580: IF (g_asn_debug = 'Y') THEN
581: asn_debug.put_line('opening c_receipt_txns');
582: END IF;
583: OPEN c_receipt_txns;
584: ELSE
585: IF (g_asn_debug = 'Y') THEN

Line 585: IF (g_asn_debug = 'Y') THEN

581: asn_debug.put_line('opening c_receipt_txns');
582: END IF;
583: OPEN c_receipt_txns;
584: ELSE
585: IF (g_asn_debug = 'Y') THEN
586: asn_debug.put_line('opening c_receipt_txns2');
587: END IF;
588: OPEN c_receipt_txns2;
589:

Line 586: asn_debug.put_line('opening c_receipt_txns2');

582: END IF;
583: OPEN c_receipt_txns;
584: ELSE
585: IF (g_asn_debug = 'Y') THEN
586: asn_debug.put_line('opening c_receipt_txns2');
587: END IF;
588: OPEN c_receipt_txns2;
589:
590: END IF;

Line 598: IF (g_asn_debug = 'Y') THEN

594: X_progress := '030';
595:
596: IF (X_rcv_shipment_header_id IS NULL) THEN
597:
598: IF (g_asn_debug = 'Y') THEN
599: asn_debug.put_line('fetching c_receipt_txns');
600: END IF;
601: FETCH c_receipt_txns INTO X_rcv_txns;
602:

Line 599: asn_debug.put_line('fetching c_receipt_txns');

595:
596: IF (X_rcv_shipment_header_id IS NULL) THEN
597:
598: IF (g_asn_debug = 'Y') THEN
599: asn_debug.put_line('fetching c_receipt_txns');
600: END IF;
601: FETCH c_receipt_txns INTO X_rcv_txns;
602:
603: IF (c_receipt_txns%NOTFOUND) THEN

Line 604: IF (g_asn_debug = 'Y') THEN

600: END IF;
601: FETCH c_receipt_txns INTO X_rcv_txns;
602:
603: IF (c_receipt_txns%NOTFOUND) THEN
604: IF (g_asn_debug = 'Y') THEN
605: asn_debug.put_line('closing c_receipt_txns');
606: END IF;
607: CLOSE C_receipt_txns;
608: EXIT;

Line 605: asn_debug.put_line('closing c_receipt_txns');

601: FETCH c_receipt_txns INTO X_rcv_txns;
602:
603: IF (c_receipt_txns%NOTFOUND) THEN
604: IF (g_asn_debug = 'Y') THEN
605: asn_debug.put_line('closing c_receipt_txns');
606: END IF;
607: CLOSE C_receipt_txns;
608: EXIT;
609: END IF;

Line 612: IF (g_asn_debug = 'Y') THEN

608: EXIT;
609: END IF;
610:
611: ELSE
612: IF (g_asn_debug = 'Y') THEN
613: asn_debug.put_line('fetching c_receipt_txns2');
614: END IF;
615: FETCH c_receipt_txns2 INTO X_rcv_txns;
616:

Line 613: asn_debug.put_line('fetching c_receipt_txns2');

609: END IF;
610:
611: ELSE
612: IF (g_asn_debug = 'Y') THEN
613: asn_debug.put_line('fetching c_receipt_txns2');
614: END IF;
615: FETCH c_receipt_txns2 INTO X_rcv_txns;
616:
617: IF (c_receipt_txns2%NOTFOUND) THEN

Line 618: IF (g_asn_debug = 'Y') THEN

614: END IF;
615: FETCH c_receipt_txns2 INTO X_rcv_txns;
616:
617: IF (c_receipt_txns2%NOTFOUND) THEN
618: IF (g_asn_debug = 'Y') THEN
619: asn_debug.put_line('closing c_receipt_txns2');
620: END IF;
621: CLOSE C_receipt_txns2;
622: EXIT;

Line 619: asn_debug.put_line('closing c_receipt_txns2');

615: FETCH c_receipt_txns2 INTO X_rcv_txns;
616:
617: IF (c_receipt_txns2%NOTFOUND) THEN
618: IF (g_asn_debug = 'Y') THEN
619: asn_debug.put_line('closing c_receipt_txns2');
620: END IF;
621: CLOSE C_receipt_txns2;
622: EXIT;
623: END IF;

Line 627: IF (g_asn_debug = 'Y') THEN

623: END IF;
624:
625: END IF;
626:
627: IF (g_asn_debug = 'Y') THEN
628: asn_debug.put_line('IN processing rcv txns ... ');
629: END IF;
630:
631: X_progress := '040';

Line 628: asn_debug.put_line('IN processing rcv txns ... ');

624:
625: END IF;
626:
627: IF (g_asn_debug = 'Y') THEN
628: asn_debug.put_line('IN processing rcv txns ... ');
629: END IF;
630:
631: X_progress := '040';
632:

Line 778: asn_debug.put_line('create_invoice_num raised error');

774: X_rcv_txns.pack_slip,
775: X_rcv_txns.receipt_num);
776: EXCEPTION
777: WHEN others THEN
778: asn_debug.put_line('create_invoice_num raised error');
779: X_curr_inv_process_flag := 'N';
780: X_first_rcv_txn_flag := 'Y';
781: END;
782: END IF;*/

Line 924: IF (g_asn_debug = 'Y') THEN

920: IF (UPPER(x_curr_conversion_rate_type) <> 'USER') THEN
921: x_curr_conversion_rate := NULL;
922: END IF;
923:
924: IF (g_asn_debug = 'Y') THEN
925: asn_debug.put_line('creating invoice headers');
926: END IF;
927: /* bug 1832024 : we need to insert terms id into the interface table
928: so that ap get the value */

Line 925: asn_debug.put_line('creating invoice headers');

921: x_curr_conversion_rate := NULL;
922: END IF;
923:
924: IF (g_asn_debug = 'Y') THEN
925: asn_debug.put_line('creating invoice headers');
926: END IF;
927: /* bug 1832024 : we need to insert terms id into the interface table
928: so that ap get the value */
929:

Line 933: asn_debug.put_line('x_curr_pay_site_id='||x_curr_pay_site_id||' and X_rcv_txns.default_pay_site_id='||X_rcv_txns.default_pay_site_id);

929:
930:
931: if (x_curr_inv_process_flag = 'Y') THEN
932: if (x_dist_count > 0 ) then -- 2531542
933: asn_debug.put_line('x_curr_pay_site_id='||x_curr_pay_site_id||' and X_rcv_txns.default_pay_site_id='||X_rcv_txns.default_pay_site_id);
934:
935: /* Bug 7512542 Calling create_invoice_num here to ensure
936: gapless invoice numbering and passing the parameters which
937: correspond to the RT record being invoiced */

Line 949: asn_debug.put_line('Invoice Number = ' ||X_curr_invoice_num);

945: X_curr_le_transaction_date,
946: X_curr_packing_slip,
947: X_curr_receipt_num);
948:
949: asn_debug.put_line('Invoice Number = ' ||X_curr_invoice_num);
950:
951: EXCEPTION
952: WHEN others THEN
953: asn_debug.put_line('create_invoice_num raised error');

Line 953: asn_debug.put_line('create_invoice_num raised error');

949: asn_debug.put_line('Invoice Number = ' ||X_curr_invoice_num);
950:
951: EXCEPTION
952: WHEN others THEN
953: asn_debug.put_line('create_invoice_num raised error');
954: X_curr_inv_process_flag := 'N';
955: X_first_rcv_txn_flag := 'Y';
956: END;
957: /* End bug 7512542 */

Line 1086: IF (g_asn_debug = 'Y') THEN

1082: IF MOD(X_invoice_count , X_commit_interval) = 0
1083: AND x_invoice_count > 0 THEN
1084: X_progress := '100';
1085:
1086: IF (g_asn_debug = 'Y') THEN
1087: asn_debug.put_line('Committing changes ... ');
1088: END IF;
1089: COMMIT;
1090: END IF;

Line 1087: asn_debug.put_line('Committing changes ... ');

1083: AND x_invoice_count > 0 THEN
1084: X_progress := '100';
1085:
1086: IF (g_asn_debug = 'Y') THEN
1087: asn_debug.put_line('Committing changes ... ');
1088: END IF;
1089: COMMIT;
1090: END IF;
1091:

Line 1109: asn_debug.put_line('create_invoice_num raised error');

1105: X_rcv_txns.pack_slip,
1106: X_rcv_txns.receipt_num);
1107: EXCEPTION
1108: WHEN others THEN
1109: asn_debug.put_line('create_invoice_num raised error');
1110: X_curr_inv_process_flag := 'N';
1111: END;
1112: END IF;*/
1113: /* End bug 7512542 */

Line 1171: asn_debug.put_line('pparthasmatch_option '||x_rcv_txns.match_option);

1167: X_rcv_txns.shipment_line_id,
1168: X_received_amount);
1169: ELSE
1170: X_received_amount := 0;
1171: asn_debug.put_line('pparthasmatch_option '||x_rcv_txns.match_option);
1172: po_invoices_sv2.get_received_quantity(X_rcv_txns.transaction_id,
1173: X_rcv_txns.shipment_line_id,
1174: X_received_quantity,
1175: X_rcv_txns.match_option ); --5100177

Line 1194: asn_debug.put_line('pparthas from shipment '||X_unit_meas_lookup_code);

1190: * from PO shipment if the match option is PO.
1191: */
1192: if X_rcv_txns.match_option = 'P' then
1193: X_unit_meas_lookup_code := X_rcv_txns.unit_meas_lookup_code;
1194: asn_debug.put_line('pparthas from shipment '||X_unit_meas_lookup_code);
1195: elsif X_rcv_txns.match_option = 'R' then
1196: X_unit_meas_lookup_code := X_rcv_txns.unit_of_measure;
1197: asn_debug.put_line('pparthas from rt '||X_unit_meas_lookup_code);
1198: end if;

Line 1197: asn_debug.put_line('pparthas from rt '||X_unit_meas_lookup_code);

1193: X_unit_meas_lookup_code := X_rcv_txns.unit_meas_lookup_code;
1194: asn_debug.put_line('pparthas from shipment '||X_unit_meas_lookup_code);
1195: elsif X_rcv_txns.match_option = 'R' then
1196: X_unit_meas_lookup_code := X_rcv_txns.unit_of_measure;
1197: asn_debug.put_line('pparthas from rt '||X_unit_meas_lookup_code);
1198: end if;
1199:
1200:
1201: if (x_received_quantity <> 0 or x_received_amount <> 0) then

Line 1296: IF (g_asn_debug = 'Y') THEN

1292: END IF;
1293:
1294: /* Removed the fix of 2379414 from here as it is already commented */
1295:
1296: IF (g_asn_debug = 'Y') THEN
1297: asn_debug.put_line('creating invoice distributions');
1298: END IF;
1299:
1300: /* Bug 7512542 Calling create_invoice_num here to ensure gapless invoicing */

Line 1297: asn_debug.put_line('creating invoice distributions');

1293:
1294: /* Removed the fix of 2379414 from here as it is already commented */
1295:
1296: IF (g_asn_debug = 'Y') THEN
1297: asn_debug.put_line('creating invoice distributions');
1298: END IF;
1299:
1300: /* Bug 7512542 Calling create_invoice_num here to ensure gapless invoicing */
1301:

Line 1320: asn_debug.put_line('Invoice Number = ' ||X_curr_invoice_num);

1316: X_curr_le_transaction_date,
1317: X_curr_packing_slip,
1318: X_curr_receipt_num);
1319:
1320: asn_debug.put_line('Invoice Number = ' ||X_curr_invoice_num);
1321:
1322: EXCEPTION
1323: WHEN others THEN
1324: asn_debug.put_line('create_invoice_num raised error');

Line 1324: asn_debug.put_line('create_invoice_num raised error');

1320: asn_debug.put_line('Invoice Number = ' ||X_curr_invoice_num);
1321:
1322: EXCEPTION
1323: WHEN others THEN
1324: asn_debug.put_line('create_invoice_num raised error');
1325: X_curr_inv_process_flag := 'N';
1326: X_first_rcv_txn_flag := 'Y';
1327:
1328: END;

Line 1402: IF (g_asn_debug = 'Y') THEN

1398:
1399:
1400: END IF; -- if X_rcv_first_flag
1401:
1402: IF (g_asn_debug = 'Y') THEN
1403: asn_debug.put_line('Completed create receipt invoices program... ');
1404: END IF;
1405:
1406: select count(*) into x_dist_count

Line 1403: asn_debug.put_line('Completed create receipt invoices program... ');

1399:
1400: END IF; -- if X_rcv_first_flag
1401:
1402: IF (g_asn_debug = 'Y') THEN
1403: asn_debug.put_line('Completed create receipt invoices program... ');
1404: END IF;
1405:
1406: select count(*) into x_dist_count
1407: from ap_invoice_lines_interface

Line 1464: IF (g_asn_debug = 'Y') THEN

1460: fnd_message.set_name('PO', 'PO_ERS_CONC_REQUEST_CHECK');
1461: fnd_message.set_token('REQUEST', TO_CHAR(v_req_id));
1462: fnd_message.set_token('BATCH', x_group_id);
1463:
1464: IF (g_asn_debug = 'Y') THEN
1465: asn_debug.put_line(fnd_message.get);
1466: END IF;
1467: END IF;
1468:

Line 1465: asn_debug.put_line(fnd_message.get);

1461: fnd_message.set_token('REQUEST', TO_CHAR(v_req_id));
1462: fnd_message.set_token('BATCH', x_group_id);
1463:
1464: IF (g_asn_debug = 'Y') THEN
1465: asn_debug.put_line(fnd_message.get);
1466: END IF;
1467: END IF;
1468:
1469: RETURN (X_completion_status);

Line 1476: IF (g_asn_debug = 'Y') THEN

1472:
1473: /* */
1474: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1475: l_error_msg := FND_MSG_PUB.get(p_encoded => 'F');
1476: IF (g_asn_debug = 'Y') THEN
1477: ASN_DEBUG.put_line(l_error_msg);
1478: END IF;
1479: RAISE;
1480: /* */

Line 1477: ASN_DEBUG.put_line(l_error_msg);

1473: /* */
1474: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1475: l_error_msg := FND_MSG_PUB.get(p_encoded => 'F');
1476: IF (g_asn_debug = 'Y') THEN
1477: ASN_DEBUG.put_line(l_error_msg);
1478: END IF;
1479: RAISE;
1480: /* */
1481: WHEN others THEN

Line 1482: IF (g_asn_debug = 'Y') THEN

1478: END IF;
1479: RAISE;
1480: /* */
1481: WHEN others THEN
1482: IF (g_asn_debug = 'Y') THEN
1483: asn_debug.put_line('Error in Create Receipt Invoices ...');
1484: END IF;
1485: po_message_s.sql_error('create_receipt_invoices', X_progress, sqlcode);
1486: RAISE;

Line 1483: asn_debug.put_line('Error in Create Receipt Invoices ...');

1479: RAISE;
1480: /* */
1481: WHEN others THEN
1482: IF (g_asn_debug = 'Y') THEN
1483: asn_debug.put_line('Error in Create Receipt Invoices ...');
1484: END IF;
1485: po_message_s.sql_error('create_receipt_invoices', X_progress, sqlcode);
1486: RAISE;
1487: END create_receipt_invoices;

Line 1550: IF (g_asn_debug = 'Y') THEN

1546: X_pay_cross_rate NUMBER;
1547: X_ap_pay_curr po_vendor_sites.payment_currency_code%TYPE;
1548:
1549: BEGIN
1550: IF (g_asn_debug = 'Y') THEN
1551: asn_debug.put_line('Wrapping up the current invoice ... ');
1552: END IF;
1553:
1554: IF (X_curr_inv_process_flag = 'Y') THEN

Line 1551: asn_debug.put_line('Wrapping up the current invoice ... ');

1547: X_ap_pay_curr po_vendor_sites.payment_currency_code%TYPE;
1548:
1549: BEGIN
1550: IF (g_asn_debug = 'Y') THEN
1551: asn_debug.put_line('Wrapping up the current invoice ... ');
1552: END IF;
1553:
1554: IF (X_curr_inv_process_flag = 'Y') THEN
1555: X_progress := '010';

Line 1578: IF (g_asn_debug = 'Y') THEN

1574: ELSE
1575: X_ap_pay_curr := X_curr_pay_curr_code;
1576: END IF;
1577:
1578: IF (g_asn_debug = 'Y') THEN
1579: asn_debug.put_line ('x_pay_cross_rate ='|| x_pay_cross_rate);
1580: asn_debug.put_line ('X_pay_curr_invoice_amount ='|| ap_utilities_pkg.ap_round_currency(X_curr_invoice_amount * X_pay_cross_rate, X_ap_pay_curr));
1581: END IF;
1582:

Line 1579: asn_debug.put_line ('x_pay_cross_rate ='|| x_pay_cross_rate);

1575: X_ap_pay_curr := X_curr_pay_curr_code;
1576: END IF;
1577:
1578: IF (g_asn_debug = 'Y') THEN
1579: asn_debug.put_line ('x_pay_cross_rate ='|| x_pay_cross_rate);
1580: asn_debug.put_line ('X_pay_curr_invoice_amount ='|| ap_utilities_pkg.ap_round_currency(X_curr_invoice_amount * X_pay_cross_rate, X_ap_pay_curr));
1581: END IF;
1582:
1583: -- create invoice header here

Line 1580: asn_debug.put_line ('X_pay_curr_invoice_amount ='|| ap_utilities_pkg.ap_round_currency(X_curr_invoice_amount * X_pay_cross_rate, X_ap_pay_curr));

1576: END IF;
1577:
1578: IF (g_asn_debug = 'Y') THEN
1579: asn_debug.put_line ('x_pay_cross_rate ='|| x_pay_cross_rate);
1580: asn_debug.put_line ('X_pay_curr_invoice_amount ='|| ap_utilities_pkg.ap_round_currency(X_curr_invoice_amount * X_pay_cross_rate, X_ap_pay_curr));
1581: END IF;
1582:
1583: -- create invoice header here
1584:

Line 1671: IF (g_asn_debug = 'Y') THEN

1667: x_invoice_num VARCHAR2 (45);
1668: -- SBI ENH
1669:
1670: BEGIN
1671: IF (g_asn_debug = 'Y') THEN
1672: asn_debug.put_line ('Constructing Invoice Num for the invoice ... ');
1673: END IF;
1674:
1675: x_progress := '001';

Line 1672: asn_debug.put_line ('Constructing Invoice Num for the invoice ... ');

1668: -- SBI ENH
1669:
1670: BEGIN
1671: IF (g_asn_debug = 'Y') THEN
1672: asn_debug.put_line ('Constructing Invoice Num for the invoice ... ');
1673: END IF;
1674:
1675: x_progress := '001';
1676:

Line 1729: IF (g_asn_debug = 'Y') THEN

1725: x_return_status ,
1726: x_msg_count ,
1727: x_msg_data
1728: );
1729: IF (g_asn_debug = 'Y') THEN
1730: asn_debug.put_line ('rcv_gapless_numbering.generate_invoice_number returned with status = ' || x_return_status );
1731: asn_debug.put_line ('x_invoice_num = ' || x_invoice_num );
1732: END IF;
1733:

Line 1730: asn_debug.put_line ('rcv_gapless_numbering.generate_invoice_number returned with status = ' || x_return_status );

1726: x_msg_count ,
1727: x_msg_data
1728: );
1729: IF (g_asn_debug = 'Y') THEN
1730: asn_debug.put_line ('rcv_gapless_numbering.generate_invoice_number returned with status = ' || x_return_status );
1731: asn_debug.put_line ('x_invoice_num = ' || x_invoice_num );
1732: END IF;
1733:
1734: IF (x_return_status = fnd_api.g_ret_sts_success and x_invoice_num is NOT NULL)

Line 1731: asn_debug.put_line ('x_invoice_num = ' || x_invoice_num );

1727: x_msg_data
1728: );
1729: IF (g_asn_debug = 'Y') THEN
1730: asn_debug.put_line ('rcv_gapless_numbering.generate_invoice_number returned with status = ' || x_return_status );
1731: asn_debug.put_line ('x_invoice_num = ' || x_invoice_num );
1732: END IF;
1733:
1734: IF (x_return_status = fnd_api.g_ret_sts_success and x_invoice_num is NOT NULL)
1735: THEN

Line 1944: IF (g_asn_debug = 'Y') THEN

1940: X_received_quantity);
1941: exception
1942: WHEN NO_DATA_FOUND THEN
1943:
1944: IF (g_asn_debug = 'Y') THEN
1945: asn_debug.put_line('conversion not defined between uoms '||x_primary_uom||' and '||X_po_uom);
1946:
1947: END IF;
1948: RAISE;

Line 1945: asn_debug.put_line('conversion not defined between uoms '||x_primary_uom||' and '||X_po_uom);

1941: exception
1942: WHEN NO_DATA_FOUND THEN
1943:
1944: IF (g_asn_debug = 'Y') THEN
1945: asn_debug.put_line('conversion not defined between uoms '||x_primary_uom||' and '||X_po_uom);
1946:
1947: END IF;
1948: RAISE;
1949:

Line 1952: IF (g_asn_debug = 'Y') THEN

1948: RAISE;
1949:
1950: WHEN OTHERS THEN
1951:
1952: IF (g_asn_debug = 'Y') THEN
1953: asn_debug.put_line('Exception occured while converting from uom '||x_primary_uom||' to uom '||X_po_uom);
1954: asn_debug.put_line('Check if conversion exists between uoms '||x_primary_uom||' and '||X_po_uom);
1955: END IF;
1956: RAISE;

Line 1953: asn_debug.put_line('Exception occured while converting from uom '||x_primary_uom||' to uom '||X_po_uom);

1949:
1950: WHEN OTHERS THEN
1951:
1952: IF (g_asn_debug = 'Y') THEN
1953: asn_debug.put_line('Exception occured while converting from uom '||x_primary_uom||' to uom '||X_po_uom);
1954: asn_debug.put_line('Check if conversion exists between uoms '||x_primary_uom||' and '||X_po_uom);
1955: END IF;
1956: RAISE;
1957: END;

Line 1954: asn_debug.put_line('Check if conversion exists between uoms '||x_primary_uom||' and '||X_po_uom);

1950: WHEN OTHERS THEN
1951:
1952: IF (g_asn_debug = 'Y') THEN
1953: asn_debug.put_line('Exception occured while converting from uom '||x_primary_uom||' to uom '||X_po_uom);
1954: asn_debug.put_line('Check if conversion exists between uoms '||x_primary_uom||' and '||X_po_uom);
1955: END IF;
1956: RAISE;
1957: END;
1958: ELSE

Line 2223: IF (g_asn_debug = 'Y') THEN

2219: x_po_uom po_lines_all.unit_meas_lookup_code%type; -- Added for bug 6822594
2220: X_conversion_factor NUMBER :=0; -- Added for bug 6822594
2221:
2222: BEGIN
2223: IF (g_asn_debug = 'Y') THEN
2224: asn_debug.put_line('Begin Create Invoice Distributions ');
2225: END IF;
2226:
2227: /********************

Line 2224: asn_debug.put_line('Begin Create Invoice Distributions ');

2220: X_conversion_factor NUMBER :=0; -- Added for bug 6822594
2221:
2222: BEGIN
2223: IF (g_asn_debug = 'Y') THEN
2224: asn_debug.put_line('Begin Create Invoice Distributions ');
2225: END IF;
2226:
2227: /********************
2228: The algorithm for proration is as follows:

Line 2377: IF (g_asn_debug = 'Y') THEN

2373:
2374: /*** call object handler to create the item distributions ***/
2375: X_progress := '140';
2376:
2377: IF (g_asn_debug = 'Y') THEN
2378: asn_debug.put_line('Creating Item Distribution...');
2379: END IF;
2380:
2381:

Line 2378: asn_debug.put_line('Creating Item Distribution...');

2374: /*** call object handler to create the item distributions ***/
2375: X_progress := '140';
2376:
2377: IF (g_asn_debug = 'Y') THEN
2378: asn_debug.put_line('Creating Item Distribution...');
2379: END IF;
2380:
2381:
2382: SELECT NVL(MAX(line_number), 0) + 1

Line 2558: IF (g_asn_debug = 'Y') THEN

2554:
2555: ELSE /** X_count = 0, this should be an error we should have atleast one
2556: distribution for our rcv. txn.**/
2557:
2558: IF (g_asn_debug = 'Y') THEN
2559: asn_debug.put_line('->Error: No distr available.');
2560: END IF;
2561: po_interface_errors_sv1.handle_interface_errors(
2562: X_transaction_type,

Line 2559: asn_debug.put_line('->Error: No distr available.');

2555: ELSE /** X_count = 0, this should be an error we should have atleast one
2556: distribution for our rcv. txn.**/
2557:
2558: IF (g_asn_debug = 'Y') THEN
2559: asn_debug.put_line('->Error: No distr available.');
2560: END IF;
2561: po_interface_errors_sv1.handle_interface_errors(
2562: X_transaction_type,
2563: 'FATAL',

Line 2637: IF (g_asn_debug = 'Y') THEN

2633: l_progress VARCHAR2(3);
2634: BEGIN
2635: l_progress := '000';
2636:
2637: IF (g_asn_debug = 'Y') THEN
2638: ASN_DEBUG.put_line('Enter create use invoices');
2639: END IF;
2640:
2641: x_return_status := FND_API.G_RET_STS_SUCCESS;

Line 2638: ASN_DEBUG.put_line('Enter create use invoices');

2634: BEGIN
2635: l_progress := '000';
2636:
2637: IF (g_asn_debug = 'Y') THEN
2638: ASN_DEBUG.put_line('Enter create use invoices');
2639: END IF;
2640:
2641: x_return_status := FND_API.G_RET_STS_SUCCESS;
2642:

Line 2652: IF (g_asn_debug = 'Y') THEN

2648: THEN
2649: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2650: END IF; -- check api version compatibility
2651:
2652: IF (g_asn_debug = 'Y') THEN
2653: ASN_DEBUG.put_line('API Version Check is passed');
2654: END IF;
2655:
2656: l_progress := '010';

Line 2653: ASN_DEBUG.put_line('API Version Check is passed');

2649: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2650: END IF; -- check api version compatibility
2651:
2652: IF (g_asn_debug = 'Y') THEN
2653: ASN_DEBUG.put_line('API Version Check is passed');
2654: END IF;
2655:
2656: l_progress := '010';
2657:

Line 2658: IF (g_asn_debug = 'Y') THEN

2654: END IF;
2655:
2656: l_progress := '010';
2657:
2658: IF (g_asn_debug = 'Y') THEN
2659: ASN_DEBUG.put_line('Aging period passing in = ' || p_aging_period);
2660: END IF;
2661:
2662: IF (p_aging_period IS NULL) THEN

Line 2659: ASN_DEBUG.put_line('Aging period passing in = ' || p_aging_period);

2655:
2656: l_progress := '010';
2657:
2658: IF (g_asn_debug = 'Y') THEN
2659: ASN_DEBUG.put_line('Aging period passing in = ' || p_aging_period);
2660: END IF;
2661:
2662: IF (p_aging_period IS NULL) THEN
2663:

Line 2664: IF (g_asn_debug = 'Y') THEN

2660: END IF;
2661:
2662: IF (p_aging_period IS NULL) THEN
2663:
2664: IF (g_asn_debug = 'Y') THEN
2665: ASN_DEBUG.put_line('Getting aging period from profile');
2666: END IF;
2667:
2668: l_aging_period :=

Line 2665: ASN_DEBUG.put_line('Getting aging period from profile');

2661:
2662: IF (p_aging_period IS NULL) THEN
2663:
2664: IF (g_asn_debug = 'Y') THEN
2665: ASN_DEBUG.put_line('Getting aging period from profile');
2666: END IF;
2667:
2668: l_aging_period :=
2669: NVL(FLOOR(TO_NUMBER(FND_PROFILE.VALUE('AGING_PERIOD'))), 0);

Line 2671: IF (g_asn_debug = 'Y') THEN

2667:
2668: l_aging_period :=
2669: NVL(FLOOR(TO_NUMBER(FND_PROFILE.VALUE('AGING_PERIOD'))), 0);
2670:
2671: IF (g_asn_debug = 'Y') THEN
2672: ASN_DEBUG.put_line('After getting aging period from profile,
2673: aging period = ' || l_aging_period);
2674: END IF;
2675:

Line 2672: ASN_DEBUG.put_line('After getting aging period from profile,

2668: l_aging_period :=
2669: NVL(FLOOR(TO_NUMBER(FND_PROFILE.VALUE('AGING_PERIOD'))), 0);
2670:
2671: IF (g_asn_debug = 'Y') THEN
2672: ASN_DEBUG.put_line('After getting aging period from profile,
2673: aging period = ' || l_aging_period);
2674: END IF;
2675:
2676: IF (l_aging_period < 0) THEN

Line 2685: IF (g_asn_debug = 'Y') THEN

2681: END IF; -- p_aging_period IS NULL
2682:
2683: l_cutoff_date := TRUNC(SYSDATE) + 1 - l_aging_period;
2684:
2685: IF (g_asn_debug = 'Y') THEN
2686: ASN_DEBUG.put_line('Aging Period = ' || l_aging_period ||
2687: ' Cutoff Date = ' || l_cutoff_date);
2688: END IF;
2689:

Line 2686: ASN_DEBUG.put_line('Aging Period = ' || l_aging_period ||

2682:
2683: l_cutoff_date := TRUNC(SYSDATE) + 1 - l_aging_period;
2684:
2685: IF (g_asn_debug = 'Y') THEN
2686: ASN_DEBUG.put_line('Aging Period = ' || l_aging_period ||
2687: ' Cutoff Date = ' || l_cutoff_date);
2688: END IF;
2689:
2690: l_progress := '020';

Line 2697: IF (g_asn_debug = 'Y') THEN

2693: SELECT base_currency_code
2694: INTO l_def_base_currency_code
2695: FROM ap_system_parameters;
2696:
2697: IF (g_asn_debug = 'Y') THEN
2698: ASN_DEBUG.put_line('Base Currency Code = ' || l_def_base_currency_code);
2699: END IF;
2700:
2701: OPEN PO_INVOICES_SV2.c_consumption(l_cutoff_date);

Line 2698: ASN_DEBUG.put_line('Base Currency Code = ' || l_def_base_currency_code);

2694: INTO l_def_base_currency_code
2695: FROM ap_system_parameters;
2696:
2697: IF (g_asn_debug = 'Y') THEN
2698: ASN_DEBUG.put_line('Base Currency Code = ' || l_def_base_currency_code);
2699: END IF;
2700:
2701: OPEN PO_INVOICES_SV2.c_consumption(l_cutoff_date);
2702:

Line 2703: IF (g_asn_debug = 'Y') THEN

2699: END IF;
2700:
2701: OPEN PO_INVOICES_SV2.c_consumption(l_cutoff_date);
2702:
2703: IF (g_asn_debug = 'Y') THEN
2704: ASN_DEBUG.put_line('Using Bulk Collect. Limit = ' || g_fetch_size);
2705: END IF;
2706:
2707: LOOP

Line 2704: ASN_DEBUG.put_line('Using Bulk Collect. Limit = ' || g_fetch_size);

2700:
2701: OPEN PO_INVOICES_SV2.c_consumption(l_cutoff_date);
2702:
2703: IF (g_asn_debug = 'Y') THEN
2704: ASN_DEBUG.put_line('Using Bulk Collect. Limit = ' || g_fetch_size);
2705: END IF;
2706:
2707: LOOP
2708: l_progress := '030';

Line 2710: IF (g_asn_debug = 'Y') THEN

2706:
2707: LOOP
2708: l_progress := '030';
2709:
2710: IF (g_asn_debug = 'Y') THEN
2711: ASN_DEBUG.put_line('In Outer Loop');
2712: END IF;
2713:
2714: l_commit_lower := 1;

Line 2711: ASN_DEBUG.put_line('In Outer Loop');

2707: LOOP
2708: l_progress := '030';
2709:
2710: IF (g_asn_debug = 'Y') THEN
2711: ASN_DEBUG.put_line('In Outer Loop');
2712: END IF;
2713:
2714: l_commit_lower := 1;
2715: l_commit_upper := 0;

Line 2744: IF (g_asn_debug = 'Y') THEN

2740: l_consumption.unit_meas_lookup_code
2741: LIMIT g_fetch_size;
2742:
2743: l_progress := '040';
2744: IF (g_asn_debug = 'Y') THEN
2745: ASN_DEBUG.put_line('After Bulk Collect. Fetched ' ||
2746: l_consumption.po_header_id.COUNT || ' records');
2747: END IF;
2748:

Line 2745: ASN_DEBUG.put_line('After Bulk Collect. Fetched ' ||

2741: LIMIT g_fetch_size;
2742:
2743: l_progress := '040';
2744: IF (g_asn_debug = 'Y') THEN
2745: ASN_DEBUG.put_line('After Bulk Collect. Fetched ' ||
2746: l_consumption.po_header_id.COUNT || ' records');
2747: END IF;
2748:
2749: FOR i IN 1..l_consumption.po_header_id.COUNT LOOP

Line 2751: IF (g_asn_debug = 'Y') THEN

2747: END IF;
2748:
2749: FOR i IN 1..l_consumption.po_header_id.COUNT LOOP
2750:
2751: IF (g_asn_debug = 'Y') THEN
2752: ASN_DEBUG.put_line('In Inner Loop. i = ' || i);
2753: END IF;
2754:
2755: IF (l_first_flag = FND_API.G_TRUE) THEN

Line 2752: ASN_DEBUG.put_line('In Inner Loop. i = ' || i);

2748:
2749: FOR i IN 1..l_consumption.po_header_id.COUNT LOOP
2750:
2751: IF (g_asn_debug = 'Y') THEN
2752: ASN_DEBUG.put_line('In Inner Loop. i = ' || i);
2753: END IF;
2754:
2755: IF (l_first_flag = FND_API.G_TRUE) THEN
2756: l_progress := '050';

Line 2760: IF (g_asn_debug = 'Y') THEN

2756: l_progress := '050';
2757:
2758: l_first_flag := FND_API.G_FALSE;
2759:
2760: IF (g_asn_debug = 'Y') THEN
2761: ASN_DEBUG.put_line('First Record.');
2762: END IF;
2763:
2764: l_org_id := l_consumption.org_id(i);

Line 2761: ASN_DEBUG.put_line('First Record.');

2757:
2758: l_first_flag := FND_API.G_FALSE;
2759:
2760: IF (g_asn_debug = 'Y') THEN
2761: ASN_DEBUG.put_line('First Record.');
2762: END IF;
2763:
2764: l_org_id := l_consumption.org_id(i);
2765:

Line 2771: IF (g_asn_debug = 'Y') THEN

2767: SELECT 'USE-' || ap_interface_groups_s.nextval
2768: INTO l_group_id
2769: FROM sys.dual;
2770:
2771: IF (g_asn_debug = 'Y') THEN
2772: ASN_DEBUG.put_line('group_id = ' || l_group_id);
2773: END IF;
2774:
2775: -- get invoice description

Line 2772: ASN_DEBUG.put_line('group_id = ' || l_group_id);

2768: INTO l_group_id
2769: FROM sys.dual;
2770:
2771: IF (g_asn_debug = 'Y') THEN
2772: ASN_DEBUG.put_line('group_id = ' || l_group_id);
2773: END IF;
2774:
2775: -- get invoice description
2776: FND_MESSAGE.set_name('PO', 'PO_INV_CR_USE_INVOICE_DESC');

Line 2780: IF (g_asn_debug = 'Y') THEN

2776: FND_MESSAGE.set_name('PO', 'PO_INV_CR_USE_INVOICE_DESC');
2777: FND_MESSAGE.set_token('RUN_DATE', sysdate);
2778: l_invoice_desc := FND_MESSAGE.get;
2779:
2780: IF (g_asn_debug = 'Y') THEN
2781: ASN_DEBUG.put_line('invoice_desc = ' || l_invoice_desc);
2782: END IF;
2783: PO_INVOICES_SV2.reset_header_values(
2784: l_return_status,

Line 2781: ASN_DEBUG.put_line('invoice_desc = ' || l_invoice_desc);

2777: FND_MESSAGE.set_token('RUN_DATE', sysdate);
2778: l_invoice_desc := FND_MESSAGE.get;
2779:
2780: IF (g_asn_debug = 'Y') THEN
2781: ASN_DEBUG.put_line('invoice_desc = ' || l_invoice_desc);
2782: END IF;
2783: PO_INVOICES_SV2.reset_header_values(
2784: l_return_status,
2785: l_consumption,

Line 2793: IF (g_asn_debug = 'Y') THEN

2789: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
2790: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2791: END IF;
2792:
2793: IF (g_asn_debug = 'Y') THEN
2794: ASN_DEBUG.put_line('Done Initializing Header variables.');
2795: END IF;
2796:
2797: END IF; -- l_first_flag = FND_API.G_TRUE

Line 2794: ASN_DEBUG.put_line('Done Initializing Header variables.');

2790: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2791: END IF;
2792:
2793: IF (g_asn_debug = 'Y') THEN
2794: ASN_DEBUG.put_line('Done Initializing Header variables.');
2795: END IF;
2796:
2797: END IF; -- l_first_flag = FND_API.G_TRUE
2798:

Line 2810: IF (g_asn_debug = 'Y') THEN

2806: l_progress := '060';
2807:
2808: l_header_idx := l_header_idx + 1;
2809:
2810: IF (g_asn_debug = 'Y') THEN
2811: ASN_DEBUG.put_line('Invoice header needs to be created for ' ||
2812: 'previous records.');
2813: END IF;
2814:

Line 2811: ASN_DEBUG.put_line('Invoice header needs to be created for ' ||

2807:
2808: l_header_idx := l_header_idx + 1;
2809:
2810: IF (g_asn_debug = 'Y') THEN
2811: ASN_DEBUG.put_line('Invoice header needs to be created for ' ||
2812: 'previous records.');
2813: END IF;
2814:
2815: IF (g_asn_debug = 'Y') THEN

Line 2815: IF (g_asn_debug = 'Y') THEN

2811: ASN_DEBUG.put_line('Invoice header needs to be created for ' ||
2812: 'previous records.');
2813: END IF;
2814:
2815: IF (g_asn_debug = 'Y') THEN
2816: ASN_DEBUG.put_line('# of lines for this invoice = ' ||
2817: l_distr_count);
2818: END IF;
2819:

Line 2816: ASN_DEBUG.put_line('# of lines for this invoice = ' ||

2812: 'previous records.');
2813: END IF;
2814:
2815: IF (g_asn_debug = 'Y') THEN
2816: ASN_DEBUG.put_line('# of lines for this invoice = ' ||
2817: l_distr_count);
2818: END IF;
2819:
2820: l_progress := '065';

Line 2835: IF (g_asn_debug = 'Y') THEN

2831: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
2832: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2833: END IF;
2834:
2835: IF (g_asn_debug = 'Y') THEN
2836: ASN_DEBUG.put_line('Stored Header Information into table');
2837: END IF;
2838:
2839: l_distr_count := 0;

Line 2836: ASN_DEBUG.put_line('Stored Header Information into table');

2832: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2833: END IF;
2834:
2835: IF (g_asn_debug = 'Y') THEN
2836: ASN_DEBUG.put_line('Stored Header Information into table');
2837: END IF;
2838:
2839: l_distr_count := 0;
2840: l_invoice_count := l_invoice_count + 1;

Line 2852: IF (g_asn_debug = 'Y') THEN

2848: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
2849: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2850: END IF;
2851:
2852: IF (g_asn_debug = 'Y') THEN
2853: ASN_DEBUG.put_line('Done Resetting Header Variables');
2854: ASN_DEBUG.put_line('# of headers created after last commit= ' ||
2855: l_header_idx || ' Commit interval= ' ||
2856: p_commit_interval);

Line 2853: ASN_DEBUG.put_line('Done Resetting Header Variables');

2849: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2850: END IF;
2851:
2852: IF (g_asn_debug = 'Y') THEN
2853: ASN_DEBUG.put_line('Done Resetting Header Variables');
2854: ASN_DEBUG.put_line('# of headers created after last commit= ' ||
2855: l_header_idx || ' Commit interval= ' ||
2856: p_commit_interval);
2857: END IF;

Line 2854: ASN_DEBUG.put_line('# of headers created after last commit= ' ||

2850: END IF;
2851:
2852: IF (g_asn_debug = 'Y') THEN
2853: ASN_DEBUG.put_line('Done Resetting Header Variables');
2854: ASN_DEBUG.put_line('# of headers created after last commit= ' ||
2855: l_header_idx || ' Commit interval= ' ||
2856: p_commit_interval);
2857: END IF;
2858:

Line 2865: IF (g_asn_debug = 'Y') THEN

2861: -- created so far needs to be inserted and committed.
2862:
2863: l_progress := '070';
2864:
2865: IF (g_asn_debug = 'Y') THEN
2866: ASN_DEBUG.put_line('Bulk Insert into header interface');
2867: END IF;
2868:
2869: PO_INVOICES_SV2.create_invoice_hdr(

Line 2866: ASN_DEBUG.put_line('Bulk Insert into header interface');

2862:
2863: l_progress := '070';
2864:
2865: IF (g_asn_debug = 'Y') THEN
2866: ASN_DEBUG.put_line('Bulk Insert into header interface');
2867: END IF;
2868:
2869: PO_INVOICES_SV2.create_invoice_hdr(
2870: l_return_status,

Line 2881: IF (g_asn_debug = 'Y') THEN

2877: END IF;
2878:
2879: l_progress := '073';
2880:
2881: IF (g_asn_debug = 'Y') THEN
2882: ASN_DEBUG.put_line('Bulk Insert into line interface');
2883: END IF;
2884:
2885: PO_INVOICES_SV2.create_invoice_distr(

Line 2882: ASN_DEBUG.put_line('Bulk Insert into line interface');

2878:
2879: l_progress := '073';
2880:
2881: IF (g_asn_debug = 'Y') THEN
2882: ASN_DEBUG.put_line('Bulk Insert into line interface');
2883: END IF;
2884:
2885: PO_INVOICES_SV2.create_invoice_distr(
2886: l_return_status,

Line 2902: IF (g_asn_debug = 'Y') THEN

2898: l_header_idx := 0;
2899: COMMIT;
2900:
2901: l_progress := '080';
2902: IF (g_asn_debug = 'Y') THEN
2903: ASN_DEBUG.put_line('After commit');
2904: END IF;
2905:
2906: END IF; -- l_header_idx = p_commit_interval

Line 2903: ASN_DEBUG.put_line('After commit');

2899: COMMIT;
2900:
2901: l_progress := '080';
2902: IF (g_asn_debug = 'Y') THEN
2903: ASN_DEBUG.put_line('After commit');
2904: END IF;
2905:
2906: END IF; -- l_header_idx = p_commit_interval
2907:

Line 2916: IF (g_asn_debug = 'Y') THEN

2912: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2913: END IF;
2914:
2915: l_progress := '090';
2916: IF (g_asn_debug = 'Y') THEN
2917: ASN_DEBUG.put_line('Deriving more line information');
2918: END IF;
2919:
2920: l_distr_count := l_distr_count + 1;

Line 2917: ASN_DEBUG.put_line('Deriving more line information');

2913: END IF;
2914:
2915: l_progress := '090';
2916: IF (g_asn_debug = 'Y') THEN
2917: ASN_DEBUG.put_line('Deriving more line information');
2918: END IF;
2919:
2920: l_distr_count := l_distr_count + 1;
2921:

Line 2929: IF (g_asn_debug = 'Y') THEN

2925: l_consumption.quantity_invoiced(i) :=
2926: l_consumption.quantity_ordered(i) -
2927: l_consumption.quantity_billed(i);
2928:
2929: IF (g_asn_debug = 'Y') THEN
2930: ASN_DEBUG.put_line('po_distribution_id = ' ||
2931: l_consumption.po_distribution_id(i) ||
2932: 'Quantity to invoice = ' ||
2933: l_consumption.quantity_invoiced(i));

Line 2930: ASN_DEBUG.put_line('po_distribution_id = ' ||

2926: l_consumption.quantity_ordered(i) -
2927: l_consumption.quantity_billed(i);
2928:
2929: IF (g_asn_debug = 'Y') THEN
2930: ASN_DEBUG.put_line('po_distribution_id = ' ||
2931: l_consumption.po_distribution_id(i) ||
2932: 'Quantity to invoice = ' ||
2933: l_consumption.quantity_invoiced(i));
2934: END IF;

Line 2949: IF (g_asn_debug = 'Y') THEN

2945: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
2946: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2947: END IF;
2948:
2949: IF (g_asn_debug = 'Y') THEN
2950: ASN_DEBUG.put_line('line_amount = ' ||
2951: l_consumption.invoice_line_amount(i));
2952: ASN_DEBUG.put_line('Cumu. Invoive amt = '||l_curr.invoice_amount);
2953: END IF;

Line 2950: ASN_DEBUG.put_line('line_amount = ' ||

2946: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2947: END IF;
2948:
2949: IF (g_asn_debug = 'Y') THEN
2950: ASN_DEBUG.put_line('line_amount = ' ||
2951: l_consumption.invoice_line_amount(i));
2952: ASN_DEBUG.put_line('Cumu. Invoive amt = '||l_curr.invoice_amount);
2953: END IF;
2954:

Line 2952: ASN_DEBUG.put_line('Cumu. Invoive amt = '||l_curr.invoice_amount);

2948:
2949: IF (g_asn_debug = 'Y') THEN
2950: ASN_DEBUG.put_line('line_amount = ' ||
2951: l_consumption.invoice_line_amount(i));
2952: ASN_DEBUG.put_line('Cumu. Invoive amt = '||l_curr.invoice_amount);
2953: END IF;
2954:
2955: l_commit_upper := l_commit_upper + 1;
2956:

Line 2964: IF (g_asn_debug = 'Y') THEN

2960:
2961: -- l_curr.invoice_date := l_consumption.creation_date(i);
2962:
2963:
2964: IF (g_asn_debug = 'Y') THEN
2965: ASN_DEBUG.put_line('-*-*-*-*-*- Done with one line -*-*-*-*-*-');
2966: END IF;
2967: END LOOP; -- for i in 1.. po_header_id.count
2968:

Line 2965: ASN_DEBUG.put_line('-*-*-*-*-*- Done with one line -*-*-*-*-*-');

2961: -- l_curr.invoice_date := l_consumption.creation_date(i);
2962:
2963:
2964: IF (g_asn_debug = 'Y') THEN
2965: ASN_DEBUG.put_line('-*-*-*-*-*- Done with one line -*-*-*-*-*-');
2966: END IF;
2967: END LOOP; -- for i in 1.. po_header_id.count
2968:
2969: l_progress := '100';

Line 2971: IF (g_asn_debug = 'Y') THEN

2967: END LOOP; -- for i in 1.. po_header_id.count
2968:
2969: l_progress := '100';
2970:
2971: IF (g_asn_debug = 'Y') THEN
2972: ASN_DEBUG.put_line('Exit inner loop');
2973: END IF;
2974:
2975: IF (g_asn_debug = 'Y') THEN

Line 2972: ASN_DEBUG.put_line('Exit inner loop');

2968:
2969: l_progress := '100';
2970:
2971: IF (g_asn_debug = 'Y') THEN
2972: ASN_DEBUG.put_line('Exit inner loop');
2973: END IF;
2974:
2975: IF (g_asn_debug = 'Y') THEN
2976: ASN_DEBUG.put_line('Insert remaining distributions from pl/sql table'

Line 2975: IF (g_asn_debug = 'Y') THEN

2971: IF (g_asn_debug = 'Y') THEN
2972: ASN_DEBUG.put_line('Exit inner loop');
2973: END IF;
2974:
2975: IF (g_asn_debug = 'Y') THEN
2976: ASN_DEBUG.put_line('Insert remaining distributions from pl/sql table'
2977: || ' to lines interface table');
2978: END IF;
2979:

Line 2976: ASN_DEBUG.put_line('Insert remaining distributions from pl/sql table'

2972: ASN_DEBUG.put_line('Exit inner loop');
2973: END IF;
2974:
2975: IF (g_asn_debug = 'Y') THEN
2976: ASN_DEBUG.put_line('Insert remaining distributions from pl/sql table'
2977: || ' to lines interface table');
2978: END IF;
2979:
2980: PO_INVOICES_SV2.create_invoice_distr(

Line 2995: IF (g_asn_debug = 'Y') THEN

2991:
2992: END LOOP; -- loop for bulk fetching consumption advice
2993:
2994: l_progress := '110';
2995: IF (g_asn_debug = 'Y') THEN
2996: ASN_DEBUG.put_line('Exit outer loop');
2997: END IF;
2998:
2999: IF c_consumption%ISOPEN THEN

Line 2996: ASN_DEBUG.put_line('Exit outer loop');

2992: END LOOP; -- loop for bulk fetching consumption advice
2993:
2994: l_progress := '110';
2995: IF (g_asn_debug = 'Y') THEN
2996: ASN_DEBUG.put_line('Exit outer loop');
2997: END IF;
2998:
2999: IF c_consumption%ISOPEN THEN
3000: CLOSE c_consumption;

Line 3004: IF (g_asn_debug = 'Y') THEN

3000: CLOSE c_consumption;
3001: END IF;
3002:
3003: IF (l_distr_count > 0) THEN
3004: IF (g_asn_debug = 'Y') THEN
3005: ASN_DEBUG.put_line('l_distr_count = ' || l_distr_count || '. Need to' ||
3006: ' perform some clean up work.');
3007: END IF;
3008:

Line 3005: ASN_DEBUG.put_line('l_distr_count = ' || l_distr_count || '. Need to' ||

3001: END IF;
3002:
3003: IF (l_distr_count > 0) THEN
3004: IF (g_asn_debug = 'Y') THEN
3005: ASN_DEBUG.put_line('l_distr_count = ' || l_distr_count || '. Need to' ||
3006: ' perform some clean up work.');
3007: END IF;
3008:
3009: l_header_idx := l_header_idx + 1;

Line 3011: IF (g_asn_debug = 'Y') THEN

3007: END IF;
3008:
3009: l_header_idx := l_header_idx + 1;
3010:
3011: IF (g_asn_debug = 'Y') THEN
3012: ASN_DEBUG.put_line('# of headers created after last commit= ' ||
3013: l_header_idx);
3014: END IF;
3015:

Line 3012: ASN_DEBUG.put_line('# of headers created after last commit= ' ||

3008:
3009: l_header_idx := l_header_idx + 1;
3010:
3011: IF (g_asn_debug = 'Y') THEN
3012: ASN_DEBUG.put_line('# of headers created after last commit= ' ||
3013: l_header_idx);
3014: END IF;
3015:
3016: PO_INVOICES_SV2.store_header_info(

Line 3030: IF (g_asn_debug = 'Y') THEN

3026: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3027: END IF;
3028:
3029: l_progress := '120';
3030: IF (g_asn_debug = 'Y') THEN
3031: ASN_DEBUG.put_line('Insert remaining invoice headers');
3032: END IF;
3033:
3034: PO_INVOICES_SV2.create_invoice_hdr(

Line 3031: ASN_DEBUG.put_line('Insert remaining invoice headers');

3027: END IF;
3028:
3029: l_progress := '120';
3030: IF (g_asn_debug = 'Y') THEN
3031: ASN_DEBUG.put_line('Insert remaining invoice headers');
3032: END IF;
3033:
3034: PO_INVOICES_SV2.create_invoice_hdr(
3035: l_return_status,

Line 3047: IF (g_asn_debug = 'Y') THEN

3043:
3044: COMMIT;
3045:
3046: l_progress := '130';
3047: IF (g_asn_debug = 'Y') THEN
3048: ASN_DEBUG.put_line('Call invoice import program');
3049: END IF;
3050:
3051: SELECT ap_batches_s.nextval

Line 3048: ASN_DEBUG.put_line('Call invoice import program');

3044: COMMIT;
3045:
3046: l_progress := '130';
3047: IF (g_asn_debug = 'Y') THEN
3048: ASN_DEBUG.put_line('Call invoice import program');
3049: END IF;
3050:
3051: SELECT ap_batches_s.nextval
3052: INTO l_tmp_batch_id

Line 3059: IF (g_asn_debug = 'Y') THEN

3055: FND_MESSAGE.set_name('PO', 'PO_INV_CR_USE_BATCH_DESC');
3056: l_batch_name := FND_MESSAGE.get || '/' || TO_CHAR(sysdate) ||
3057: '/' || TO_CHAR(l_tmp_batch_id);
3058:
3059: IF (g_asn_debug = 'Y') THEN
3060: ASN_DEBUG.put_line('Batch name = ' || l_batch_name);
3061: END IF;
3062:
3063: l_user_id := NULL;

Line 3060: ASN_DEBUG.put_line('Batch name = ' || l_batch_name);

3056: l_batch_name := FND_MESSAGE.get || '/' || TO_CHAR(sysdate) ||
3057: '/' || TO_CHAR(l_tmp_batch_id);
3058:
3059: IF (g_asn_debug = 'Y') THEN
3060: ASN_DEBUG.put_line('Batch name = ' || l_batch_name);
3061: END IF;
3062:
3063: l_user_id := NULL;
3064: l_login_id := NULL;

Line 3084: IF (g_asn_debug = 'Y') THEN

3080:
3081: FND_MESSAGE.set_name('PO', 'PO_ERS_CONC_REQUEST_CHECK');
3082: FND_MESSAGE.set_token('REQUEST', TO_CHAR(l_request_id));
3083: FND_MESSAGE.set_token('BATCH', l_batch_name);
3084: IF (g_asn_debug = 'Y') THEN
3085: ASN_DEBUG.put_line(FND_MESSAGE.get);
3086: END IF;
3087:
3088: END IF; -- l_distr_count > 0

Line 3085: ASN_DEBUG.put_line(FND_MESSAGE.get);

3081: FND_MESSAGE.set_name('PO', 'PO_ERS_CONC_REQUEST_CHECK');
3082: FND_MESSAGE.set_token('REQUEST', TO_CHAR(l_request_id));
3083: FND_MESSAGE.set_token('BATCH', l_batch_name);
3084: IF (g_asn_debug = 'Y') THEN
3085: ASN_DEBUG.put_line(FND_MESSAGE.get);
3086: END IF;
3087:
3088: END IF; -- l_distr_count > 0
3089:

Line 3090: IF (g_asn_debug = 'Y') THEN

3086: END IF;
3087:
3088: END IF; -- l_distr_count > 0
3089:
3090: IF (g_asn_debug = 'Y') THEN
3091: ASN_DEBUG.put_line('Exit create_use_invoices');
3092: END IF;
3093:
3094: EXCEPTION

Line 3091: ASN_DEBUG.put_line('Exit create_use_invoices');

3087:
3088: END IF; -- l_distr_count > 0
3089:
3090: IF (g_asn_debug = 'Y') THEN
3091: ASN_DEBUG.put_line('Exit create_use_invoices');
3092: END IF;
3093:
3094: EXCEPTION
3095: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN

Line 3098: IF (g_asn_debug = 'Y') THEN

3094: EXCEPTION
3095: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3096: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3097: l_error_msg := FND_MSG_PUB.get(p_encoded => 'F');
3098: IF (g_asn_debug = 'Y') THEN
3099: ASN_DEBUG.put_line(l_api_name || '-' || l_progress);
3100: ASN_DEBUG.put_line(l_error_msg);
3101: END IF;
3102:

Line 3099: ASN_DEBUG.put_line(l_api_name || '-' || l_progress);

3095: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3096: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3097: l_error_msg := FND_MSG_PUB.get(p_encoded => 'F');
3098: IF (g_asn_debug = 'Y') THEN
3099: ASN_DEBUG.put_line(l_api_name || '-' || l_progress);
3100: ASN_DEBUG.put_line(l_error_msg);
3101: END IF;
3102:
3103: IF c_consumption%ISOPEN THEN

Line 3100: ASN_DEBUG.put_line(l_error_msg);

3096: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3097: l_error_msg := FND_MSG_PUB.get(p_encoded => 'F');
3098: IF (g_asn_debug = 'Y') THEN
3099: ASN_DEBUG.put_line(l_api_name || '-' || l_progress);
3100: ASN_DEBUG.put_line(l_error_msg);
3101: END IF;
3102:
3103: IF c_consumption%ISOPEN THEN
3104: CLOSE c_consumption;

Line 3118: IF (g_asn_debug = 'Y') THEN

3114: WHEN OTHERS THEN
3115: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3116: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name);
3117: l_error_msg := FND_MSG_PUB.get(p_encoded => 'F');
3118: IF (g_asn_debug = 'Y') THEN
3119: ASN_DEBUG.put_line(l_api_name || '-' || l_progress);
3120: ASN_DEBUG.put_line(l_error_msg);
3121: END IF;
3122:

Line 3119: ASN_DEBUG.put_line(l_api_name || '-' || l_progress);

3115: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3116: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name);
3117: l_error_msg := FND_MSG_PUB.get(p_encoded => 'F');
3118: IF (g_asn_debug = 'Y') THEN
3119: ASN_DEBUG.put_line(l_api_name || '-' || l_progress);
3120: ASN_DEBUG.put_line(l_error_msg);
3121: END IF;
3122:
3123: IF c_consumption%ISOPEN THEN

Line 3120: ASN_DEBUG.put_line(l_error_msg);

3116: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name);
3117: l_error_msg := FND_MSG_PUB.get(p_encoded => 'F');
3118: IF (g_asn_debug = 'Y') THEN
3119: ASN_DEBUG.put_line(l_api_name || '-' || l_progress);
3120: ASN_DEBUG.put_line(l_error_msg);
3121: END IF;
3122:
3123: IF c_consumption%ISOPEN THEN
3124: CLOSE c_consumption;

Line 3213: IF (g_asn_debug = 'Y') THEN

3209: l_api_name VARCHAR2(50) := 'store_header_info';
3210: BEGIN
3211: x_return_status := FND_API.G_RET_STS_SUCCESS;
3212:
3213: IF (g_asn_debug = 'Y') THEN
3214: ASN_DEBUG.put_line('Storing header data into PL/SQL tables');
3215: END IF;
3216:
3217: x_ap_inv_header.invoice_num(p_index) :=

Line 3214: ASN_DEBUG.put_line('Storing header data into PL/SQL tables');

3210: BEGIN
3211: x_return_status := FND_API.G_RET_STS_SUCCESS;
3212:
3213: IF (g_asn_debug = 'Y') THEN
3214: ASN_DEBUG.put_line('Storing header data into PL/SQL tables');
3215: END IF;
3216:
3217: x_ap_inv_header.invoice_num(p_index) :=
3218: PO_INVOICES_SV2.create_invoice_num(

Line 3244: IF (g_asn_debug = 'Y') THEN

3240: x_ap_inv_header.terms_id(p_index) := p_curr.payment_terms_id;
3241: x_ap_inv_header.group_id(p_index) := p_group_id;
3242: x_ap_inv_header.org_id(p_index) := p_org_id;
3243:
3244: IF (g_asn_debug = 'Y') THEN
3245: ASN_DEBUG.put_line('Invoice id = ' || x_ap_inv_header.invoice_id(p_index));
3246: END IF;
3247: EXCEPTION
3248: WHEN OTHERS THEN

Line 3245: ASN_DEBUG.put_line('Invoice id = ' || x_ap_inv_header.invoice_id(p_index));

3241: x_ap_inv_header.group_id(p_index) := p_group_id;
3242: x_ap_inv_header.org_id(p_index) := p_org_id;
3243:
3244: IF (g_asn_debug = 'Y') THEN
3245: ASN_DEBUG.put_line('Invoice id = ' || x_ap_inv_header.invoice_id(p_index));
3246: END IF;
3247: EXCEPTION
3248: WHEN OTHERS THEN
3249: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

Line 3341: IF (g_asn_debug = 'Y') THEN

3337: x_invoice_line_amount := AP_UTILITIES_PKG.ap_round_currency(
3338: p_quantity * p_unit_price,
3339: p_invoice_currency_code);
3340:
3341: IF (g_asn_debug = 'Y') THEN
3342: ASN_DEBUG.put_line('line amount = ' || x_invoice_line_amount);
3343: END IF;
3344:
3345: x_curr_invoice_amount := x_curr_invoice_amount + x_invoice_line_amount;

Line 3342: ASN_DEBUG.put_line('line amount = ' || x_invoice_line_amount);

3338: p_quantity * p_unit_price,
3339: p_invoice_currency_code);
3340:
3341: IF (g_asn_debug = 'Y') THEN
3342: ASN_DEBUG.put_line('line amount = ' || x_invoice_line_amount);
3343: END IF;
3344:
3345: x_curr_invoice_amount := x_curr_invoice_amount + x_invoice_line_amount;
3346: EXCEPTION