244: asn_debug.put_line('enter internal order receiving line');
245: END IF;
246:
247: -- 1) derive ship to org info
248: rcv_roi_transaction.derive_ship_to_org_info(x_cascaded_table,
249: n,
250: x_header_record
251: );
252: x_progress := '002';
256: END IF;
257:
258: x_progress := '010';
259: -- 5) derive item info
260: rcv_roi_transaction.derive_item_info(x_cascaded_table, n);
261: x_progress := '015';
262: rcv_roi_header_common.derive_uom_info(x_cascaded_table, n);
263: -- 6) derive substitute item info
264: rcv_roi_transaction.derive_substitute_item_info(x_cascaded_table, n);
260: rcv_roi_transaction.derive_item_info(x_cascaded_table, n);
261: x_progress := '015';
262: rcv_roi_header_common.derive_uom_info(x_cascaded_table, n);
263: -- 6) derive substitute item info
264: rcv_roi_transaction.derive_substitute_item_info(x_cascaded_table, n);
265: x_progress := '020';
266: -- 8) derive from org info
267: rcv_roi_transaction.derive_from_org_info(x_cascaded_table, n);
268: x_progress := '035';
263: -- 6) derive substitute item info
264: rcv_roi_transaction.derive_substitute_item_info(x_cascaded_table, n);
265: x_progress := '020';
266: -- 8) derive from org info
267: rcv_roi_transaction.derive_from_org_info(x_cascaded_table, n);
268: x_progress := '035';
269: -- 12) derive routing header info
270: rcv_roi_transaction.derive_routing_header_info(x_cascaded_table, n);
271: x_progress := '070';
266: -- 8) derive from org info
267: rcv_roi_transaction.derive_from_org_info(x_cascaded_table, n);
268: x_progress := '035';
269: -- 12) derive routing header info
270: rcv_roi_transaction.derive_routing_header_info(x_cascaded_table, n);
271: x_progress := '070';
272: asn_debug.put_line('progress in Internal Orders rcv : x progress = ' || x_progress);
273: -- derive auto transact code
274: rcv_roi_transaction.derive_auto_transact_code(x_cascaded_table, n);
270: rcv_roi_transaction.derive_routing_header_info(x_cascaded_table, n);
271: x_progress := '070';
272: asn_debug.put_line('progress in Internal Orders rcv : x progress = ' || x_progress);
273: -- derive auto transact code
274: rcv_roi_transaction.derive_auto_transact_code(x_cascaded_table, n);
275: -- 13) bug 3379550
276: x_progress := '071';
277: asn_debug.put_line('progress in Internal Orders rcv : x progress = ' || x_progress);
278: /* Bug 3684984.
292: ** then corresponding error message needs to be populated in the
293: ** interface errors table
294: */
295: /* Bug3591830 - START */
296: rcv_roi_transaction.derive_to_locator_id(x_cascaded_table, n);
297: temp_cascaded_table(n).locator_id := x_cascaded_table(n).locator_id;
298: asn_debug.put_line('progress in Internal Orders rcv : after derive_to_locator_id -> locator_id = ' || temp_cascaded_table(n).locator_id);
299: rcv_error_pkg.log_interface_message(x_cascaded_table(n).error_status,
300: 'LOCATOR_ID',
313: IF (g_asn_debug = 'Y') THEN
314: asn_debug.put_line('enter derive_io_trans_line ');
315: END IF;
316:
317: rcv_roi_transaction.derive_parent_id(x_cascaded_table, n);
318: /* Derive the to_org_id */
319: rcv_roi_transaction.derive_ship_to_org_info(x_cascaded_table,
320: n,
321: x_header_record
315: END IF;
316:
317: rcv_roi_transaction.derive_parent_id(x_cascaded_table, n);
318: /* Derive the to_org_id */
319: rcv_roi_transaction.derive_ship_to_org_info(x_cascaded_table,
320: n,
321: x_header_record
322: );
323:
346: /* Derive the locator_id even in case of deliver transactions */
347: IF (x_cascaded_table(n).transaction_type IN ('TRANSFER','DELIVER')) THEN
348: IF (x_cascaded_table(n).transaction_type = 'TRANSFER') THEN
349: asn_debug.put_line('doing ship to location /locator derivations ');
350: rcv_roi_transaction.derive_location_info(x_cascaded_table, n);
351: rcv_roi_transaction.derive_from_locator_id(x_cascaded_table, n); -- WMS Change
352: END IF;
353: rcv_roi_transaction.derive_to_locator_id(x_cascaded_table, n); -- WMS Change
354: END IF;
347: IF (x_cascaded_table(n).transaction_type IN ('TRANSFER','DELIVER')) THEN
348: IF (x_cascaded_table(n).transaction_type = 'TRANSFER') THEN
349: asn_debug.put_line('doing ship to location /locator derivations ');
350: rcv_roi_transaction.derive_location_info(x_cascaded_table, n);
351: rcv_roi_transaction.derive_from_locator_id(x_cascaded_table, n); -- WMS Change
352: END IF;
353: rcv_roi_transaction.derive_to_locator_id(x_cascaded_table, n); -- WMS Change
354: END IF;
355: /* Bug#4037821 - END */
349: asn_debug.put_line('doing ship to location /locator derivations ');
350: rcv_roi_transaction.derive_location_info(x_cascaded_table, n);
351: rcv_roi_transaction.derive_from_locator_id(x_cascaded_table, n); -- WMS Change
352: END IF;
353: rcv_roi_transaction.derive_to_locator_id(x_cascaded_table, n); -- WMS Change
354: END IF;
355: /* Bug#4037821 - END */
356:
357: x_progress := '071';
357: x_progress := '071';
358: asn_debug.put_line('progress in Internal Orders rcv : x progress = ' || x_progress);
359: derive_io_shipment_info(x_cascaded_table, n);
360: x_progress := '091';
361: rcv_roi_transaction.derive_reason_info(x_cascaded_table, n);
362: /* Auto_transact_code is null for all these transaction types */
363: x_cascaded_table(n).auto_transact_code := NULL;
364: derive_trans_del_line_quantity(x_cascaded_table,
365: n,
377: IF (g_asn_debug = 'Y') THEN
378: asn_debug.put_line('enter derive_correction_line ');
379: END IF;
380:
381: rcv_roi_transaction.derive_parent_id(x_cascaded_table, n);
382: /* Derive the to_org_id */
383: rcv_roi_transaction.derive_ship_to_org_info(x_cascaded_table,
384: n,
385: x_header_record
379: END IF;
380:
381: rcv_roi_transaction.derive_parent_id(x_cascaded_table, n);
382: /* Derive the to_org_id */
383: rcv_roi_transaction.derive_ship_to_org_info(x_cascaded_table,
384: n,
385: x_header_record
386: );
387:
403: x_progress := '071';
404: asn_debug.put_line('progress in Internal Orders rcv : x progress = ' || x_progress);
405: derive_io_shipment_info(x_cascaded_table, n);
406: x_progress := '091';
407: rcv_roi_transaction.derive_reason_info(x_cascaded_table, n);
408: /* Auto_transact_code is null for all these transaction types */
409: x_cascaded_table(n).auto_transact_code := NULL;
410: derive_io_correct_line_qty(x_cascaded_table,
411: n,
502: asn_debug.put_line('Enter validate_io_receive_line');
503: END IF;
504:
505: x_progress := '000';
506: rcv_roi_transaction.validate_transaction_date(x_cascaded_table, n);
507: rcv_roi_transaction.validate_transaction_uom(x_cascaded_table, n);
508: rcv_roi_transaction.validate_item_info(x_cascaded_table, n);
509: rcv_roi_transaction.validate_freight_carrier_code(x_cascaded_table, n);
510: rcv_roi_transaction.validate_dest_type(x_cascaded_table, n);
503: END IF;
504:
505: x_progress := '000';
506: rcv_roi_transaction.validate_transaction_date(x_cascaded_table, n);
507: rcv_roi_transaction.validate_transaction_uom(x_cascaded_table, n);
508: rcv_roi_transaction.validate_item_info(x_cascaded_table, n);
509: rcv_roi_transaction.validate_freight_carrier_code(x_cascaded_table, n);
510: rcv_roi_transaction.validate_dest_type(x_cascaded_table, n);
511:
504:
505: x_progress := '000';
506: rcv_roi_transaction.validate_transaction_date(x_cascaded_table, n);
507: rcv_roi_transaction.validate_transaction_uom(x_cascaded_table, n);
508: rcv_roi_transaction.validate_item_info(x_cascaded_table, n);
509: rcv_roi_transaction.validate_freight_carrier_code(x_cascaded_table, n);
510: rcv_roi_transaction.validate_dest_type(x_cascaded_table, n);
511:
512: IF (x_cascaded_table(n).ship_to_location_id IS NOT NULL) THEN
505: x_progress := '000';
506: rcv_roi_transaction.validate_transaction_date(x_cascaded_table, n);
507: rcv_roi_transaction.validate_transaction_uom(x_cascaded_table, n);
508: rcv_roi_transaction.validate_item_info(x_cascaded_table, n);
509: rcv_roi_transaction.validate_freight_carrier_code(x_cascaded_table, n);
510: rcv_roi_transaction.validate_dest_type(x_cascaded_table, n);
511:
512: IF (x_cascaded_table(n).ship_to_location_id IS NOT NULL) THEN
513: rcv_roi_transaction.validate_ship_to_loc(x_cascaded_table, n);
506: rcv_roi_transaction.validate_transaction_date(x_cascaded_table, n);
507: rcv_roi_transaction.validate_transaction_uom(x_cascaded_table, n);
508: rcv_roi_transaction.validate_item_info(x_cascaded_table, n);
509: rcv_roi_transaction.validate_freight_carrier_code(x_cascaded_table, n);
510: rcv_roi_transaction.validate_dest_type(x_cascaded_table, n);
511:
512: IF (x_cascaded_table(n).ship_to_location_id IS NOT NULL) THEN
513: rcv_roi_transaction.validate_ship_to_loc(x_cascaded_table, n);
514: END IF;
509: rcv_roi_transaction.validate_freight_carrier_code(x_cascaded_table, n);
510: rcv_roi_transaction.validate_dest_type(x_cascaded_table, n);
511:
512: IF (x_cascaded_table(n).ship_to_location_id IS NOT NULL) THEN
513: rcv_roi_transaction.validate_ship_to_loc(x_cascaded_table, n);
514: END IF;
515: /* Bug:6375015
516: There is no defaulting done for the deliver_to_person_id or validation against the parent_txn's
517: deliver_to_person_id in case of ROI transaction. But in case of forms we are defaluting the
643: IF l_skip_validation = 0 THEN
644: IF (g_asn_debug = 'Y') THEN
645: asn_debug.put_line('validate_deliver_to_person is called');
646: END IF;
647: rcv_roi_transaction.validate_deliver_to_person(x_cascaded_table, n);
648: IF (g_asn_debug = 'Y') THEN
649: asn_debug.put_line('After validate_deliver_to_person: ' || x_cascaded_table(n).error_status);
650: END IF;
651: ELSE
653: asn_debug.put_line('call to validate_deliver_to_person is skipped');
654: END IF;
655: END IF;/* code fix for the Bug:6375015 ends */
656:
657: rcv_roi_transaction.validate_routing_record(x_cascaded_table, n);
658: rcv_roi_transaction.validate_deliver_to_loc(x_cascaded_table, n);
659: rcv_roi_transaction.validate_subinventory(x_cascaded_table, n);
660: rcv_roi_transaction.validate_locator(x_cascaded_table, n);
661: rcv_roi_transaction.validate_tax_code(x_cascaded_table,
654: END IF;
655: END IF;/* code fix for the Bug:6375015 ends */
656:
657: rcv_roi_transaction.validate_routing_record(x_cascaded_table, n);
658: rcv_roi_transaction.validate_deliver_to_loc(x_cascaded_table, n);
659: rcv_roi_transaction.validate_subinventory(x_cascaded_table, n);
660: rcv_roi_transaction.validate_locator(x_cascaded_table, n);
661: rcv_roi_transaction.validate_tax_code(x_cascaded_table,
662: n,
655: END IF;/* code fix for the Bug:6375015 ends */
656:
657: rcv_roi_transaction.validate_routing_record(x_cascaded_table, n);
658: rcv_roi_transaction.validate_deliver_to_loc(x_cascaded_table, n);
659: rcv_roi_transaction.validate_subinventory(x_cascaded_table, n);
660: rcv_roi_transaction.validate_locator(x_cascaded_table, n);
661: rcv_roi_transaction.validate_tax_code(x_cascaded_table,
662: n,
663: x_header_record.header_record.asn_type
656:
657: rcv_roi_transaction.validate_routing_record(x_cascaded_table, n);
658: rcv_roi_transaction.validate_deliver_to_loc(x_cascaded_table, n);
659: rcv_roi_transaction.validate_subinventory(x_cascaded_table, n);
660: rcv_roi_transaction.validate_locator(x_cascaded_table, n);
661: rcv_roi_transaction.validate_tax_code(x_cascaded_table,
662: n,
663: x_header_record.header_record.asn_type
664: ); /* Bug3454491 */
657: rcv_roi_transaction.validate_routing_record(x_cascaded_table, n);
658: rcv_roi_transaction.validate_deliver_to_loc(x_cascaded_table, n);
659: rcv_roi_transaction.validate_subinventory(x_cascaded_table, n);
660: rcv_roi_transaction.validate_locator(x_cascaded_table, n);
661: rcv_roi_transaction.validate_tax_code(x_cascaded_table,
662: n,
663: x_header_record.header_record.asn_type
664: ); /* Bug3454491 */
665: rcv_roi_transaction.validate_country_of_origin(x_cascaded_table, n);
661: rcv_roi_transaction.validate_tax_code(x_cascaded_table,
662: n,
663: x_header_record.header_record.asn_type
664: ); /* Bug3454491 */
665: rcv_roi_transaction.validate_country_of_origin(x_cascaded_table, n);
666: /* Bug 3735972.
667: * We used to call rcv_roi_transaction.validate_ref_integrity that had
668: * code only for PO.
669: * We now have a similar one to validate internal orders and
663: x_header_record.header_record.asn_type
664: ); /* Bug3454491 */
665: rcv_roi_transaction.validate_country_of_origin(x_cascaded_table, n);
666: /* Bug 3735972.
667: * We used to call rcv_roi_transaction.validate_ref_integrity that had
668: * code only for PO.
669: * We now have a similar one to validate internal orders and
670: * inter-org shipments in rcv_int_org_transfer package.
671: */
673: n,
674: x_header_record
675: );
676:
677: rcv_roi_transaction.exchange_sub_items(x_cascaded_table, n);
678: /** OPM change Bug# 3061052**/
679: rcv_roi_transaction.validate_opm_attributes(x_cascaded_table, n);
680:
681: /* If destination_type_code is inventory then we need to make
675: );
676:
677: rcv_roi_transaction.exchange_sub_items(x_cascaded_table, n);
678: /** OPM change Bug# 3061052**/
679: rcv_roi_transaction.validate_opm_attributes(x_cascaded_table, n);
680:
681: /* If destination_type_code is inventory then we need to make
682: * sure that we can correct this qty since it might have been
683: * already reserved in inventory.
1197:
1198: IF n > 1 THEN -- we will do this for all rows except the 1st
1199: FOR i IN 1 ..(n - 1) LOOP
1200: IF x_cascaded_table(i).item_id = x_shipmentrec.item_id THEN
1201: x_temp_already_allocated_qty := rcv_roi_transaction.convert_into_correct_qty(x_cascaded_table(i).quantity,
1202: x_cascaded_table(i).unit_of_measure,
1203: x_cascaded_table(i).item_id,
1204: x_shipmentrec.unit_of_measure
1205: );
1247: -- po -> primary uom
1248: -- if any of the conversions fail then we cannot use that record
1249:
1250: x_remaining_qty_rsl_uom := 0; -- initialize
1251: x_remaining_qty_rsl_uom := rcv_roi_transaction.convert_into_correct_qty(x_remaining_quantity,
1252: temp_cascaded_table(1).unit_of_measure,
1253: temp_cascaded_table(1).item_id,
1254: x_shipmentrec.unit_of_measure
1255: );
1274: END IF;
1275:
1276: x_remaining_qty_rsl_uom := x_remaining_qty_rsl_uom - x_converted_trx_qty;
1277: -- change rsl uom qty to uom of first line in cascaded table so both qtys are in sync
1278: x_remaining_quantity := rcv_roi_transaction.convert_into_correct_qty(x_remaining_qty_rsl_uom,
1279: x_shipmentrec.unit_of_measure,
1280: temp_cascaded_table(1).item_id,
1281: temp_cascaded_table(1).unit_of_measure
1282: );
1336: temp_cascaded_table(current_n).source_doc_quantity := x_converted_trx_qty; -- in rsl uom
1337: temp_cascaded_table(current_n).source_doc_unit_of_measure := x_shipmentrec.unit_of_measure;
1338:
1339: IF (temp_cascaded_table(current_n).unit_of_measure <> x_shipmentrec.unit_of_measure) THEN
1340: temp_cascaded_table(current_n).quantity := rcv_roi_transaction.convert_into_correct_qty(x_converted_trx_qty,
1341: x_shipmentrec.unit_of_measure,
1342: temp_cascaded_table(current_n).item_id,
1343: temp_cascaded_table(current_n).unit_of_measure
1344: ); -- in asn uom
1351: END IF;
1352:
1353: -- primary qty in primary uom
1354: IF (temp_cascaded_table(current_n).primary_unit_of_measure <> x_shipmentrec.unit_of_measure) THEN
1355: temp_cascaded_table(current_n).primary_quantity := rcv_roi_transaction.convert_into_correct_qty(x_converted_trx_qty,
1356: x_shipmentrec.unit_of_measure,
1357: temp_cascaded_table(current_n).item_id,
1358: temp_cascaded_table(current_n).primary_unit_of_measure
1359: );