DBA Data[Home] [Help]

APPS.RCV_CHARGES_GRP dependencies on ASN_DEBUG

Line 7: g_asn_debug VARCHAR2(1) := NVL(fnd_profile.VALUE('RCV_DEBUG_MODE'), 'N');

3:
4: -- package globals
5: g_base_weight_uom mtl_units_of_measure.unit_of_measure%TYPE;
6: g_base_volume_uom mtl_units_of_measure.unit_of_measure%TYPE;
7: g_asn_debug VARCHAR2(1) := NVL(fnd_profile.VALUE('RCV_DEBUG_MODE'), 'N');
8:
9: UNKNOWN_ALLOCATION_METHOD EXCEPTION;
10:
11: FUNCTION get_base_weight_uom

Line 132: asn_debug.put_line('Invalid cost factor id: ' || p_charge_record.cost_factor_id);

128:
129: IF pon_cf_type_grp.get_cost_factor_details(p_charge_record.cost_factor_id)
130: .price_element_type_id IS NULL
131: THEN
132: asn_debug.put_line('Invalid cost factor id: ' || p_charge_record.cost_factor_id);
133: rcv_error_pkg.set_error_message('RCV_INVALID_ROI_VALUE');
134: rcv_error_pkg.set_token('COLUMN', 'COST_FACTOR_ID');
135: rcv_error_pkg.set_token('ROI_VALUE', p_charge_record.cost_factor_id);
136: rcv_error_pkg.set_token('SYS_VALUE', '');

Line 169: asn_debug.put_line('validate_vendor_info returned error: vendor_id: ' || p_charge_record.vendor_id);

165: l_vendor_record.vendor_id := p_charge_record.vendor_id;
166: po_vendors_sv.validate_vendor_info(l_vendor_record);
167:
168: IF l_vendor_record.error_record.error_status = 'E' THEN
169: asn_debug.put_line('validate_vendor_info returned error: vendor_id: ' || p_charge_record.vendor_id);
170: IF l_vendor_record.error_record.error_message = 'VEN_DISABLED' THEN
171: asn_debug.put_line('Invalid vendor id: ' || p_charge_record.vendor_id);
172: rcv_error_pkg.set_error_message('PO_PDOI_INVALID_VENDOR');
173: rcv_error_pkg.set_token('VALUE', l_vendor_record.vendor_id);

Line 171: asn_debug.put_line('Invalid vendor id: ' || p_charge_record.vendor_id);

