DBA Data[Home] [Help]

APPS.PO_RETROACTIVE_PRICING_PVT dependencies on PO_HEADERS

Line 89: * Authorization_status, revision_num in po_headers and po_releases.

85:
86: /**
87: * Private Procedure: MassUpdate_Releases
88: * Modifies: Column price_override, retroactive_date in po_line_locations,
89: * Authorization_status, revision_num in po_headers and po_releases.
90: * Effects: Selects the agreements( blankets and contracts) as specified
91: * by the concurrent parameters and selects the execution docs
92: * refering these agreements for retroactive price updates.
93: * Get the new price based on the release/Std PO shipment values.

Line 99: * po_headers or po_releases with the new revision number and set

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
101: * Workflow if the document was already in Approved state.
102: * Returns:
103: * x_return_status - FND_API.G_RET_STS_SUCCESS if control action succeeds

Line 114: -- Authorization_status, revision_num in po_headers and po_releases.

110: --Pre-reqs:
111: -- None.
112: --Modifies:
113: -- Column price_override, retroactive_date in po_line_locations,
114: -- Authorization_status, revision_num in po_headers and po_releases.
115: --Locks:
116: -- None.
117: --Function:
118: -- This API is called from the Approval Window or by the

Line 131: -- po_headers or po_releases with the new revision number and set

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
133: -- Workflow if the document was already in Approved state.
134: --Parameters:
135: --IN:

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 251: po_headers_archive_all poha,financials_system_params_all fsp

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
255: and nvl(fsp.purch_encumbrance_flag,'N') = 'N' -- Bug 3573266

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 360: po_headers_archive_all poha, po_document_types_all_b pdt,

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
364: and poh.org_id = fsp.org_id -- -- Bug 3573266

Line 431: FROM po_headers_all poh,

427: poh.po_header_id,
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

Line 434: po_headers_archive_all poha,

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
437: AND pol.from_header_id IS NULL
438: AND poh.po_header_id = pol.po_header_id

Line 495: FROM po_headers_all poh,

491: poh.po_header_id,
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,

Line 498: po_headers_archive_all poha,

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
501: WHERE pol.Contract_id = l_po_header_id
502: AND pol.from_header_id IS NULL

Line 587: l_global_agreement_flag PO_HEADERS_ALL.global_agreement_flag%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:
591: l_api_version CONSTANT NUMBER := 1.0;

Line 781: 'from po_headers_all poh, ' ||

777: */
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 ' ||

Line 826: 'from po_headers poh ' ||

822: --
823: l_sql_str9 := ' UNION ALL '||
824: 'select poh.po_header_id,NULL, ' ||
825: 'NULL, poh.global_agreement_flag ' ||
826: 'from po_headers poh ' ||
827: 'where poh.type_lookup_code = ''CONTRACT'' ' ||
828: 'and poh.po_header_id = nvl(:p_po_header_id, poh.po_header_id) ' ||
829: 'and poh.vendor_id = :p_vendor_id ' ||
830: 'and poh.vendor_site_id = ' ||

Line 2016: * we need to make the approved_flag in po_headers and the last

2012:
2013: -- Bulk Update
2014: /* Bug 2714259.
2015: * In addition to making authorization_status to Requires Reapproval,
2016: * we need to make the approved_flag in po_headers and the last
2017: * updated columns.
2018: */
2019: -- Bug 5168776 Update the Revised Date also
2020: l_module := g_log_head||l_api_name||'.'||'010'||'.';

Line 2086: * Modifies: authorization_Status and revision_num in po_headers.

