DBA Data[Home] [Help]

APPS.AP_MATCHING_UTILS_PKG dependencies on RCV_TRANSACTIONS

Line 1721: CURSOR C_Rcv_Transactions (p_rcv_shipment_line_id IN NUMBER) IS

1717: Procedure Match_To_Rcv_Shipment_Line(P_Invoice_Id IN NUMBER,
1718: P_Invoice_Line_Number IN NUMBER,
1719: P_Calling_Sequence IN VARCHAR2) IS
1720:
1721: CURSOR C_Rcv_Transactions (p_rcv_shipment_line_id IN NUMBER) IS
1722: SELECT rcv.transaction_id,
1723: pll.matching_basis,
1724: pll.line_location_id
1725: FROM rcv_transactions rcv,

Line 1725: FROM rcv_transactions rcv,

1721: CURSOR C_Rcv_Transactions (p_rcv_shipment_line_id IN NUMBER) IS
1722: SELECT rcv.transaction_id,
1723: pll.matching_basis,
1724: pll.line_location_id
1725: FROM rcv_transactions rcv,
1726: rcv_shipment_lines rsl,
1727: po_line_locations pll
1728: WHERE rcv.shipment_line_id = rsl.shipment_line_id
1729: AND rsl.shipment_line_id = p_rcv_shipment_line_id

Line 1736: rcv_transactions

1732:
1733: CURSOR C_Deliver_Transactions(p_rcv_transaction_id IN NUMBER) IS
1734: SELECT po_distribution_id
1735: FROM
1736: rcv_transactions
1737: WHERE
1738: transaction_type = 'DELIVER'
1739: START WITH transaction_id = p_rcv_transaction_id
1740: CONNECT BY parent_transaction_id = PRIOR transaction_id

Line 1753: l_rcv_transaction_id RCV_TRANSACTIONS.TRANSACTION_ID%TYPE;

1749:
1750: l_match_unit_price NUMBER;
1751: l_match_quantity NUMBER;
1752: l_match_amount NUMBER;
1753: l_rcv_transaction_id RCV_TRANSACTIONS.TRANSACTION_ID%TYPE;
1754: l_matching_basis PO_LINE_LOCATIONS.MATCHING_BASIS%TYPE;
1755: l_invoice_currency_code AP_INVOICES.INVOICE_CURRENCY_CODE%TYPE;
1756: l_invoice_type_lookup_code AP_INVOICES.INVOICE_TYPE_LOOKUP_CODE%TYPE;
1757: l_unit_meas_lookup_code AP_INVOICE_LINES.UNIT_MEAS_LOOKUP_CODE%TYPE;

Line 1849: l_debug_info := 'Open C_Rcv_Transactions cursor';

1845: END IF;
1846:
1847:
1848: IF (l_match_mode IN ('STD-PS','STD-PD')) THEN
1849: l_debug_info := 'Open C_Rcv_Transactions cursor';
1850: OPEN c_rcv_transactions(l_rcv_shipment_line_id);
1851:
1852: LOOP
1853:

Line 1850: OPEN c_rcv_transactions(l_rcv_shipment_line_id);

1846:
1847:
1848: IF (l_match_mode IN ('STD-PS','STD-PD')) THEN
1849: l_debug_info := 'Open C_Rcv_Transactions cursor';
1850: OPEN c_rcv_transactions(l_rcv_shipment_line_id);
1851:
1852: LOOP
1853:
1854: FETCH C_Rcv_Transactions INTO l_rcv_transaction_id,

Line 1854: FETCH C_Rcv_Transactions INTO l_rcv_transaction_id,

1850: OPEN c_rcv_transactions(l_rcv_shipment_line_id);
1851:
1852: LOOP
1853:
1854: FETCH C_Rcv_Transactions INTO l_rcv_transaction_id,
1855: l_matching_basis,
1856: l_po_line_location_id;
1857: EXIT WHEN C_Rcv_Transactions%NOTFOUND OR l_total_match_amount = 0
1858: OR l_total_match_quantity = 0;