167:
168: IF l_vendor_record.error_record.error_status = 'E' THEN
169: asn_debug.put_line('validate_vendor_info returned error: vendor_id: ' || p_charge_record.vendor_id);
170: IF l_vendor_record.error_record.error_message = 'VEN_DISABLED' THEN
171: asn_debug.put_line('Invalid vendor id: ' || p_charge_record.vendor_id);
172: rcv_error_pkg.set_error_message('PO_PDOI_INVALID_VENDOR');
173: rcv_error_pkg.set_token('VALUE', l_vendor_record.vendor_id);
174: rcv_error_pkg.log_interface_error( 'RCV_CHARGES_INTERFACE'
175: , 'VENDOR_ID'

Line 179: asn_debug.put_line('Invalid vendor id: ' || p_charge_record.vendor_id);

175: , 'VENDOR_ID'
176: , FALSE
177: );
178: ELSIF l_vendor_record.error_record.error_message = 'VEN_HOLD' THEN
179: asn_debug.put_line('Invalid vendor id: ' || p_charge_record.vendor_id);
180: rcv_error_pkg.set_error_message('PO_PO_VENDOR_ON_HOLD');
181: rcv_error_pkg.set_token('VALUE', l_vendor_record.vendor_id);
182: rcv_error_pkg.log_interface_error( 'RCV_CHARGES_INTERFACE'
183: , 'VENDOR_ID'

Line 187: asn_debug.put_line('Invalid vendor id: ' || p_charge_record.vendor_id);

183: , 'VENDOR_ID'
184: , FALSE
185: );
186: ELSIF l_vendor_record.error_record.error_message = 'VEN_ID' THEN
187: asn_debug.put_line('Invalid vendor id: ' || p_charge_record.vendor_id);
188: rcv_error_pkg.set_error_message('RCV_VEN_ID');
189: rcv_error_pkg.set_token('SUPPLIER', l_vendor_record.vendor_id);
190: rcv_error_pkg.log_interface_error( 'RCV_CHARGES_INTERFACE'
191: , 'VENDOR_ID'

Line 222: asn_debug.put_line('validate_vendor_site_info returned error: vendor_id: ' || p_charge_record.vendor_id || ' vendor_site_id: ' || p_charge_record.vendor_site_id);

218: l_vendor_site_record.vendor_site_id := p_charge_record.vendor_site_id;
219: po_vendor_sites_sv.validate_vendor_site_info(l_vendor_site_record);
220:
221: IF l_vendor_site_record.error_record.error_status = 'E' THEN
222: asn_debug.put_line('validate_vendor_site_info returned error: vendor_id: ' || p_charge_record.vendor_id || ' vendor_site_id: ' || p_charge_record.vendor_site_id);
223: IF l_vendor_site_record.error_record.error_message IN
224: ('VEN_SITE_ID', 'VEN_SITE_DISABLED', 'VEN_SITE_NOT_PURCH')
225: THEN
226: asn_debug.put_line('Invalid vendor site id: ' || p_charge_record.vendor_site_id);

Line 226: asn_debug.put_line('Invalid vendor site id: ' || p_charge_record.vendor_site_id);

222: asn_debug.put_line('validate_vendor_site_info returned error: vendor_id: ' || p_charge_record.vendor_id || ' vendor_site_id: ' || p_charge_record.vendor_site_id);
223: IF l_vendor_site_record.error_record.error_message IN
224: ('VEN_SITE_ID', 'VEN_SITE_DISABLED', 'VEN_SITE_NOT_PURCH')
225: THEN
226: asn_debug.put_line('Invalid vendor site id: ' || p_charge_record.vendor_site_id);
227: rcv_error_pkg.set_error_message('PO_PDOI_INVALID_VENDOR_SITE');
228: rcv_error_pkg.set_token('VALUE', l_vendor_site_record.vendor_site_id);
229: rcv_error_pkg.log_interface_error( 'RCV_HEADERS_INTERFACE'
230: , 'VENDOR_SITE_ID'

Line 440: asn_debug.put_line('Prorating across ' || p_prorate_table.COUNT || ' rows');

436: l_remaining_actual_amount NUMBER;
437: l_precision NUMBER;
438: j NUMBER;
439: BEGIN
440: asn_debug.put_line('Prorating across ' || p_prorate_table.COUNT || ' rows');
441:
442: IF p_id_table.COUNT < 1 OR p_prorate_table.COUNT < 1 THEN
443: RETURN;
444: END IF;

Line 758: asn_debug.put_line('Allocating header level charge by value for shipment header id ' || p_charge.shipment_header_id);

754: ) IS
755: l_shipment_line_ids dbms_utility.number_array;
756: l_shipment_line_amounts dbms_utility.number_array;
757: BEGIN
758: asn_debug.put_line('Allocating header level charge by value for shipment header id ' || p_charge.shipment_header_id);
759:
760: -- get the item values to allocate across
761: SELECT rsl.shipment_line_id
762: , decode(rsl.quantity_received, 0, rsl.quantity_shipped, rsl.quantity_received) * pol.unit_price

Line 770: asn_debug.put_line('id: ' || l_shipment_line_ids.count || ' amt: ' || l_shipment_line_amounts.count);

766: , po_lines_all pol
767: WHERE rsl.shipment_header_id = p_charge.shipment_header_id
768: AND pol.po_line_id = rsl.po_line_id;
769:
770: asn_debug.put_line('id: ' || l_shipment_line_ids.count || ' amt: ' || l_shipment_line_amounts.count);
771:
772: -- prorate the charge according to the amounts
773: Prorate_Charge( p_charge
774: , p_charge_allocation_table

Line 807: asn_debug.put_line('Unknown allocation method: ' || p_charge.allocation_method);

803: Allocate_Charge_By_Value( p_charge
804: , p_charge_allocation_table
805: );
806: ELSE
807: asn_debug.put_line('Unknown allocation method: ' || p_charge.allocation_method);
808: rcv_error_pkg.set_error_message('RCV_UNKNOWN_ALLOCATION_METHOD');
809: rcv_error_pkg.set_token('VALUE', p_charge.allocation_method);
810: rcv_error_pkg.log_interface_error( 'RCV_CHARGES'
811: , 'ALLOCATION_METHOD'

Line 825: asn_debug.put_line('Allocating ' || p_charge_table.COUNT || ' charges');

821: , p_charge_interface_table IN OUT NOCOPY charge_interface_table_type
822: ) IS
823: l_rci_idx BINARY_INTEGER := 1;
824: BEGIN
825: asn_debug.put_line('Allocating ' || p_charge_table.COUNT || ' charges');
826:
827: FOR i IN 1..p_charge_table.COUNT LOOP
828: BEGIN
829: asn_debug.put_line('Allocating charge ' || i);

Line 829: asn_debug.put_line('Allocating charge ' || i);

825: asn_debug.put_line('Allocating ' || p_charge_table.COUNT || ' charges');
826:
827: FOR i IN 1..p_charge_table.COUNT LOOP
828: BEGIN
829: asn_debug.put_line('Allocating charge ' || i);
830:
831: -- synchronize rci index
832: WHILE l_rci_idx <= p_charge_interface_table.COUNT AND
833: p_charge_table(i).interface_charge_id <> p_charge_interface_table(l_rci_idx).interface_charge_id

Line 839: asn_debug.put_line('Header level charge');

835: l_rci_idx := l_rci_idx + 1;
836: END LOOP;
837:
838: IF p_charge_table(i).shipment_line_id IS NULL THEN
839: asn_debug.put_line('Header level charge');
840: Allocate_Header_Level_Charge( p_charge_table(i)
841: , p_charge_allocation_table
842: );
843: ELSE

Line 844: asn_debug.put_line('Line level charge');

840: Allocate_Header_Level_Charge( p_charge_table(i)
841: , p_charge_allocation_table
842: );
843: ELSE
844: asn_debug.put_line('Line level charge');
845: Allocate_Line_Level_Charge( p_charge_table(i)
846: , p_charge_allocation_table
847: );
848: END IF;

Line 851: asn_debug.put_line('Caught exception in Allocate_Charges: i=' || i || ' SQLERRM=' || SQLERRM);

847: );
848: END IF;
849: EXCEPTION
850: WHEN OTHERS THEN
851: asn_debug.put_line('Caught exception in Allocate_Charges: i=' || i || ' SQLERRM=' || SQLERRM);
852:
853: -- mark the error on the current charge interface row
854: IF p_charge_interface_table.EXISTS(l_rci_idx) THEN
855: p_charge_interface_table(l_rci_idx).transaction_status_code := 'E';

Line 869: asn_debug.put_line('Done allocating charges');

865: END LOOP;
866: END;
867: END LOOP;
868:
869: asn_debug.put_line('Done allocating charges');
870: END Allocate_Charges;
871:
872: Procedure Preprocess_Charge_Line
873: ( p_charge_record IN OUT NOCOPY rcv_charges_interface%ROWTYPE

Line 894: asn_debug.put_line('In preprocess_charges');

890: , p_transaction_record IN RCV_ROI_PREPROCESSOR.txns_cur%ROWTYPE
891: ) IS
892: l_charge_interface_table charge_interface_table_type;
893: BEGIN
894: asn_debug.put_line('In preprocess_charges');
895:
896: -- initialize return status
897: x_return_status := FND_API.g_ret_sts_success;
898:

Line 910: asn_debug.put_line('Found ' || l_charge_interface_table.COUNT || ' charges to preprocess');

906: AND processing_status_code = 'P'
907: ORDER BY interface_charge_id
908: FOR UPDATE;
909:
910: asn_debug.put_line('Found ' || l_charge_interface_table.COUNT || ' charges to preprocess');
911:
912: -- return if there is no qualified RCI row.
913: IF l_charge_interface_table.COUNT < 1 THEN
914: asn_debug.put_line('No RCI row to preprocess, returning');

Line 914: asn_debug.put_line('No RCI row to preprocess, returning');

910: asn_debug.put_line('Found ' || l_charge_interface_table.COUNT || ' charges to preprocess');
911:
912: -- return if there is no qualified RCI row.
913: IF l_charge_interface_table.COUNT < 1 THEN
914: asn_debug.put_line('No RCI row to preprocess, returning');
915: RETURN;
916: END IF;
917:
918: -- loop through all charges associated to the item transaction

Line 921: asn_debug.put_line('Preprocessing charge line ' || i);

917:
918: -- loop through all charges associated to the item transaction
919: FOR i IN 1..l_charge_interface_table.COUNT LOOP
920: l_charge_interface_table(i).processing_status_code := 'S';
921: asn_debug.put_line('Preprocessing charge line ' || i);
922:
923: -- default derive and validate this charge line
924: Preprocess_charge_line( l_charge_interface_table(i)
925: , p_header_record

Line 929: asn_debug.put_line('Preprocessed charge line ' || l_charge_interface_table(i).processing_status_code);

925: , p_header_record
926: , p_transaction_record
927: );
928:
929: asn_debug.put_line('Preprocessed charge line ' || l_charge_interface_table(i).processing_status_code);
930:
931: -- If charge preprocessing returns error, pass out 'E' to item error status.
932: IF l_charge_interface_table(i).processing_status_code NOT IN ('S', 'W') THEN
933: x_return_status := l_charge_interface_table(i).processing_status_code;

Line 937: asn_debug.put_line('Done preprocessing, updating RCI');

933: x_return_status := l_charge_interface_table(i).processing_status_code;
934: END IF;
935: END LOOP;
936:
937: asn_debug.put_line('Done preprocessing, updating RCI');
938:
939: -- Update the preprocessed charge interface data on rcv_charges_interface.
940: Update_Interface_Charges(l_charge_interface_table);
941:

Line 942: asn_debug.put_line('Done preprocessing charges');

938:
939: -- Update the preprocessed charge interface data on rcv_charges_interface.
940: Update_Interface_Charges(l_charge_interface_table);
941:
942: asn_debug.put_line('Done preprocessing charges');
943: EXCEPTION
944: WHEN OTHERS THEN
945: asn_debug.put_line('Exception in Preprocess_Charges:');
946: asn_debug.put_line(SQLERRM);

Line 945: asn_debug.put_line('Exception in Preprocess_Charges:');

941:
942: asn_debug.put_line('Done preprocessing charges');
943: EXCEPTION
944: WHEN OTHERS THEN
945: asn_debug.put_line('Exception in Preprocess_Charges:');
946: asn_debug.put_line(SQLERRM);
947: x_return_status := FND_API.g_ret_sts_error;
948: END Preprocess_Charges;
949:

Line 946: asn_debug.put_line(SQLERRM);

942: asn_debug.put_line('Done preprocessing charges');
943: EXCEPTION
944: WHEN OTHERS THEN
945: asn_debug.put_line('Exception in Preprocess_Charges:');
946: asn_debug.put_line(SQLERRM);
947: x_return_status := FND_API.g_ret_sts_error;
948: END Preprocess_Charges;
949:
950: PROCEDURE Process_Charges

Line 968: asn_debug.put_line('In Process_Charges: *' || p_rhi_id || '*' || p_rti_id || '*' || p_shipment_header_id || '*' || p_shipment_line_id || '*');

964: l_fail_all_charges EXCEPTION;
965: l_rti_t_status varchar2(50);
966: l_rti_p_status varchar2(50);
967: BEGIN
968: asn_debug.put_line('In Process_Charges: *' || p_rhi_id || '*' || p_rti_id || '*' || p_shipment_header_id || '*' || p_shipment_line_id || '*');
969:
970: -- initialize return status
971: x_return_status := FND_API.g_ret_sts_success;
972:

Line 991: asn_debug.put_line('Found ' || l_charge_interface_table.COUNT || ' charges to process');

987: AND processing_status_code IN ('S', 'W')
988: AND transaction_status_code = 'P'
989: ORDER BY interface_charge_id;
990:
991: asn_debug.put_line('Found ' || l_charge_interface_table.COUNT || ' charges to process');
992:
993: -- return if there is no qualified RCI row.
994: IF l_charge_interface_table.COUNT < 1 THEN
995: asn_debug.put_line('No RCI row to process, returning');

Line 995: asn_debug.put_line('No RCI row to process, returning');

991: asn_debug.put_line('Found ' || l_charge_interface_table.COUNT || ' charges to process');
992:
993: -- return if there is no qualified RCI row.
994: IF l_charge_interface_table.COUNT < 1 THEN
995: asn_debug.put_line('No RCI row to process, returning');
996: RETURN;
997: END IF;
998:
999: -- populate the PL/SQL table l_charge_table

Line 1002: asn_debug.put_line('Processing charge line ' || i);

998:
999: -- populate the PL/SQL table l_charge_table
1000: FOR i IN 1..l_charge_interface_table.COUNT LOOP --{
1001: BEGIN
1002: asn_debug.put_line('Processing charge line ' || i);
1003: l_charge_interface_table(i).transaction_status_code := 'S';
1004: Add_Charge_From_Interface
1005: ( l_charge_interface_table(i)
1006: , l_charge_table

Line 1013: asn_debug.put_line('RCV_CHARGES_GRP: Process_Charges: interface charge'||

1009: );
1010: EXCEPTION
1011: WHEN others THEN
1012: l_charge_interface_table(i).transaction_status_code := 'E';
1013: asn_debug.put_line('RCV_CHARGES_GRP: Process_Charges: interface charge'||
1014: l_charge_interface_table(i).interface_charge_id ||' failed');
1015: END;
1016: END LOOP; --}
1017:

Line 1018: asn_debug.put_line('Done creating charges, allocating...');

1014: l_charge_interface_table(i).interface_charge_id ||' failed');
1015: END;
1016: END LOOP; --}
1017:
1018: asn_debug.put_line('Done creating charges, allocating...');
1019:
1020: -- if profile option RCV_CHARGE_FAIL_ITEM is Y and there is a failure
1021: -- then fail all the charges as well as the backing item transaction.
1022: -- otherwise, only fail the errored out charge.

