DBA Data[Home] [Help]

APPS.PO_RETROACTIVE_PRICING_PVT dependencies on PO_HEADERS

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

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

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

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

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

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

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

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

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

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

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

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

Line 406: FROM po_headers_all poh,

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

Line 409: po_headers_archive_all poha,

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

Line 470: FROM po_headers_all poh,

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

Line 473: po_headers_archive_all poha,

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

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

Line 755: 'from po_headers_all poh, ' ||

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

Line 800: 'from po_headers poh ' ||

796: --
797: l_sql_str9 := ' UNION ALL '||
798: 'select poh.po_header_id,NULL, ' ||
799: 'NULL, poh.global_agreement_flag ' ||
800: 'from po_headers poh ' ||
801: 'where poh.type_lookup_code = ''CONTRACT'' ' ||
802: 'and poh.po_header_id = nvl(:p_po_header_id, poh.po_header_id) ' ||
803: 'and poh.vendor_id = :p_vendor_id ' ||
804: 'and poh.vendor_site_id = ' ||

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

1983:
1984: -- Bulk Update
1985: /* Bug 2714259.
1986: * In addition to making authorization_status to Requires Reapproval,
1987: * we need to make the approved_flag in po_headers and the last
1988: * updated columns.
1989: */
1990: -- Bug 5168776 Update the Revised Date also
1991: l_module := g_log_head||l_api_name||'.'||'010'||'.';

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

2053:
2054:
2055: /**
2056: * Private Procedure: WrapUp_Standard_PO
2057: * Modifies: authorization_Status and revision_num in po_headers.
2058: * Effects: If any release shipment is updated with the new price, then
2059: * revision_num must be incremented and authorization_Status
2060: * has to be updated to Requires approval if the status is
2061: * Approved. This is called from massupdate_releases procedure.

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

2131:
2132: -- Bulk Update
2133: /* Bug 2714259.
2134: * In addition to making authorization_status to Requires Reapproval,
2135: * we need to make the approved_flag in po_headers and the last updated
2136: * columns.
2137: */
2138: -- Bug 5168776 Update the Revised Date also
2139: FORALL doc_update_index in 1..g_po_header_id_table.COUNT

Line 2140: UPDATE po_headers_all poh

