DBA Data[Home] [Help]

APPS.PO_RETROACTIVE_PRICING_PVT dependencies on PO_LINES

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

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

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

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

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

246: poll.price_override, nvl(poll.need_by_date,sysdate),
247: poh.po_header_id,
248: poh.authorization_status, poh.revision_num,
249: poha.revision_num
250: from po_headers_all poh, po_lines_all pol, po_line_locations_all poll,
251: po_headers_archive_all poha,financials_system_params_all fsp
252: where pol.from_line_id = l_po_line_id
253: and poh.po_header_id = pol.po_header_id
254: and poh.org_id = fsp.org_id -- -- Bug 3573266

Line 284: * and cancel_flag for the StdPO lines.

280: poll1.quantity_received <> 0)
281: or
282: poll1.quantity_billed <> 0))
283: /* Bug 2725744. Added the condition to check for closed_code
284: * and cancel_flag for the StdPO lines.
285: */
286: and nvl(pol.closed_code,'OPEN') IN ('OPEN','CLOSED',
287: 'CLOSED FOR RECEIVING',
288: /* Bug 3334043: Std.POs that are closed by setting 'Invoice Close

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

355: poll.price_override, nvl(poll.need_by_date,sysdate),
356: poh.po_header_id,
357: poh.authorization_status, poh.revision_num,
358: poha.revision_num
359: from po_headers_all poh, po_lines_all pol, po_line_locations_all poll,
360: po_headers_archive_all poha, po_document_types_all_b pdt,
361: financials_system_params_all fsp
362: where pol.from_line_id = l_po_line_id
363: and poh.po_header_id = pol.po_header_id

Line 392: * and cancel_flag for the StdPO lines.

388: and nvl(poh.closed_code,'OPEN') <> 'FINALLY CLOSED'
389: and nvl(poh.cancel_flag,'N') <> 'Y'
390: and pol.po_line_id = poll.po_line_id
391: /* Bug 2725744. Added the condition to check for closed_code
392: * and cancel_flag for the StdPO lines.
393: */
394: and nvl(pol.closed_code,'OPEN') <> 'FINALLY CLOSED'
395: and nvl(pol.cancel_flag,'N') <> 'Y'
396: and nvl(poll.need_by_date,poh.creation_date) >=

Line 432: po_lines_all pol,

428: poh.authorization_status,
429: poh.revision_num,
430: poha.revision_num
431: FROM po_headers_all poh,
432: po_lines_all pol,
433: po_line_locations_all poll,
434: po_headers_archive_all poha,
435: financials_system_params_all fsp
436: WHERE pol.Contract_id = l_po_header_id

Line 496: po_lines_all pol,

492: poh.authorization_status,
493: poh.revision_num,
494: poha.revision_num
495: FROM po_headers_all poh,
496: po_lines_all pol,
497: po_line_locations_all poll,
498: po_headers_archive_all poha,
499: po_document_types_all_b pdt,
500: financials_system_params_all fsp

Line 585: l_po_line_id PO_LINES_ALL.PO_LINE_ID%TYPE;

581:
582: l_agreement_cur g_agreement_cur_type;
583:
584:
585: l_po_line_id PO_LINES_ALL.PO_LINE_ID%TYPE;
586: l_retroactive_date PO_LINES_ALL.retroactive_date%TYPE;
587: l_global_agreement_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
588:
589:

Line 586: l_retroactive_date PO_LINES_ALL.retroactive_date%TYPE;

582: l_agreement_cur g_agreement_cur_type;
583:
584:
585: l_po_line_id PO_LINES_ALL.PO_LINE_ID%TYPE;
586: l_retroactive_date PO_LINES_ALL.retroactive_date%TYPE;
587: l_global_agreement_flag PO_HEADERS_ALL.global_agreement_flag%TYPE;
588:
589:
590:

Line 782: 'po_lines pol, ' ||

778: l_module := g_log_head||l_api_name||'.'||'010'||'.';
779: l_sql_str := 'select poh.po_header_id,pol.po_line_id, pol.retroactive_date, ' ||
780: 'poh.global_agreement_flag ' ||
781: 'from po_headers_all poh, ' ||
782: 'po_lines pol, ' ||
783: 'mtl_system_items msi, ' ||
784: 'financials_system_params_all fsp, ' ; --
785: l_sql_str1 := 'mtl_categories mca ' ||
786: 'where poh.type_lookup_code = ''BLANKET'' ' ||

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

816: '((nvl(poh.global_agreement_flag,''N'') = ''Y'') '||
817: ' and ' ||
818: ' (:l_ga_security = ''Y'') '||
819: ' and exists '||
820: '(select ''has stdpo'' from po_lines_all pl where '||
821: ' pl.from_line_id = pol.po_line_id))) ' ;
822: --
823: l_sql_str9 := ' UNION ALL '||
824: 'select poh.po_header_id,NULL, ' ||

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

832: 'and nvl(poh.authorization_status,''INCOMPLETE'') = ''APPROVED'' ' ||
833: 'and nvl(poh.frozen_flag, ''N'') = ''N'' ' ||
834: 'and nvl(poh.consigned_consumption_flag,''N'') =''N'' '||
835: 'and exists ' ||
836: ' ( SELECT ''has stdpo'' FROM po_lines_all pl '||
837: ' WHERE pl.contract_id = poh.po_header_id ) ';
838: --
839:
840:

Line 1139: * po_lines. This means that this PO

1135: * we run the Concurrent program again. We
1136: * will not be selecting these Std PO
1137: * shipments whose retroactive_date is
1138: * greater than the retroactive_date in
1139: * po_lines. This means that this PO
1140: * shipment was processed after the blanket
1141: * line was changed.
1142: */
1143: -- Bulk Update

Line 1384: * po_lines. This means that this PO

1380: * we run the Concurrent program again. We
1381: * will not be selecting these Std PO
1382: * shipments whose retroactive_date is
1383: * greater than the retroactive_date in
1384: * po_lines. This means that this PO
1385: * shipment was processed after the blanket
1386: * line was changed.
1387: */
1388: -- Bulk Update

Line 1688: UPDATE po_lines_all

1684:
1685: l_module := g_log_head||l_api_name||'.'||'110'||'.';
1686: if l_temp_row_id_table.COUNT <> 0 then
1687: FORALL price_update_index in 1..l_temp_row_id_table.COUNT
1688: UPDATE po_lines_all
1689: SET unit_price = l_temp_new_price_table(price_update_index),
1690: base_unit_price = NVL(l_temp_new_base_price_table(price_update_index)
1691: ,base_unit_price), --Enhanced Pricing
1692: manual_price_change_flag = 'N', --

Line 1713: from po_lines_all pll where

1709: NVL(tax_attribute_update_code,'UPDATE')
1710: --
1711: WHERE poll.po_line_id =
1712: (select pll.po_line_id
1713: from po_lines_all pll where
1714: rowid=l_temp_row_id_table(price_update_index));
1715:
1716: end if; /*l_temp_row_id_table.COUNT <> 0 */
1717: exit when update_line_price%notfound;

Line 2206: from po_lines_all pll where

2202: poll.last_update_date = g_sysdate,
2203: poll.last_updated_by = g_user_id
2204: WHERE poll.po_line_id =
2205: (select pll.po_line_id
2206: from po_lines_all pll where
2207: rowid=l_row_id_table(ship_update_index));
2208:
2209: exception
2210: when l_tax_failure then

Line 2267: l_po_line_id PO_LINES_ALL.po_line_id%TYPE;

2263: l_api_name CONSTANT VARCHAR2(50) := 'Process_Price_Change';
2264: l_error_message varchar2(2000);
2265: l_std_po_price_change VARCHAR2(1);
2266: l_retroactive_update VARCHAR2(30) := 'NEVER';
2267: l_po_line_id PO_LINES_ALL.po_line_id%TYPE;
2268: l_enhanced_pricing_flag VARCHAR2(1); --Enhanced Pricing
2269:
2270: --
2271: l_quantity PO_LINES.quantity%TYPE;

Line 2271: l_quantity PO_LINES.quantity%TYPE;

2267: l_po_line_id PO_LINES_ALL.po_line_id%TYPE;
2268: l_enhanced_pricing_flag VARCHAR2(1); --Enhanced Pricing
2269:
2270: --
2271: l_quantity PO_LINES.quantity%TYPE;
2272: l_ship_to_location_id PO_LINE_LOCATIONS.ship_to_location_id%TYPE;
2273: l_ship_to_org_id PO_LINE_LOCATIONS.ship_to_organization_id%TYPE;
2274: l_need_by_date PO_LINE_LOCATIONS.need_by_date%TYPE;
2275: l_from_line_id PO_LINES.from_line_id%TYPE;

Line 2275: l_from_line_id PO_LINES.from_line_id%TYPE;

2271: l_quantity PO_LINES.quantity%TYPE;
2272: l_ship_to_location_id PO_LINE_LOCATIONS.ship_to_location_id%TYPE;
2273: l_ship_to_org_id PO_LINE_LOCATIONS.ship_to_organization_id%TYPE;
2274: l_need_by_date PO_LINE_LOCATIONS.need_by_date%TYPE;
2275: l_from_line_id PO_LINES.from_line_id%TYPE;
2276: l_org_id po_lines.org_id%TYPE;
2277: l_contract_id po_lines.contract_id%TYPE;
2278: l_order_header_id po_lines.po_header_id%TYPE;
2279: l_order_line_id po_lines.po_line_id%TYPE;

Line 2276: l_org_id po_lines.org_id%TYPE;

2272: l_ship_to_location_id PO_LINE_LOCATIONS.ship_to_location_id%TYPE;
2273: l_ship_to_org_id PO_LINE_LOCATIONS.ship_to_organization_id%TYPE;
2274: l_need_by_date PO_LINE_LOCATIONS.need_by_date%TYPE;
2275: l_from_line_id PO_LINES.from_line_id%TYPE;
2276: l_org_id po_lines.org_id%TYPE;
2277: l_contract_id po_lines.contract_id%TYPE;
2278: l_order_header_id po_lines.po_header_id%TYPE;
2279: l_order_line_id po_lines.po_line_id%TYPE;
2280: l_creation_date po_lines.creation_date%TYPE;

Line 2277: l_contract_id po_lines.contract_id%TYPE;

2273: l_ship_to_org_id PO_LINE_LOCATIONS.ship_to_organization_id%TYPE;
2274: l_need_by_date PO_LINE_LOCATIONS.need_by_date%TYPE;
2275: l_from_line_id PO_LINES.from_line_id%TYPE;
2276: l_org_id po_lines.org_id%TYPE;
2277: l_contract_id po_lines.contract_id%TYPE;
2278: l_order_header_id po_lines.po_header_id%TYPE;
2279: l_order_line_id po_lines.po_line_id%TYPE;
2280: l_creation_date po_lines.creation_date%TYPE;
2281: l_item_id po_lines.item_id%TYPE;

Line 2278: l_order_header_id po_lines.po_header_id%TYPE;

2274: l_need_by_date PO_LINE_LOCATIONS.need_by_date%TYPE;
2275: l_from_line_id PO_LINES.from_line_id%TYPE;
2276: l_org_id po_lines.org_id%TYPE;
2277: l_contract_id po_lines.contract_id%TYPE;
2278: l_order_header_id po_lines.po_header_id%TYPE;
2279: l_order_line_id po_lines.po_line_id%TYPE;
2280: l_creation_date po_lines.creation_date%TYPE;
2281: l_item_id po_lines.item_id%TYPE;
2282: l_item_revision po_lines.item_revision%TYPE;

Line 2279: l_order_line_id po_lines.po_line_id%TYPE;

2275: l_from_line_id PO_LINES.from_line_id%TYPE;
2276: l_org_id po_lines.org_id%TYPE;
2277: l_contract_id po_lines.contract_id%TYPE;
2278: l_order_header_id po_lines.po_header_id%TYPE;
2279: l_order_line_id po_lines.po_line_id%TYPE;
2280: l_creation_date po_lines.creation_date%TYPE;
2281: l_item_id po_lines.item_id%TYPE;
2282: l_item_revision po_lines.item_revision%TYPE;
2283: l_category_id po_lines.category_id%TYPE;

Line 2280: l_creation_date po_lines.creation_date%TYPE;

2276: l_org_id po_lines.org_id%TYPE;
2277: l_contract_id po_lines.contract_id%TYPE;
2278: l_order_header_id po_lines.po_header_id%TYPE;
2279: l_order_line_id po_lines.po_line_id%TYPE;
2280: l_creation_date po_lines.creation_date%TYPE;
2281: l_item_id po_lines.item_id%TYPE;
2282: l_item_revision po_lines.item_revision%TYPE;
2283: l_category_id po_lines.category_id%TYPE;
2284: l_line_type_id po_lines.line_type_id%TYPE;

Line 2281: l_item_id po_lines.item_id%TYPE;

2277: l_contract_id po_lines.contract_id%TYPE;
2278: l_order_header_id po_lines.po_header_id%TYPE;
2279: l_order_line_id po_lines.po_line_id%TYPE;
2280: l_creation_date po_lines.creation_date%TYPE;
2281: l_item_id po_lines.item_id%TYPE;
2282: l_item_revision po_lines.item_revision%TYPE;
2283: l_category_id po_lines.category_id%TYPE;
2284: l_line_type_id po_lines.line_type_id%TYPE;
2285: l_vendor_product_num po_lines.vendor_product_num%TYPE;

Line 2282: l_item_revision po_lines.item_revision%TYPE;

2278: l_order_header_id po_lines.po_header_id%TYPE;
2279: l_order_line_id po_lines.po_line_id%TYPE;
2280: l_creation_date po_lines.creation_date%TYPE;
2281: l_item_id po_lines.item_id%TYPE;
2282: l_item_revision po_lines.item_revision%TYPE;
2283: l_category_id po_lines.category_id%TYPE;
2284: l_line_type_id po_lines.line_type_id%TYPE;
2285: l_vendor_product_num po_lines.vendor_product_num%TYPE;
2286: l_vendor_id po_headers.vendor_id%TYPE;

Line 2283: l_category_id po_lines.category_id%TYPE;

2279: l_order_line_id po_lines.po_line_id%TYPE;
2280: l_creation_date po_lines.creation_date%TYPE;
2281: l_item_id po_lines.item_id%TYPE;
2282: l_item_revision po_lines.item_revision%TYPE;
2283: l_category_id po_lines.category_id%TYPE;
2284: l_line_type_id po_lines.line_type_id%TYPE;
2285: l_vendor_product_num po_lines.vendor_product_num%TYPE;
2286: l_vendor_id po_headers.vendor_id%TYPE;
2287: l_vendor_site_id po_headers.vendor_site_id%TYPE;

Line 2284: l_line_type_id po_lines.line_type_id%TYPE;

2280: l_creation_date po_lines.creation_date%TYPE;
2281: l_item_id po_lines.item_id%TYPE;
2282: l_item_revision po_lines.item_revision%TYPE;
2283: l_category_id po_lines.category_id%TYPE;
2284: l_line_type_id po_lines.line_type_id%TYPE;
2285: l_vendor_product_num po_lines.vendor_product_num%TYPE;
2286: l_vendor_id po_headers.vendor_id%TYPE;
2287: l_vendor_site_id po_headers.vendor_site_id%TYPE;
2288: l_uom po_lines.unit_meas_lookup_code%TYPE;

Line 2285: l_vendor_product_num po_lines.vendor_product_num%TYPE;

2281: l_item_id po_lines.item_id%TYPE;
2282: l_item_revision po_lines.item_revision%TYPE;
2283: l_category_id po_lines.category_id%TYPE;
2284: l_line_type_id po_lines.line_type_id%TYPE;
2285: l_vendor_product_num po_lines.vendor_product_num%TYPE;
2286: l_vendor_id po_headers.vendor_id%TYPE;
2287: l_vendor_site_id po_headers.vendor_site_id%TYPE;
2288: l_uom po_lines.unit_meas_lookup_code%TYPE;
2289: l_in_unit_price po_lines.unit_price%TYPE;

Line 2288: l_uom po_lines.unit_meas_lookup_code%TYPE;

2284: l_line_type_id po_lines.line_type_id%TYPE;
2285: l_vendor_product_num po_lines.vendor_product_num%TYPE;
2286: l_vendor_id po_headers.vendor_id%TYPE;
2287: l_vendor_site_id po_headers.vendor_site_id%TYPE;
2288: l_uom po_lines.unit_meas_lookup_code%TYPE;
2289: l_in_unit_price po_lines.unit_price%TYPE;
2290: l_base_unit_price po_lines.base_unit_price%TYPE;
2291: l_currency_code po_headers.currency_code%TYPE;
2292: l_return_status VARCHAR2(1);

Line 2289: l_in_unit_price po_lines.unit_price%TYPE;

2285: l_vendor_product_num po_lines.vendor_product_num%TYPE;
2286: l_vendor_id po_headers.vendor_id%TYPE;
2287: l_vendor_site_id po_headers.vendor_site_id%TYPE;
2288: l_uom po_lines.unit_meas_lookup_code%TYPE;
2289: l_in_unit_price po_lines.unit_price%TYPE;
2290: l_base_unit_price po_lines.base_unit_price%TYPE;
2291: l_currency_code po_headers.currency_code%TYPE;
2292: l_return_status VARCHAR2(1);
2293:

Line 2290: l_base_unit_price po_lines.base_unit_price%TYPE;

2286: l_vendor_id po_headers.vendor_id%TYPE;
2287: l_vendor_site_id po_headers.vendor_site_id%TYPE;
2288: l_uom po_lines.unit_meas_lookup_code%TYPE;
2289: l_in_unit_price po_lines.unit_price%TYPE;
2290: l_base_unit_price po_lines.base_unit_price%TYPE;
2291: l_currency_code po_headers.currency_code%TYPE;
2292: l_return_status VARCHAR2(1);
2293:
2294: x_base_unit_price NUMBER ;

Line 2462: FROM po_line_locations_all PLL, po_lines_all POL,

2458: l_vendor_site_id,
2459: l_uom,
2460: l_in_unit_price,
2461: l_currency_code
2462: FROM po_line_locations_all PLL, po_lines_all POL,
2463: po_headers_all POH
2464: WHERE PLL.line_location_id = p_po_line_location_id
2465: AND POL.po_line_id = PLL.po_line_id
2466: AND POH.po_header_id = POL.po_header_id;

Line 2570: PO_LINES_ALL LIN

2566: SELECT DISTINCT STL.enhanced_pricing_flag
2567: INTO l_enhanced_pricing_flag
2568: FROM PO_DOC_STYLE_HEADERS STL,
2569: PO_HEADERS_ALL HDR,
2570: PO_LINES_ALL LIN
2571: WHERE LIN.po_line_id = l_po_line_id
2572: AND LIN.po_header_id = HDR.po_header_id
2573: AND HDR.style_id = STL.style_id;
2574: EXCEPTION

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

3375: PO_DEBUG.debug_stmt(l_log_head,l_progress, 'Reset retroactive_date for PO');
3376: END IF; /* IF g_debug_stmt */
3377:
3378: -- SQL What: Reset retroactive_date for this PO
3379: -- SQL Why : For Standard PO, column po_lines.retroactive_date will
3380: -- be updated if any retroactive pricing changes. Reset it
3381: -- to NULL after processing retroactive pricing.
3382: UPDATE po_lines_all
3383: SET retroactive_date = NULL,

Line 3382: UPDATE po_lines_all

3378: -- SQL What: Reset retroactive_date for this PO
3379: -- SQL Why : For Standard PO, column po_lines.retroactive_date will
3380: -- be updated if any retroactive pricing changes. Reset it
3381: -- to NULL after processing retroactive pricing.
3382: UPDATE po_lines_all
3383: SET retroactive_date = NULL,
3384: last_update_date = SYSDATE,
3385: last_updated_by = l_user_id
3386: WHERE po_header_id = p_document_id;

Line 3409: FROM po_lines_all pl

3405: -- to the corresponding blanket line retroactive_date after
3406: -- processing retroactive pricing.
3407: UPDATE po_line_locations_all pll
3408: SET retroactive_date = (SELECT pl.retroactive_date
3409: FROM po_lines_all pl
3410: WHERE pl.po_line_id = pll.po_line_id),
3411: last_update_date = SYSDATE,
3412: last_updated_by = l_user_id
3413: WHERE pll.po_release_id = p_document_id;

Line 3589: po_lines_all pol, --

3585: pod.project_id,
3586: pod.task_id,
3587: pod.accrual_account_id distribute_account_id
3588: FROM po_headers poh,
3589: po_lines_all pol, --
3590: -- Bug 3393219, Consumption transaction owning org
3591: -- financials_system_parameters fsp,
3592: po_line_locations_all poll, --
3593: po_line_locations_archive_all polla, --

Line 3657: po_lines pol,

3653: pod.task_id,
3654: pod.accrual_account_id distribute_account_id
3655: FROM po_releases por,
3656: po_headers_all poh, --
3657: po_lines pol,
3658: -- Bug 3393219, Consumption transaction owning org
3659: -- financials_system_parameters fsp,
3660: po_line_locations_all poll, --
3661: po_line_locations_archive_all polla, --

Line 3700: l_primary_quantity PO_LINES.quantity%TYPE;

3696: l_project_ids_tbl po_tbl_number;
3697: l_task_ids_tbl po_tbl_number;
3698: l_dist_account_ids_tbl po_tbl_number;
3699:
3700: l_primary_quantity PO_LINES.quantity%TYPE;
3701: l_primary_uom PO_LINES.unit_meas_lookup_code%TYPE;
3702: l_uom_code MTL_UNITS_OF_MEASURE.uom_code%TYPE;
3703:
3704: l_consigned_flag PO_HEADERS.consigned_consumption_flag%TYPE;

Line 3701: l_primary_uom PO_LINES.unit_meas_lookup_code%TYPE;

3697: l_task_ids_tbl po_tbl_number;
3698: l_dist_account_ids_tbl po_tbl_number;
3699:
3700: l_primary_quantity PO_LINES.quantity%TYPE;
3701: l_primary_uom PO_LINES.unit_meas_lookup_code%TYPE;
3702: l_uom_code MTL_UNITS_OF_MEASURE.uom_code%TYPE;
3703:
3704: l_consigned_flag PO_HEADERS.consigned_consumption_flag%TYPE;
3705: l_return_status varchar2(1);