Line 1026: asn_debug.put_line('Fail all charges');

1022: -- otherwise, only fail the errored out charge.
1023: IF NVL(fnd_profile.VALUE('RCV_CHARGE_FAIL_ITEM'), 'N') = 'Y'
1024: AND l_charge_interface_table.COUNT > l_charge_table.COUNT
1025: THEN
1026: asn_debug.put_line('Fail all charges');
1027: -- Error out all charges
1028: FOR i IN 1..l_charge_interface_table.COUNT LOOP
1029: l_charge_interface_table(i).transaction_status_code := 'E';
1030: END LOOP;

Line 1046: asn_debug.put_line('Inserted ' || SQL%ROWCOUNT || ' rows into PO_RCV_CHARGES');

1042: FORALL i IN 1..l_charge_table.COUNT
1043: INSERT INTO po_rcv_charges
1044: VALUES l_charge_table(i);
1045:
1046: asn_debug.put_line('Inserted ' || SQL%ROWCOUNT || ' rows into PO_RCV_CHARGES');
1047:
1048: FORALL i IN 1..l_charge_allocation_table.COUNT
1049: INSERT INTO po_rcv_charge_allocations
1050: VALUES l_charge_allocation_table(i);

Line 1052: asn_debug.put_line('Inserted ' || SQL%ROWCOUNT || ' rows into PO_RCV_CHARGE_ALLOCATIONS');