Line 1857: EXIT WHEN C_Rcv_Transactions%NOTFOUND OR l_total_match_amount = 0

1853:
1854: FETCH C_Rcv_Transactions INTO l_rcv_transaction_id,
1855: l_matching_basis,
1856: l_po_line_location_id;
1857: EXIT WHEN C_Rcv_Transactions%NOTFOUND OR l_total_match_amount = 0
1858: OR l_total_match_quantity = 0;
1859:
1860:
1861: OPEN C_Deliver_Transactions(l_rcv_transaction_id);

Line 2003: CLOSE C_Rcv_Transactions;

1999: CLOSE C_Deliver_Transactions;
2000:
2001: END LOOP;
2002:
2003: CLOSE C_Rcv_Transactions;
2004:
2005: END IF; /* l_match_mode IN ...*/
2006:
2007: --If match_quantity or amount is still not used up by the

Line 2009: --quantity/amount across all the rcv_transactions based on O-B ??

2005: END IF; /* l_match_mode IN ...*/
2006:
2007: --If match_quantity or amount is still not used up by the
2008: --deliver transactions above, then we prorate the remaining
2009: --quantity/amount across all the rcv_transactions based on O-B ??
2010:
2011: IF ((l_match_mode IN ('CR-PS','CR-PD')) OR
2012: (l_matching_basis = 'QUANTITY' and l_total_match_quantity > 0 ) OR
2013: (l_matching_basis = 'AMOUNT' and l_total_match_amount > 0)) THEN

Line 2015: OPEN C_Rcv_Transactions(l_rcv_shipment_line_id);

2011: IF ((l_match_mode IN ('CR-PS','CR-PD')) OR
2012: (l_matching_basis = 'QUANTITY' and l_total_match_quantity > 0 ) OR
2013: (l_matching_basis = 'AMOUNT' and l_total_match_amount > 0)) THEN
2014:
2015: OPEN C_Rcv_Transactions(l_rcv_shipment_line_id);
2016:
2017: LOOP
2018:
2019: FETCH C_Rcv_Transactions INTO l_rcv_transaction_id,

Line 2019: FETCH C_Rcv_Transactions INTO l_rcv_transaction_id,