2082:
2083:
2084: /**
2085: * Private Procedure: WrapUp_Standard_PO
2086: * Modifies: authorization_Status and revision_num in po_headers.
2087: * Effects: If any release shipment is updated with the new price, then
2088: * revision_num must be incremented and authorization_Status
2089: * has to be updated to Requires approval if the status is
2090: * Approved. This is called from massupdate_releases procedure.

Line 2164: * we need to make the approved_flag in po_headers and the last updated

2160:
2161: -- Bulk Update
2162: /* Bug 2714259.
2163: * In addition to making authorization_status to Requires Reapproval,
2164: * we need to make the approved_flag in po_headers and the last updated
2165: * columns.
2166: */
2167: -- Bug 5168776 Update the Revised Date also
2168: FORALL doc_update_index in 1..g_po_header_id_table.COUNT

Line 2169: UPDATE po_headers_all poh

2165: * columns.
2166: */
2167: -- Bug 5168776 Update the Revised Date also
2168: FORALL doc_update_index in 1..g_po_header_id_table.COUNT
2169: UPDATE po_headers_all poh
2170: SET poh.revision_num = decode(poh.revision_num,
2171: l_global_arch_rev_num_table(doc_update_index),
2172: poh.revision_num +1,poh.revision_num),
2173: poh.revised_date = decode(poh.revision_num,

Line 2286: l_vendor_id po_headers.vendor_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;
2290: l_base_unit_price po_lines.base_unit_price%TYPE;

Line 2287: l_vendor_site_id po_headers.vendor_site_id%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;
2290: l_base_unit_price po_lines.base_unit_price%TYPE;
2291: l_currency_code po_headers.currency_code%TYPE;

Line 2291: l_currency_code po_headers.currency_code%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 ;
2295: x_price_break_id NUMBER ;

Line 2463: po_headers_all POH

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;
2467:

Line 2569: PO_HEADERS_ALL HDR,

2565: BEGIN
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;

Line 2613: * Modifies: Authorization_status of po_headers if the document was

2609:
2610:
2611: /**
2612: * Private Procedure: Launch_PO_Approval
2613: * Modifies: Authorization_status of po_headers if the document was
2614: * already approved.
2615: * Effects: Get the po_header_id from the global temp table po_retroprice_gt
2616: * which has all the document ids that have been updated with
2617: * new price. If the document is in the approved state, then

Line 2634: l_consigned_flag PO_HEADERS_ALL.consigned_consumption_flag%TYPE;

2630: x_online_report_id number;
2631: x_msg_count number;
2632: l_doc_org_id number;
2633: -- Bug 3318625
2634: l_consigned_flag PO_HEADERS_ALL.consigned_consumption_flag%TYPE;
2635: x_text_line po_online_report_text.text_line%TYPE; --Bug9040655
2636: max_sequence_num po_online_report_text.sequence%TYPE; --Bug9040655
2637: begin
2638:

Line 2643: * sent for submission check, get the org_id from po_headers_all.

2639: l_module := g_log_head||l_api_name||'.'||'000'||'.';
2640: /* Bug 2707350.
2641: * Org context needs to be set for the submission check procedure.
2642: * Get the orig org_id and then for each document that will be sent
2643: * sent for submission check, get the org_id from po_headers_all.
2644: * Set the org context using this org_id and if submission check
2645: * is successful, initiate approval. When all documents are done
2646: * set the original org context.
2647: */

Line 2660: from po_headers_all

2656: select org_id,
2657: NVL(consigned_consumption_flag, 'N') -- Bug 3318625
2658: into l_doc_org_id,
2659: l_consigned_flag -- Bug 3318625
2660: from po_headers_all
2661: where po_header_id = g_po_header_id_table(i);
2662:
2663: -- Bug 3318625 START
2664: IF (g_po_auth_table(i) = 'APPROVED' OR

Line 2907: * Modifies: Authorization_status of po_headers and po_releaes.

2903: end Launch_REL_Approval;
2904:
2905: /**
2906: * Private Procedure: Retroactive_Launch_Approval
2907: * Modifies: Authorization_status of po_headers and po_releaes.
2908: * Effects: Get the default supplier communiation flags using
2909: * po_vendor_sites_sv.get_transmission_defaults and then
2910: * call start_wf_process by setting the correct values
2911: * for the supplier communication flags. This is called from

Line 2926: l_ItemType po_headers_all.WF_ITEM_TYPE%TYPE := null;

2922: l_forward_to_id number;
2923: l_forward_from_id number;
2924: l_def_approval_path_id number;
2925: l_note varchar2(25);
2926: l_ItemType po_headers_all.WF_ITEM_TYPE%TYPE := null;
2927: l_ItemKey po_headers_all.WF_ITEM_Key%TYPE := null;
2928: l_seq_for_item_key varchar2(6) := null;
2929: l_action_orig_from varchar2(30) := 'RETRO'; --need to findout
2930: l_xmlsetup varchar2(1) := 'N';

Line 2927: l_ItemKey po_headers_all.WF_ITEM_Key%TYPE := null;

2923: l_forward_from_id number;
2924: l_def_approval_path_id number;
2925: l_note varchar2(25);
2926: l_ItemType po_headers_all.WF_ITEM_TYPE%TYPE := null;
2927: l_ItemKey po_headers_all.WF_ITEM_Key%TYPE := null;
2928: l_seq_for_item_key varchar2(6) := null;
2929: l_action_orig_from varchar2(30) := 'RETRO'; --need to findout
2930: l_xmlsetup varchar2(1) := 'N';
2931: l_docnum po_headers_all.segment1%type;

Line 2931: l_docnum po_headers_all.segment1%type;

2927: l_ItemKey po_headers_all.WF_ITEM_Key%TYPE := null;
2928: l_seq_for_item_key varchar2(6) := null;
2929: l_action_orig_from varchar2(30) := 'RETRO'; --need to findout
2930: l_xmlsetup varchar2(1) := 'N';
2931: l_docnum po_headers_all.segment1%type;
2932: l_preparer_id po_headers.agent_id%type;
2933: l_default_method PO_VENDOR_SITES.SUPPLIER_NOTIF_METHOD%TYPE := null;
2934: l_email_address po_vendor_sites.email_Address%type := null;
2935: l_fax_number varchar2(30) := null; --Changed as part of Bug 5765243

Line 2932: l_preparer_id po_headers.agent_id%type;

2928: l_seq_for_item_key varchar2(6) := null;
2929: l_action_orig_from varchar2(30) := 'RETRO'; --need to findout
2930: l_xmlsetup varchar2(1) := 'N';
2931: l_docnum po_headers_all.segment1%type;
2932: l_preparer_id po_headers.agent_id%type;
2933: l_default_method PO_VENDOR_SITES.SUPPLIER_NOTIF_METHOD%TYPE := null;
2934: l_email_address po_vendor_sites.email_Address%type := null;
2935: l_fax_number varchar2(30) := null; --Changed as part of Bug 5765243
2936: l_document_num po_headers.segment1%type;

Line 2936: l_document_num po_headers.segment1%type;

2932: l_preparer_id po_headers.agent_id%type;
2933: l_default_method PO_VENDOR_SITES.SUPPLIER_NOTIF_METHOD%TYPE := null;
2934: l_email_address po_vendor_sites.email_Address%type := null;
2935: l_fax_number varchar2(30) := null; --Changed as part of Bug 5765243
2936: l_document_num po_headers.segment1%type;
2937: l_xml_flag varchar2(1) := 'N';
2938: l_email_flag varchar2(1) := 'N';
2939: l_fax_flag varchar2(1) := 'N';
2940: l_print_flag varchar2(1) := 'N';

Line 2962: FROM po_headers_all poh

2958: */
2959: If ((p_doc_type = 'PO') OR (p_doc_type = 'PA')) then
2960: SELECT poh.org_id
2961: into l_org_id
2962: FROM po_headers_all poh
2963: WHERE poh.po_header_id = p_doc_id;
2964: elsif (p_doc_type = 'RELEASE') then
2965: SELECT por.org_id
2966: into l_org_id

Line 3588: FROM po_headers poh,

3584: pod.po_distribution_id,
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, --

Line 3656: po_headers_all poh, --

3652: pod.project_id,
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, --

Line 3704: l_consigned_flag PO_HEADERS.consigned_consumption_flag%TYPE;

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);
3706: l_msg_data varchar2(2000);
3707: l_msg_count number;
3708:

Line 3767: FROM PO_HEADERS

3763: l_progress := '020';
3764: IF (p_document_type = 'PO') THEN
3765: SELECT NVL(consigned_consumption_flag, 'N')
3766: INTO l_consigned_flag
3767: FROM PO_HEADERS
3768: WHERE po_header_id = p_document_id;
3769: ELSE
3770: SELECT NVL(consigned_consumption_flag, 'N')
3771: INTO l_consigned_flag

Line 4552: l_consigned_flag PO_HEADERS.consigned_consumption_flag%TYPE;

4548: l_qty_received PO_LINE_LOCATIONS.quantity_received%TYPE;
4549: l_accrue_flag PO_LINE_LOCATIONS.accrue_on_receipt_flag%TYPE;
4550: l_qty_billed PO_LINE_LOCATIONS.quantity_billed%TYPE;
4551: -- Bug 3541961
4552: l_consigned_flag PO_HEADERS.consigned_consumption_flag%TYPE;
4553: l_org_id PO_HEADERS.org_id%TYPE;
4554: l_trans_flow_header_id PO_LINE_LOCATIONS.transaction_flow_header_id%TYPE;
4555: l_logical_inv_org_id number;
4556:

Line 4553: l_org_id PO_HEADERS.org_id%TYPE;

4549: l_accrue_flag PO_LINE_LOCATIONS.accrue_on_receipt_flag%TYPE;
4550: l_qty_billed PO_LINE_LOCATIONS.quantity_billed%TYPE;
4551: -- Bug 3541961
4552: l_consigned_flag PO_HEADERS.consigned_consumption_flag%TYPE;
4553: l_org_id PO_HEADERS.org_id%TYPE;
4554: l_trans_flow_header_id PO_LINE_LOCATIONS.transaction_flow_header_id%TYPE;
4555: l_logical_inv_org_id number;
4556:
4557: l_module varchar2(100);

Line 4571: po_headers_all poh

4567: poh.org_id,
4568: pll.transaction_flow_header_id -- Bug 3880758
4569: from po_line_locations_all pll,
4570: -- Bug 3541961
4571: po_headers_all poh
4572: where pll.po_line_id = p_po_line_id
4573: -- Bug 3541961
4574: and pll.po_header_id = poh.po_header_id;
4575:

Line 4798: l_consigned_flag PO_HEADERS.consigned_consumption_flag%TYPE;

4794: RETURN VARCHAR2
4795: IS
4796:
4797: l_is_inv_org_period_open VARCHAR2(1) := 'Y';
4798: l_consigned_flag PO_HEADERS.consigned_consumption_flag%TYPE;
4799: l_trans_flow_header_id PO_LINE_LOCATIONS.transaction_flow_header_id%TYPE;
4800: l_ship_to_organization_id PO_LINE_LOCATIONS.ship_to_organization_id%TYPE;
4801: l_logical_inv_org_id MTL_TRANSACTION_FLOW_LINES.from_organization_id%TYPE;
4802: l_inv_org_id_period_check HR_ALL_ORGANIZATION_UNITS.organization_id%TYPE;

Line 4813: po_headers_all poh

4809: SELECT NVL(poh.consigned_consumption_flag, 'N'),
4810: pll.ship_to_organization_id,
4811: pll.transaction_flow_header_id
4812: FROM po_line_locations_all pll,
4813: po_headers_all poh
4814: WHERE pll.po_line_id = p_po_line_id
4815: AND pll.po_header_id = poh.po_header_id;
4816:
4817: CURSOR REL_SHIPMENTS_CSR IS