2136: * columns.
2137: */
2138: -- Bug 5168776 Update the Revised Date also
2139: FORALL doc_update_index in 1..g_po_header_id_table.COUNT
2140: UPDATE po_headers_all poh
2141: SET poh.revision_num = decode(poh.revision_num,
2142: l_global_arch_rev_num_table(doc_update_index),
2143: poh.revision_num +1,poh.revision_num),
2144: poh.revised_date = decode(poh.revision_num,

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

Line 2257: l_vendor_site_id po_headers.vendor_site_id%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;
2260: l_base_unit_price po_lines.base_unit_price%TYPE;
2261: l_currency_code po_headers.currency_code%TYPE;

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

Line 2436: po_headers_all POH

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

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

2541:
2542:
2543: /**
2544: * Private Procedure: Launch_PO_Approval
2545: * Modifies: Authorization_status of po_headers if the document was
2546: * already approved.
2547: * Effects: Get the po_header_id from the global temp table po_retroprice_gt
2548: * which has all the document ids that have been updated with
2549: * new price. If the document is in the approved state, then

Line 2566: l_consigned_flag PO_HEADERS_ALL.consigned_consumption_flag%TYPE;

2562: x_online_report_id number;
2563: x_msg_count number;
2564: l_doc_org_id number;
2565: -- Bug 3318625
2566: l_consigned_flag PO_HEADERS_ALL.consigned_consumption_flag%TYPE;
2567: begin
2568:
2569: l_module := g_log_head||l_api_name||'.'||'000'||'.';
2570: /* Bug 2707350.

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

2569: l_module := g_log_head||l_api_name||'.'||'000'||'.';
2570: /* Bug 2707350.
2571: * Org context needs to be set for the submission check procedure.
2572: * Get the orig org_id and then for each document that will be sent
2573: * sent for submission check, get the org_id from po_headers_all.
2574: * Set the org context using this org_id and if submission check
2575: * is successful, initiate approval. When all documents are done
2576: * set the original org context.
2577: */

Line 2590: from po_headers_all

2586: select org_id,
2587: NVL(consigned_consumption_flag, 'N') -- Bug 3318625
2588: into l_doc_org_id,
2589: l_consigned_flag -- Bug 3318625
2590: from po_headers_all
2591: where po_header_id = g_po_header_id_table(i);
2592:
2593: -- Bug 3318625 START
2594: IF (g_po_auth_table(i) = 'APPROVED' OR

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

2791: end Launch_REL_Approval;
2792:
2793: /**
2794: * Private Procedure: Retroactive_Launch_Approval
2795: * Modifies: Authorization_status of po_headers and po_releaes.
2796: * Effects: Get the default supplier communiation flags using
2797: * po_vendor_sites_sv.get_transmission_defaults and then
2798: * call start_wf_process by setting the correct values
2799: * for the supplier communication flags. This is called from

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

2810: l_forward_to_id number;
2811: l_forward_from_id number;
2812: l_def_approval_path_id number;
2813: l_note varchar2(25);
2814: l_ItemType po_headers_all.WF_ITEM_TYPE%TYPE := null;
2815: l_ItemKey po_headers_all.WF_ITEM_Key%TYPE := null;
2816: l_seq_for_item_key varchar2(6) := null;
2817: l_action_orig_from varchar2(30) := 'RETRO'; --need to findout
2818: l_xmlsetup varchar2(1) := 'N';

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

2811: l_forward_from_id number;
2812: l_def_approval_path_id number;
2813: l_note varchar2(25);
2814: l_ItemType po_headers_all.WF_ITEM_TYPE%TYPE := null;
2815: l_ItemKey po_headers_all.WF_ITEM_Key%TYPE := null;
2816: l_seq_for_item_key varchar2(6) := null;
2817: l_action_orig_from varchar2(30) := 'RETRO'; --need to findout
2818: l_xmlsetup varchar2(1) := 'N';
2819: l_docnum po_headers_all.segment1%type;

Line 2819: l_docnum po_headers_all.segment1%type;

2815: l_ItemKey po_headers_all.WF_ITEM_Key%TYPE := null;
2816: l_seq_for_item_key varchar2(6) := null;
2817: l_action_orig_from varchar2(30) := 'RETRO'; --need to findout
2818: l_xmlsetup varchar2(1) := 'N';
2819: l_docnum po_headers_all.segment1%type;
2820: l_preparer_id po_headers.agent_id%type;
2821: l_default_method PO_VENDOR_SITES.SUPPLIER_NOTIF_METHOD%TYPE := null;
2822: l_email_address po_vendor_sites.email_Address%type := null;
2823: l_fax_number varchar2(30) := null; --Changed as part of Bug 5765243

Line 2820: l_preparer_id po_headers.agent_id%type;

2816: l_seq_for_item_key varchar2(6) := null;
2817: l_action_orig_from varchar2(30) := 'RETRO'; --need to findout
2818: l_xmlsetup varchar2(1) := 'N';
2819: l_docnum po_headers_all.segment1%type;
2820: l_preparer_id po_headers.agent_id%type;
2821: l_default_method PO_VENDOR_SITES.SUPPLIER_NOTIF_METHOD%TYPE := null;
2822: l_email_address po_vendor_sites.email_Address%type := null;
2823: l_fax_number varchar2(30) := null; --Changed as part of Bug 5765243
2824: l_document_num po_headers.segment1%type;

Line 2824: l_document_num po_headers.segment1%type;

2820: l_preparer_id po_headers.agent_id%type;
2821: l_default_method PO_VENDOR_SITES.SUPPLIER_NOTIF_METHOD%TYPE := null;
2822: l_email_address po_vendor_sites.email_Address%type := null;
2823: l_fax_number varchar2(30) := null; --Changed as part of Bug 5765243
2824: l_document_num po_headers.segment1%type;
2825: l_xml_flag varchar2(1) := 'N';
2826: l_email_flag varchar2(1) := 'N';
2827: l_fax_flag varchar2(1) := 'N';
2828: l_print_flag varchar2(1) := 'N';

Line 2850: FROM po_headers_all poh

2846: */
2847: If ((p_doc_type = 'PO') OR (p_doc_type = 'PA')) then
2848: SELECT poh.org_id
2849: into l_org_id
2850: FROM po_headers_all poh
2851: WHERE poh.po_header_id = p_doc_id;
2852: elsif (p_doc_type = 'RELEASE') then
2853: SELECT por.org_id
2854: into l_org_id

Line 3467: FROM po_headers poh,

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

Line 3535: po_headers_all poh, --

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

Line 3583: l_consigned_flag PO_HEADERS.consigned_consumption_flag%TYPE;

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);
3585: l_msg_data varchar2(2000);
3586: l_msg_count number;
3587:

Line 3646: FROM PO_HEADERS

3642: l_progress := '020';
3643: IF (p_document_type = 'PO') THEN
3644: SELECT NVL(consigned_consumption_flag, 'N')
3645: INTO l_consigned_flag
3646: FROM PO_HEADERS
3647: WHERE po_header_id = p_document_id;
3648: ELSE
3649: SELECT NVL(consigned_consumption_flag, 'N')
3650: INTO l_consigned_flag

Line 4431: l_consigned_flag PO_HEADERS.consigned_consumption_flag%TYPE;

4427: l_qty_received PO_LINE_LOCATIONS.quantity_received%TYPE;
4428: l_accrue_flag PO_LINE_LOCATIONS.accrue_on_receipt_flag%TYPE;
4429: l_qty_billed PO_LINE_LOCATIONS.quantity_billed%TYPE;
4430: -- Bug 3541961
4431: l_consigned_flag PO_HEADERS.consigned_consumption_flag%TYPE;
4432: l_org_id PO_HEADERS.org_id%TYPE;
4433: l_trans_flow_header_id PO_LINE_LOCATIONS.transaction_flow_header_id%TYPE;
4434: l_logical_inv_org_id number;
4435:

Line 4432: l_org_id PO_HEADERS.org_id%TYPE;

4428: l_accrue_flag PO_LINE_LOCATIONS.accrue_on_receipt_flag%TYPE;
4429: l_qty_billed PO_LINE_LOCATIONS.quantity_billed%TYPE;
4430: -- Bug 3541961
4431: l_consigned_flag PO_HEADERS.consigned_consumption_flag%TYPE;
4432: l_org_id PO_HEADERS.org_id%TYPE;
4433: l_trans_flow_header_id PO_LINE_LOCATIONS.transaction_flow_header_id%TYPE;
4434: l_logical_inv_org_id number;
4435:
4436: l_module varchar2(100);

Line 4450: po_headers_all poh

4446: poh.org_id,
4447: pll.transaction_flow_header_id -- Bug 3880758
4448: from po_line_locations_all pll,
4449: -- Bug 3541961
4450: po_headers_all poh
4451: where pll.po_line_id = p_po_line_id
4452: -- Bug 3541961
4453: and pll.po_header_id = poh.po_header_id;
4454:

Line 4677: l_consigned_flag PO_HEADERS.consigned_consumption_flag%TYPE;

4673: RETURN VARCHAR2
4674: IS
4675:
4676: l_is_inv_org_period_open VARCHAR2(1) := 'Y';
4677: l_consigned_flag PO_HEADERS.consigned_consumption_flag%TYPE;
4678: l_trans_flow_header_id PO_LINE_LOCATIONS.transaction_flow_header_id%TYPE;
4679: l_ship_to_organization_id PO_LINE_LOCATIONS.ship_to_organization_id%TYPE;
4680: l_logical_inv_org_id MTL_TRANSACTION_FLOW_LINES.from_organization_id%TYPE;
4681: l_inv_org_id_period_check HR_ALL_ORGANIZATION_UNITS.organization_id%TYPE;

Line 4692: po_headers_all poh

4688: SELECT NVL(poh.consigned_consumption_flag, 'N'),
4689: pll.ship_to_organization_id,
4690: pll.transaction_flow_header_id
4691: FROM po_line_locations_all pll,
4692: po_headers_all poh
4693: WHERE pll.po_line_id = p_po_line_id
4694: AND pll.po_header_id = poh.po_header_id;
4695:
4696: CURSOR REL_SHIPMENTS_CSR IS