117:
118: if (X_type_lookup_code NOT IN ('BLANKET','RFQ', 'QUOTATION')) THEN
119:
120: -- delete the distributions associated with the line.
121: po_distributions_sv.delete_distributions(X_delete_id,
122: 'LINE');
123:
124: end if; /* X_type_lookup_code not in RFQ and QUOTATION */
125:
194:
195: if (X_type_lookup_code NOT IN ('BLANKET', 'RFQ', 'QUOTATION')) THEN
196:
197: -- delete the distributions associated with the header
198: po_distributions_sv.delete_distributions(X_delete_id,
199: 'HEADER');
200:
201: end if; /* X_type_lookup_code not in RFQ and QUOTATION */
202:
248: and prior to the fix we were deleting shipment first and then trying to
249: delete the distributions based on the line_location_id which did
250: not delete any records and thereby we ended up having orphan
251: distribution records.
252: Moved the po_distributions_sv_delete_distributions before deletion
253: of shipment lines
254: */
255:
256: -- delete the distributions associated with the release
253: of shipment lines
254: */
255:
256: -- delete the distributions associated with the release
257: po_distributions_sv.delete_distributions(X_delete_id,
258: 'RELEASE');
259:
260: X_progress := '030';
261:
416:
417: --dbms_output.put_line('In call to delete children');
418:
419: -- delete the distributions associated with the shipment
420: po_distributions_sv.delete_distributions(X_line_location_id,
421: 'SHIPMENT');
422:
423: -- Remove the req link
424: po_req_lines_sv.remove_req_from_po(X_line_location_id,'SHIPMENT');
790:
791: /* bug 8606457 */
792: IF X_shipment_type in ('BLANKET', 'SCHEDULED') then
793:
794: UPDATE po_distributions
795: SET po_line_id = X_Po_Line_Id
796: WHERE line_location_id = X_line_location_id;
797:
798: END IF;
846: X_Progress := '080';
847:
848: SELECT COUNT(po_distribution_id)
849: INTO X_num_of_distributions
850: FROM po_distributions pd
851: WHERE pd.line_location_id = X_line_location_id
852: AND NOT EXISTS (SELECT 'there are encumbered distributions'
853: FROM po_distributions pd2
854: WHERE pd2.line_location_id =
849: INTO X_num_of_distributions
850: FROM po_distributions pd
851: WHERE pd.line_location_id = X_line_location_id
852: AND NOT EXISTS (SELECT 'there are encumbered distributions'
853: FROM po_distributions pd2
854: WHERE pd2.line_location_id =
855: X_line_location_id
856: AND NVL(pd2.encumbered_flag, 'N') <> 'N') ;
857:
866: IF X_num_of_distributions = 1 THEN
867:
868: X_Progress := '090';
869:
870: UPDATE po_distributions
871: SET quantity_ordered = X_quantity,
872: last_update_date = X_last_update_date,
873: last_updated_by = X_last_updated_by
874: WHERE line_location_id = X_line_location_id;
887: */
888:
889: IF (X_Shipment_Type in ('STANDARD','BLANKET','SCHEDULED')) then
890: X_Progress := '091';
891: update po_distributions
892: set accrue_on_receipt_flag = X_accrue_on_receipt_flag
893: where line_location_id = X_line_location_id;
894: END IF;
895: