DBA Data[Home] [Help]

APPS.PO_RETROACTIVE_PRICING_PVT dependencies on PO_LINES

Line 95: * po_line_locations with the retroactive_date in po_lines so that

91: * refering these agreements for retroactive price updates.
92: * Get the new price based on the release/Std PO shipment values.
93: * If they are different, then update po_line_locations with the
94: * new price. In either case, update retoractive_date in
95: * po_line_locations with the retroactive_date in po_lines so that
96: * this shipment will not be picked up again unless blanket line
97: * is retroactively changed. Once all the releases are done, update
98: * po_headers or po_releases with the new revision number and set
99: * authorization_status to "Requires Reapproval" and initiate

Line 127: -- po_line_locations with the retroactive_date in po_lines so that

123: -- and selects all the releases againt BA (or std PO against GA).
124: -- Get the new price based on the release/Std PO shipment values.
125: -- If they are different, then update po_line_locations with the
126: -- new price. In either case, update retoractive_date in
127: -- po_line_locations with the retroactive_date in po_lines so that
128: -- this shipment will not be picked up again unless blanket line
129: -- is retroactively changed. Once all the releases are done, update
130: -- po_headers or po_releases with the new revision number and set
131: -- authorization_status to "Requires Reapproval" and initiate

Line 243: from po_headers_all poh, po_lines_all pol, po_line_locations_all poll,

239: poll.price_override, nvl(poll.need_by_date,sysdate),
240: poh.po_header_id,
241: poh.authorization_status, poh.revision_num,
242: poha.revision_num
243: from po_headers_all poh, po_lines_all pol, po_line_locations_all poll,
244: po_headers_archive_all poha,financials_system_params_all fsp
245: where pol.from_line_id = l_po_line_id
246: and poh.po_header_id = pol.po_header_id
247: and poh.org_id = fsp.org_id -- -- Bug 3573266

Line 277: * and cancel_flag for the StdPO lines.