1048: FORALL i IN 1..l_charge_allocation_table.COUNT
1049: INSERT INTO po_rcv_charge_allocations
1050: VALUES l_charge_allocation_table(i);
1051:
1052: asn_debug.put_line('Inserted ' || SQL%ROWCOUNT || ' rows into PO_RCV_CHARGE_ALLOCATIONS');
1053:
1054: -- update rcv_charges_interface with status code
1055: Update_Interface_Charges(l_charge_interface_table);
1056:

Line 1061: asn_debug.put_line('Deleted ' || SQL%ROWCOUNT || ' successful rows from rcv_charges_interface');

1057: -- delete all successfully processed rows from interfacet table
1058: DELETE FROM rcv_charges_interface
1059: WHERE transaction_status_code IN ('S','W');
1060:
1061: asn_debug.put_line('Deleted ' || SQL%ROWCOUNT || ' successful rows from rcv_charges_interface');
1062:
1063: asn_debug.put_line('Done processing charges');
1064: EXCEPTION
1065: WHEN OTHERS THEN

Line 1063: asn_debug.put_line('Done processing charges');

1059: WHERE transaction_status_code IN ('S','W');
1060:
1061: asn_debug.put_line('Deleted ' || SQL%ROWCOUNT || ' successful rows from rcv_charges_interface');
1062:
1063: asn_debug.put_line('Done processing charges');
1064: EXCEPTION
1065: WHEN OTHERS THEN
1066: -- pass out an error return status to fail the item transaction
1067: x_return_status := FND_API.g_ret_sts_error;

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

