82: rct.transaction_id
83: FROM rcv_shipment_lines rsl,
84: po_headers poh,
85: po_lines pol,
86: rcv_transactions rct
87: WHERE rct.shipment_line_id = rsl.shipment_line_id
88: AND rct.transaction_type = 'RECEIVE'
89: AND rsl.po_header_id = poh.po_header_id
90: AND rsl.po_line_id = pol.po_line_id
124: -- the receipt transaction
125: CURSOR C2 IS
126: SELECT rct.primary_quantity,
127: rct.transaction_id
128: FROM rcv_transactions rct
129: WHERE rct.transaction_type = 'RETURN TO VENDOR'
130: AND rct.parent_transaction_id = X_transaction_id;
131:
132: /* Bug 2251090 fixed. In the where clause of the below sql, added
148: AND rsl.to_organization_id = X_organization_id
149: AND poh.supply_agreement_flag = 'Y'
150: AND exists
151: (select 1
152: from rcv_transactions rct
153: where rct.transaction_date between x_cum_period_start
154: and nvl(x_cum_period_end,
155: rct.transaction_date+1)
156: and rct.shipment_line_id = rsl.shipment_line_id
385: --dbms_output.put_line('Get CUM Qty: TRANSACTION_ID'||X_transaction_id);
386:
387: -- Get the uom code since we only have the unit of measure.
388: -- We need to the uom code to execute uom_convert.
389: -- We CANNOT just get the primary quantity from rcv_transactions
390: -- since it will not have the corrections to that quantity.
391: -- The rcv_shipment line includes the quantity received +
392: -- all corrects to that quantity.
393: X_progress := '090';
458: X_progress := '150';
459:
460: SELECT sum(rct.primary_quantity)
461: INTO X_corrtv_primary_quantity
462: FROM rcv_transactions rct
463: WHERE rct.transaction_type = 'CORRECT'
464: AND rct.parent_transaction_id = X_rtv_transaction_id;
465:
466: EXCEPTION