2015: OPEN C_Rcv_Transactions(l_rcv_shipment_line_id);
2016:
2017: LOOP
2018:
2019: FETCH C_Rcv_Transactions INTO l_rcv_transaction_id,
2020: l_matching_basis,
2021: l_po_line_location_id;
2022:
2023: EXIT WHEN (C_Rcv_Transactions%NOTFOUND or

Line 2023: EXIT WHEN (C_Rcv_Transactions%NOTFOUND or

2019: FETCH C_Rcv_Transactions INTO l_rcv_transaction_id,
2020: l_matching_basis,
2021: l_po_line_location_id;
2022:
2023: EXIT WHEN (C_Rcv_Transactions%NOTFOUND or
2024: l_total_match_quantity = 0 OR l_total_match_amount = 0);
2025:
2026: IF (l_matching_basis = 'QUANTITY') THEN
2027:

Line 2194: CLOSE C_Rcv_Transactions;

2190: END IF; /* l_matching_basis */
2191:
2192: END LOOP;
2193:
2194: CLOSE C_Rcv_Transactions;
2195:
2196: END IF; /* l_match_mode = 'STD-PS' OR l_total_match_quantity > 0 OR ... */
2197:
2198: EXCEPTION WHEN OTHERS THEN

Line 2239: CURSOR C_Rcv_Transactions (p_rcv_shipment_line_id IN NUMBER) IS

2235: p_matching_basis IN VARCHAR2,
2236: p_returned_item IN VARCHAR2)
2237: RETURN NUMBER IS
2238:
2239: CURSOR C_Rcv_Transactions (p_rcv_shipment_line_id IN NUMBER) IS
2240: SELECT rcv.transaction_id,
2241: pll.matching_basis,
2242: pll.line_location_id
2243: FROM rcv_transactions rcv,

Line 2243: FROM rcv_transactions rcv,

2239: CURSOR C_Rcv_Transactions (p_rcv_shipment_line_id IN NUMBER) IS
2240: SELECT rcv.transaction_id,
2241: pll.matching_basis,
2242: pll.line_location_id
2243: FROM rcv_transactions rcv,
2244: rcv_shipment_lines rsl,
2245: po_line_locations pll
2246: WHERE rcv.shipment_line_id = rsl.shipment_line_id
2247: AND rsl.shipment_line_id = p_rcv_shipment_line_id

Line 2252: l_rcv_transaction_id RCV_TRANSACTIONS.TRANSACTION_ID%TYPE;

2248: AND pll.line_location_id = rcv.po_line_location_id
2249: AND rcv.transaction_type IN ('RECEIVE','MATCH');
2250:
2251: l_po_line_location_id PO_LINE_LOCATIONS.LINE_LOCATION_ID%TYPE;
2252: l_rcv_transaction_id RCV_TRANSACTIONS.TRANSACTION_ID%TYPE;
2253: l_matching_basis PO_LINE_LOCATIONS.MATCHING_BASIS%TYPE;
2254: l_po_distribution_id PO_DISTRIBUTIONS.PO_DISTRIBUTION_ID%TYPE;
2255:
2256: l_ordered_qty NUMBER;

Line 2303: l_debug_info := 'Open C_Rcv_Transactions cursor';

2299: l_total_amount_ordered := 0;
2300: l_total_received_qty := 0;
2301: l_total_received_Amount := 0;
2302:
2303: l_debug_info := 'Open C_Rcv_Transactions cursor';
2304: OPEN c_rcv_transactions(p_rcv_shipment_line_id);
2305: LOOP
2306: FETCH C_Rcv_Transactions
2307: INTO l_rcv_transaction_id,

Line 2304: OPEN c_rcv_transactions(p_rcv_shipment_line_id);

2300: l_total_received_qty := 0;
2301: l_total_received_Amount := 0;
2302:
2303: l_debug_info := 'Open C_Rcv_Transactions cursor';
2304: OPEN c_rcv_transactions(p_rcv_shipment_line_id);
2305: LOOP
2306: FETCH C_Rcv_Transactions
2307: INTO l_rcv_transaction_id,
2308: l_matching_basis,

Line 2306: FETCH C_Rcv_Transactions

2302:
2303: l_debug_info := 'Open C_Rcv_Transactions cursor';
2304: OPEN c_rcv_transactions(p_rcv_shipment_line_id);
2305: LOOP
2306: FETCH C_Rcv_Transactions
2307: INTO l_rcv_transaction_id,
2308: l_matching_basis,
2309: l_po_line_location_id;
2310: EXIT WHEN C_Rcv_Transactions%NOTFOUND;

Line 2310: EXIT WHEN C_Rcv_Transactions%NOTFOUND;

2306: FETCH C_Rcv_Transactions
2307: INTO l_rcv_transaction_id,
2308: l_matching_basis,
2309: l_po_line_location_id;
2310: EXIT WHEN C_Rcv_Transactions%NOTFOUND;
2311:
2312: IF (l_matching_basis = 'QUANTITY') THEN
2313:
2314: AP_MATCHING_UTILS_PKG.Get_receipt_Quantities(

Line 2373: CLOSE C_Rcv_Transactions;

2369:
2370: l_total_received_qty := l_received_qty + l_total_received_qty;
2371: l_total_received_Amount := l_amount_received + l_total_received_Amount;
2372: END LOOP;
2373: CLOSE C_Rcv_Transactions;
2374:
2375: IF p_returned_item = 'QUANTITY_BILLED' THEN
2376: RETURN l_total_billed_qty;
2377: ELSIF p_returned_item = 'QUANTITY_RECEIVED' THEN