1064: EXCEPTION
1065: WHEN OTHERS THEN
1066: -- pass out an error return status to fail the item transaction
1067: x_return_status := FND_API.g_ret_sts_error;
1068: IF (g_asn_debug = 'Y') THEN
1069: asn_debug.put_line('RCV_CHARGES_GRP.Process_Charges: Unexpected exception:');
1070: asn_debug.put_line(SQLERRM);
1071: END IF;
1072:

Line 1069: asn_debug.put_line('RCV_CHARGES_GRP.Process_Charges: Unexpected exception:');

1065: WHEN OTHERS THEN
1066: -- pass out an error return status to fail the item transaction
1067: x_return_status := FND_API.g_ret_sts_error;
1068: IF (g_asn_debug = 'Y') THEN
1069: asn_debug.put_line('RCV_CHARGES_GRP.Process_Charges: Unexpected exception:');
1070: asn_debug.put_line(SQLERRM);
1071: END IF;
1072:
1073: END Process_Charges;

Line 1070: asn_debug.put_line(SQLERRM);

1066: -- pass out an error return status to fail the item transaction
1067: x_return_status := FND_API.g_ret_sts_error;
1068: IF (g_asn_debug = 'Y') THEN
1069: asn_debug.put_line('RCV_CHARGES_GRP.Process_Charges: Unexpected exception:');
1070: asn_debug.put_line(SQLERRM);
1071: END IF;
1072:
1073: END Process_Charges;
1074: