51: l_org_id NUMBER := NULL;
52:
53: CURSOR c_asn_line IS
54: select rsl.shipment_line_id
55: from RCV_SHIPMENT_LINES rsl,
56: RCV_SHIPMENT_HEADERS rsh
57: where rsh.shipment_num = p_shipment_num
58: and rsh.shipment_header_id = rsl.shipment_header_id
59: and rsh.vendor_id = p_vendor_id
241: l_asn_status := 'PENDING';
242: elsif (l_success_count = l_total_count) then
243: BEGIN
244: -- fix for bug 3358908
245: -- for "successful" ASNs make sure that there exists at least one record in rcv_shipment_lines
246: select count(*)
247: into l_rsl_line_count
248: from rcv_shipment_lines
249: where shipment_header_id in
244: -- fix for bug 3358908
245: -- for "successful" ASNs make sure that there exists at least one record in rcv_shipment_lines
246: select count(*)
247: into l_rsl_line_count
248: from rcv_shipment_lines
249: where shipment_header_id in
250: (select shipment_header_id from rcv_shipment_headers
251: where shipment_num = p_shipment_num
252: and vendor_id = p_vendor_id and vendor_site_id = p_vendor_site_id);
381:
382: /* Get total number of lines */
383: select count(*)
384: into x_total_lines
385: from RCV_SHIPMENT_LINES rsl,
386: RCV_SHIPMENT_HEADERS rsh
387: where rsh.shipment_num = p_shipment_num
388: and rsh.vendor_id = p_vendor_id
389: and rsh.vendor_site_id = p_vendor_site_id
395:
396: /* Get total number of cancelled lines */
397: select count(*)
398: into x_cancelled_lines
399: from RCV_SHIPMENT_LINES rsl,
400: RCV_SHIPMENT_HEADERS rsh
401: where rsh.shipment_num = p_shipment_num
402: and rsh.vendor_id = p_vendor_id
403: and rsh.vendor_site_id = p_vendor_site_id
498: if (l_total_count = 0) then
499:
500: select count(*)
501: into l_rsl_line_count
502: from rcv_shipment_lines
503: where shipment_header_id = p_header_id;
504:
505: if (l_rsl_line_count > 0) then
506: l_asn_status := 'SUCCESS';
602:
603: /* Get total number of lines */
604: select count(*)
605: into l_total_lines
606: from RCV_SHIPMENT_LINES rsl,
607: RCV_SHIPMENT_HEADERS rsh
608: where rsh.shipment_num = p_shipment_num
609: and rsh.vendor_id = p_vendor_id
610: and rsh.vendor_site_id = p_vendor_site_id
618:
619: /* Get total number of cancelled lines */
620: select count(*)
621: into l_cancelled_lines
622: from RCV_SHIPMENT_LINES rsl,
623: RCV_SHIPMENT_HEADERS rsh
624: where rsh.shipment_num = p_shipment_num
625: and rsh.vendor_id = p_vendor_id
626: and rsh.vendor_site_id = p_vendor_site_id
761: elsif (l_success_count = l_total_count) then
762:
763: BEGIN
764: -- fix for bug 3358908
765: -- for "successful" ASNs make sure that there exists at least one record in rcv_shipment_lines
766: select count(*)
767: into l_rsl_line_count
768: from rcv_shipment_lines
769: where shipment_header_id in
764: -- fix for bug 3358908
765: -- for "successful" ASNs make sure that there exists at least one record in rcv_shipment_lines
766: select count(*)
767: into l_rsl_line_count
768: from rcv_shipment_lines
769: where shipment_header_id in
770: (select shipment_header_id from rcv_shipment_headers
771: where shipment_num = p_shipment_num
772: and vendor_id = p_vendor_id and vendor_site_id = p_vendor_site_id);
828:
829: /* Get total number of lines */
830: select count(*)
831: into l_total_lines
832: from RCV_SHIPMENT_LINES rsl,
833: RCV_SHIPMENT_HEADERS rsh
834: where rsh.shipment_num = p_shipment_num
835: and rsh.vendor_id = p_vendor_id
836: and rsh.vendor_site_id = p_vendor_site_id
844:
845: /* Get total number of cancelled lines */
846: select count(*)
847: into l_cancelled_lines
848: from RCV_SHIPMENT_LINES rsl,
849: RCV_SHIPMENT_HEADERS rsh
850: where rsh.shipment_num = p_shipment_num
851: and rsh.vendor_id = p_vendor_id
852: and rsh.vendor_site_id = p_vendor_site_id
925: x_transaction_type VARCHAR2(25) := NULL;
926:
927: CURSOR c_line_status IS
928: Select nvl(shipment_line_status_code, '')
929: From RCV_SHIPMENT_LINES
930: Where shipment_line_id = p_shipment_line_id;
931:
932: CURSOR c_transaction_type IS
933: select nvl(transaction_type, '')
1047: X_primary_unit_of_measure,
1048: X_ship_to_location_id,
1049: X_operating_unit_id
1050: from
1051: RCV_SHIPMENT_LINES RSL,
1052: PO_HEADERS_ALL POHA
1053: where
1054: rsl.shipment_line_id = p_shipment_line_id
1055: and rsl.po_header_id = poha.po_header_id;