273: poll1.quantity_received <> 0)
274: or
275: poll1.quantity_billed <> 0))
276: /* Bug 2725744. Added the condition to check for closed_code
277: * and cancel_flag for the StdPO lines.
278: */
279: and nvl(pol.closed_code,'OPEN') IN ('OPEN','CLOSED',
280: 'CLOSED FOR RECEIVING',
281: /* Bug 3334043: Std.POs that are closed by setting 'Invoice Close

Line 340: from po_headers_all poh, po_lines_all pol, po_line_locations_all poll,

336: poll.price_override, nvl(poll.need_by_date,sysdate),
337: poh.po_header_id,
338: poh.authorization_status, poh.revision_num,
339: poha.revision_num
340: from po_headers_all poh, po_lines_all pol, po_line_locations_all poll,
341: po_headers_archive_all poha, po_document_types_all_b pdt,
342: financials_system_params_all fsp
343: where pol.from_line_id = l_po_line_id
344: and poh.po_header_id = pol.po_header_id

Line 373: * and cancel_flag for the StdPO lines.

369: and nvl(poh.closed_code,'OPEN') <> 'FINALLY CLOSED'
370: and nvl(poh.cancel_flag,'N') <> 'Y'
371: and pol.po_line_id = poll.po_line_id
372: /* Bug 2725744. Added the condition to check for closed_code
373: * and cancel_flag for the StdPO lines.
374: */
375: and nvl(pol.closed_code,'OPEN') <> 'FINALLY CLOSED'
376: and nvl(pol.cancel_flag,'N') <> 'Y'
377: and nvl(poll.need_by_date,poh.creation_date) >=

Line 407: po_lines_all pol,

403: poh.authorization_status,
404: poh.revision_num,
405: poha.revision_num
406: FROM po_headers_all poh,
407: po_lines_all pol,
408: po_line_locations_all poll,
409: po_headers_archive_all poha,
410: financials_system_params_all fsp
411: WHERE pol.Contract_id = l_po_header_id

Line 471: po_lines_all pol,

467: poh.authorization_status,
468: poh.revision_num,
469: poha.revision_num
470: FROM po_headers_all poh,
471: po_lines_all pol,
472: po_line_locations_all poll,
473: po_headers_archive_all poha,
474: po_document_types_all_b pdt,
475: financials_system_params_all fsp

Line 560: l_po_line_id PO_LINES_ALL.PO_LINE_ID%TYPE;

556:
557: l_agreement_cur g_agreement_cur_type;
558:
559:
560: l_po_line_id PO_LINES_ALL.PO_LINE_ID%TYPE;
561: l_retroactive_date PO_LINES_ALL.retroactive_date%TYPE;
562: l_global_agreement_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
563:
564:

Line 561: l_retroactive_date PO_LINES_ALL.retroactive_date%TYPE;

557: l_agreement_cur g_agreement_cur_type;
558:
559:
560: l_po_line_id PO_LINES_ALL.PO_LINE_ID%TYPE;
561: l_retroactive_date PO_LINES_ALL.retroactive_date%TYPE;
562: l_global_agreement_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
563:
564:
565:

Line 756: 'po_lines pol, ' ||

752: l_module := g_log_head||l_api_name||'.'||'010'||'.';
753: l_sql_str := 'select poh.po_header_id,pol.po_line_id, pol.retroactive_date, ' ||
754: 'poh.global_agreement_flag ' ||
755: 'from po_headers_all poh, ' ||
756: 'po_lines pol, ' ||
757: 'mtl_system_items msi, ' ||
758: 'financials_system_params_all fsp, ' ; --
759: l_sql_str1 := 'mtl_categories mca ' ||
760: 'where poh.type_lookup_code = ''BLANKET'' ' ||

Line 794: '(select ''has stdpo'' from po_lines_all pl where '||

790: '((nvl(poh.global_agreement_flag,''N'') = ''Y'') '||
791: ' and ' ||
792: ' (:l_ga_security = ''Y'') '||
793: ' and exists '||
794: '(select ''has stdpo'' from po_lines_all pl where '||
795: ' pl.from_line_id = pol.po_line_id))) ' ;
796: --
797: l_sql_str9 := ' UNION ALL '||
798: 'select poh.po_header_id,NULL, ' ||

Line 810: ' ( SELECT ''has stdpo'' FROM po_lines_all pl '||

806: 'and nvl(poh.authorization_status,''INCOMPLETE'') = ''APPROVED'' ' ||
807: 'and nvl(poh.frozen_flag, ''N'') = ''N'' ' ||
808: 'and nvl(poh.consigned_consumption_flag,''N'') =''N'' '||
809: 'and exists ' ||
810: ' ( SELECT ''has stdpo'' FROM po_lines_all pl '||
811: ' WHERE pl.contract_id = poh.po_header_id ) ';
812: --
813:
814:

Line 1112: * po_lines. This means that this PO

1108: * we run the Concurrent program again. We
1109: * will not be selecting these Std PO
1110: * shipments whose retroactive_date is
1111: * greater than the retroactive_date in
1112: * po_lines. This means that this PO
1113: * shipment was processed after the blanket
1114: * line was changed.
1115: */
1116: -- Bulk Update

Line 1357: * po_lines. This means that this PO

1353: * we run the Concurrent program again. We
1354: * will not be selecting these Std PO
1355: * shipments whose retroactive_date is
1356: * greater than the retroactive_date in
1357: * po_lines. This means that this PO
1358: * shipment was processed after the blanket
1359: * line was changed.
1360: */
1361: -- Bulk Update

Line 1658: UPDATE po_lines_all

1654:
1655: l_module := g_log_head||l_api_name||'.'||'110'||'.';
1656: if l_temp_row_id_table.COUNT <> 0 then
1657: FORALL price_update_index in 1..l_temp_row_id_table.COUNT
1658: UPDATE po_lines_all
1659: SET unit_price =
1660: l_temp_new_price_table(price_update_index),
1661: manual_price_change_flag = 'N', --
1662: last_update_date = g_sysdate,

Line 1684: from po_lines_all pll where

1680: NVL(tax_attribute_update_code,'UPDATE')
1681: --
1682: WHERE poll.po_line_id =
1683: (select pll.po_line_id
1684: from po_lines_all pll where
1685: rowid=l_temp_row_id_table(price_update_index));
1686:
1687: end if; /*l_temp_row_id_table.COUNT <> 0 */
1688: exit when update_line_price%notfound;

Line 2177: from po_lines_all pll where

2173: poll.last_update_date = g_sysdate,
2174: poll.last_updated_by = g_user_id
2175: WHERE poll.po_line_id =
2176: (select pll.po_line_id
2177: from po_lines_all pll where
2178: rowid=l_row_id_table(ship_update_index));
2179:
2180: exception
2181: when l_tax_failure then

Line 2238: l_po_line_id PO_LINES_ALL.po_line_id%TYPE;

2234: l_api_name CONSTANT VARCHAR2(50) := 'Process_Price_Change';
2235: l_error_message varchar2(2000);
2236: l_std_po_price_change VARCHAR2(1);
2237: l_retroactive_update VARCHAR2(30) := 'NEVER';
2238: l_po_line_id PO_LINES_ALL.po_line_id%TYPE;
2239:
2240: --
2241: l_quantity PO_LINES.quantity%TYPE;
2242: l_ship_to_location_id PO_LINE_LOCATIONS.ship_to_location_id%TYPE;

Line 2241: l_quantity PO_LINES.quantity%TYPE;

2237: l_retroactive_update VARCHAR2(30) := 'NEVER';
2238: l_po_line_id PO_LINES_ALL.po_line_id%TYPE;
2239:
2240: --
2241: l_quantity PO_LINES.quantity%TYPE;
2242: l_ship_to_location_id PO_LINE_LOCATIONS.ship_to_location_id%TYPE;
2243: l_ship_to_org_id PO_LINE_LOCATIONS.ship_to_organization_id%TYPE;
2244: l_need_by_date PO_LINE_LOCATIONS.need_by_date%TYPE;
2245: l_from_line_id PO_LINES.from_line_id%TYPE;

Line 2245: l_from_line_id PO_LINES.from_line_id%TYPE;

2241: l_quantity PO_LINES.quantity%TYPE;
2242: l_ship_to_location_id PO_LINE_LOCATIONS.ship_to_location_id%TYPE;
2243: l_ship_to_org_id PO_LINE_LOCATIONS.ship_to_organization_id%TYPE;
2244: l_need_by_date PO_LINE_LOCATIONS.need_by_date%TYPE;
2245: l_from_line_id PO_LINES.from_line_id%TYPE;
2246: l_org_id po_lines.org_id%TYPE;
2247: l_contract_id po_lines.contract_id%TYPE;
2248: l_order_header_id po_lines.po_header_id%TYPE;
2249: l_order_line_id po_lines.po_line_id%TYPE;

Line 2246: l_org_id po_lines.org_id%TYPE;

2242: l_ship_to_location_id PO_LINE_LOCATIONS.ship_to_location_id%TYPE;
2243: l_ship_to_org_id PO_LINE_LOCATIONS.ship_to_organization_id%TYPE;
2244: l_need_by_date PO_LINE_LOCATIONS.need_by_date%TYPE;
2245: l_from_line_id PO_LINES.from_line_id%TYPE;
2246: l_org_id po_lines.org_id%TYPE;
2247: l_contract_id po_lines.contract_id%TYPE;
2248: l_order_header_id po_lines.po_header_id%TYPE;
2249: l_order_line_id po_lines.po_line_id%TYPE;
2250: l_creation_date po_lines.creation_date%TYPE;

Line 2247: l_contract_id po_lines.contract_id%TYPE;

2243: l_ship_to_org_id PO_LINE_LOCATIONS.ship_to_organization_id%TYPE;
2244: l_need_by_date PO_LINE_LOCATIONS.need_by_date%TYPE;
2245: l_from_line_id PO_LINES.from_line_id%TYPE;
2246: l_org_id po_lines.org_id%TYPE;
2247: l_contract_id po_lines.contract_id%TYPE;
2248: l_order_header_id po_lines.po_header_id%TYPE;
2249: l_order_line_id po_lines.po_line_id%TYPE;
2250: l_creation_date po_lines.creation_date%TYPE;
2251: l_item_id po_lines.item_id%TYPE;

Line 2248: l_order_header_id po_lines.po_header_id%TYPE;

2244: l_need_by_date PO_LINE_LOCATIONS.need_by_date%TYPE;
2245: l_from_line_id PO_LINES.from_line_id%TYPE;
2246: l_org_id po_lines.org_id%TYPE;
2247: l_contract_id po_lines.contract_id%TYPE;
2248: l_order_header_id po_lines.po_header_id%TYPE;
2249: l_order_line_id po_lines.po_line_id%TYPE;
2250: l_creation_date po_lines.creation_date%TYPE;
2251: l_item_id po_lines.item_id%TYPE;
2252: l_item_revision po_lines.item_revision%TYPE;

Line 2249: l_order_line_id po_lines.po_line_id%TYPE;

2245: l_from_line_id PO_LINES.from_line_id%TYPE;
2246: l_org_id po_lines.org_id%TYPE;
2247: l_contract_id po_lines.contract_id%TYPE;
2248: l_order_header_id po_lines.po_header_id%TYPE;
2249: l_order_line_id po_lines.po_line_id%TYPE;
2250: l_creation_date po_lines.creation_date%TYPE;
2251: l_item_id po_lines.item_id%TYPE;
2252: l_item_revision po_lines.item_revision%TYPE;
2253: l_category_id po_lines.category_id%TYPE;

Line 2250: l_creation_date po_lines.creation_date%TYPE;

2246: l_org_id po_lines.org_id%TYPE;
2247: l_contract_id po_lines.contract_id%TYPE;
2248: l_order_header_id po_lines.po_header_id%TYPE;
2249: l_order_line_id po_lines.po_line_id%TYPE;
2250: l_creation_date po_lines.creation_date%TYPE;
2251: l_item_id po_lines.item_id%TYPE;
2252: l_item_revision po_lines.item_revision%TYPE;
2253: l_category_id po_lines.category_id%TYPE;
2254: l_line_type_id po_lines.line_type_id%TYPE;

Line 2251: l_item_id po_lines.item_id%TYPE;

2247: l_contract_id po_lines.contract_id%TYPE;
2248: l_order_header_id po_lines.po_header_id%TYPE;
2249: l_order_line_id po_lines.po_line_id%TYPE;
2250: l_creation_date po_lines.creation_date%TYPE;
2251: l_item_id po_lines.item_id%TYPE;
2252: l_item_revision po_lines.item_revision%TYPE;
2253: l_category_id po_lines.category_id%TYPE;
2254: l_line_type_id po_lines.line_type_id%TYPE;
2255: l_vendor_product_num po_lines.vendor_product_num%TYPE;

Line 2252: l_item_revision po_lines.item_revision%TYPE;

2248: l_order_header_id po_lines.po_header_id%TYPE;
2249: l_order_line_id po_lines.po_line_id%TYPE;
2250: l_creation_date po_lines.creation_date%TYPE;
2251: l_item_id po_lines.item_id%TYPE;
2252: l_item_revision po_lines.item_revision%TYPE;
2253: l_category_id po_lines.category_id%TYPE;
2254: l_line_type_id po_lines.line_type_id%TYPE;
2255: l_vendor_product_num po_lines.vendor_product_num%TYPE;
2256: l_vendor_id po_headers.vendor_id%TYPE;

Line 2253: l_category_id po_lines.category_id%TYPE;

2249: l_order_line_id po_lines.po_line_id%TYPE;
2250: l_creation_date po_lines.creation_date%TYPE;
2251: l_item_id po_lines.item_id%TYPE;
2252: l_item_revision po_lines.item_revision%TYPE;
2253: l_category_id po_lines.category_id%TYPE;
2254: l_line_type_id po_lines.line_type_id%TYPE;
2255: l_vendor_product_num po_lines.vendor_product_num%TYPE;
2256: l_vendor_id po_headers.vendor_id%TYPE;
2257: l_vendor_site_id po_headers.vendor_site_id%TYPE;

Line 2254: l_line_type_id po_lines.line_type_id%TYPE;

2250: l_creation_date po_lines.creation_date%TYPE;
2251: l_item_id po_lines.item_id%TYPE;
2252: l_item_revision po_lines.item_revision%TYPE;
2253: l_category_id po_lines.category_id%TYPE;
2254: l_line_type_id po_lines.line_type_id%TYPE;
2255: l_vendor_product_num po_lines.vendor_product_num%TYPE;
2256: l_vendor_id po_headers.vendor_id%TYPE;
2257: l_vendor_site_id po_headers.vendor_site_id%TYPE;
2258: l_uom po_lines.unit_meas_lookup_code%TYPE;

Line 2255: l_vendor_product_num po_lines.vendor_product_num%TYPE;

2251: l_item_id po_lines.item_id%TYPE;
2252: l_item_revision po_lines.item_revision%TYPE;
2253: l_category_id po_lines.category_id%TYPE;
2254: l_line_type_id po_lines.line_type_id%TYPE;
2255: l_vendor_product_num po_lines.vendor_product_num%TYPE;
2256: l_vendor_id po_headers.vendor_id%TYPE;
2257: l_vendor_site_id po_headers.vendor_site_id%TYPE;
2258: l_uom po_lines.unit_meas_lookup_code%TYPE;
2259: l_in_unit_price po_lines.unit_price%TYPE;

Line 2258: l_uom po_lines.unit_meas_lookup_code%TYPE;

2254: l_line_type_id po_lines.line_type_id%TYPE;
2255: l_vendor_product_num po_lines.vendor_product_num%TYPE;
2256: l_vendor_id po_headers.vendor_id%TYPE;
2257: l_vendor_site_id po_headers.vendor_site_id%TYPE;
2258: l_uom po_lines.unit_meas_lookup_code%TYPE;
2259: l_in_unit_price po_lines.unit_price%TYPE;
2260: l_base_unit_price po_lines.base_unit_price%TYPE;
2261: l_currency_code po_headers.currency_code%TYPE;
2262: l_return_status VARCHAR2(1);

Line 2259: l_in_unit_price po_lines.unit_price%TYPE;

2255: l_vendor_product_num po_lines.vendor_product_num%TYPE;
2256: l_vendor_id po_headers.vendor_id%TYPE;
2257: l_vendor_site_id po_headers.vendor_site_id%TYPE;
2258: l_uom po_lines.unit_meas_lookup_code%TYPE;
2259: l_in_unit_price po_lines.unit_price%TYPE;
2260: l_base_unit_price po_lines.base_unit_price%TYPE;
2261: l_currency_code po_headers.currency_code%TYPE;
2262: l_return_status VARCHAR2(1);
2263:

Line 2260: l_base_unit_price po_lines.base_unit_price%TYPE;

2256: l_vendor_id po_headers.vendor_id%TYPE;
2257: l_vendor_site_id po_headers.vendor_site_id%TYPE;
2258: l_uom po_lines.unit_meas_lookup_code%TYPE;
2259: l_in_unit_price po_lines.unit_price%TYPE;
2260: l_base_unit_price po_lines.base_unit_price%TYPE;
2261: l_currency_code po_headers.currency_code%TYPE;
2262: l_return_status VARCHAR2(1);
2263:
2264: x_base_unit_price NUMBER ;

Line 2435: FROM po_line_locations_all PLL, po_lines_all POL,

2431: l_vendor_site_id,
2432: l_uom,
2433: l_in_unit_price,
2434: l_currency_code
2435: FROM po_line_locations_all PLL, po_lines_all POL,
2436: po_headers_all POH
2437: WHERE PLL.line_location_id = p_po_line_location_id
2438: AND POL.po_line_id = PLL.po_line_id
2439: AND POH.po_header_id = POL.po_header_id;

Line 3267: -- SQL Why : For Standard PO, column po_lines.retroactive_date will

3263: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Reset retroactive_date for PO');
3264: END IF; /* IF g_debug_stmt */
3265:
3266: -- SQL What: Reset retroactive_date for this PO
3267: -- SQL Why : For Standard PO, column po_lines.retroactive_date will
3268: -- be updated if any retroactive pricing changes. Reset it
3269: -- to NULL after processing retroactive pricing.
3270: UPDATE po_lines_all
3271: SET retroactive_date = NULL,

Line 3270: UPDATE po_lines_all

3266: -- SQL What: Reset retroactive_date for this PO
3267: -- SQL Why : For Standard PO, column po_lines.retroactive_date will
3268: -- be updated if any retroactive pricing changes. Reset it
3269: -- to NULL after processing retroactive pricing.
3270: UPDATE po_lines_all
3271: SET retroactive_date = NULL,
3272: last_update_date = SYSDATE,
3273: last_updated_by = l_user_id
3274: WHERE po_header_id = p_document_id;

Line 3288: FROM po_lines_all pl

3284: -- to the corresponding blanket line retroactive_date after
3285: -- processing retroactive pricing.
3286: UPDATE po_line_locations_all pll
3287: SET retroactive_date = (SELECT pl.retroactive_date
3288: FROM po_lines_all pl
3289: WHERE pl.po_line_id = pll.po_line_id),
3290: last_update_date = SYSDATE,
3291: last_updated_by = l_user_id
3292: WHERE pll.po_release_id = p_document_id;

Line 3468: po_lines_all pol, --

3464: pod.project_id,
3465: pod.task_id,
3466: pod.accrual_account_id distribute_account_id
3467: FROM po_headers poh,
3468: po_lines_all pol, --
3469: -- Bug 3393219, Consumption transaction owning org
3470: -- financials_system_parameters fsp,
3471: po_line_locations_all poll, --
3472: po_line_locations_archive_all polla, --

Line 3536: po_lines pol,

3532: pod.task_id,
3533: pod.accrual_account_id distribute_account_id
3534: FROM po_releases por,
3535: po_headers_all poh, --
3536: po_lines pol,
3537: -- Bug 3393219, Consumption transaction owning org
3538: -- financials_system_parameters fsp,
3539: po_line_locations_all poll, --
3540: po_line_locations_archive_all polla, --

Line 3579: l_primary_quantity PO_LINES.quantity%TYPE;

3575: l_project_ids_tbl po_tbl_number;
3576: l_task_ids_tbl po_tbl_number;
3577: l_dist_account_ids_tbl po_tbl_number;
3578:
3579: l_primary_quantity PO_LINES.quantity%TYPE;
3580: l_primary_uom PO_LINES.unit_meas_lookup_code%TYPE;
3581: l_uom_code MTL_UNITS_OF_MEASURE.uom_code%TYPE;
3582:
3583: l_consigned_flag PO_HEADERS.consigned_consumption_flag%TYPE;

Line 3580: l_primary_uom PO_LINES.unit_meas_lookup_code%TYPE;

3576: l_task_ids_tbl po_tbl_number;
3577: l_dist_account_ids_tbl po_tbl_number;
3578:
3579: l_primary_quantity PO_LINES.quantity%TYPE;
3580: l_primary_uom PO_LINES.unit_meas_lookup_code%TYPE;
3581: l_uom_code MTL_UNITS_OF_MEASURE.uom_code%TYPE;
3582:
3583: l_consigned_flag PO_HEADERS.consigned_consumption_flag%TYPE;
3584: l_return_status varchar2(1);