DBA Data[Home] [Help]

APPS.PO_DOCUMENT_UPDATE_PVT dependencies on STANDARD

Line 257: -- If FND_API.G_TRUE, the API will initialize the standard API message list.

253: --IN:
254: --p_api_version
255: -- API version number expected by the caller
256: --p_init_msg_list
257: -- If FND_API.G_TRUE, the API will initialize the standard API message list.
258: --p_changes
259: -- object with the changes to make to the document
260: --p_run_submission_checks
261: -- FND_API.G_TRUE: The API will perform field-level validations as well as

Line 280: -- based on the source of the update; pass in NULL for the standard logic.

276: -- the PO Approval workflow; if NULL, the API will use the buyer (AGENT_ID) on
277: -- the document.
278: --p_update_source
279: -- Used to select different program logic (i.e. validation, derivation)
280: -- based on the source of the update; pass in NULL for the standard logic.
281: -- Use the G_UPDATE_SOURCE_XXX constants (ex. G_UPDATE_SOURCE_OM).
282: --p_override_date
283: -- Date that will be used to unreserve the document; only used if the
284: -- document is encumbered.

Line 356: -- Standard API initialization:

352:
353: SAVEPOINT PO_DOCUMENT_UPDATE_PVT_SP;
354: x_return_status := FND_API.G_RET_STS_SUCCESS;
355:
356: -- Standard API initialization:
357: IF NOT FND_API.compatible_api_call (
358: p_current_version_number => l_api_version,
359: p_caller_version_number => p_api_version,
360: p_api_name => l_api_name,

Line 961: -- (standard PO, planned PO, blanket PA, scheduled release, blanket release)

957: -- document type/subtype, revision, etc.
958: init_document_globals;
959:
960: -- Check that the requested changes are for a supported document type.
961: -- (standard PO, planned PO, blanket PA, scheduled release, blanket release)
962: l_progress := '010';
963:
964: IF (g_document_type = 'PO'
965: AND g_document_subtype IN ('STANDARD','PLANNED')) OR

Line 965: AND g_document_subtype IN ('STANDARD','PLANNED')) OR

961: -- (standard PO, planned PO, blanket PA, scheduled release, blanket release)
962: l_progress := '010';
963:
964: IF (g_document_type = 'PO'
965: AND g_document_subtype IN ('STANDARD','PLANNED')) OR
966: (g_document_type = 'PA' AND g_document_subtype = 'BLANKET') OR
967: (g_document_type = 'RELEASE'
968: AND g_document_subtype IN ('SCHEDULED','BLANKET')) THEN
969: null;

Line 1750: -- SQL What: Returns the number of standard/planned shipments

1746: AND (NOT line_has_ship_qty_amt_change(p_chg, i)) THEN
1747: -- The line has a quantity/amount change, but none of its shipments
1748: -- have quantity/amount changes.
1749:
1750: -- SQL What: Returns the number of standard/planned shipments
1751: -- for this line that are not cancelled or finally closed.
1752: SELECT count(*)
1753: INTO l_shipment_count
1754: FROM po_line_locations

Line 1756: AND shipment_type in ('STANDARD', 'PLANNED')

1752: SELECT count(*)
1753: INTO l_shipment_count
1754: FROM po_line_locations
1755: WHERE po_line_id = p_chg.line_changes.po_line_id(i)
1756: AND shipment_type in ('STANDARD', 'PLANNED')
1757: AND nvl(cancel_flag,'N') <> 'Y'
1758: AND NVL(closed_code,'OPEN') <> 'FINALLY CLOSED';
1759:
1760: IF (l_shipment_count > 1) THEN -- The line has multiple shipments

Line 2296: -- Check: A standard/planned PO cannot have any shipment price changes.

2292: p_entity_type => G_ENTITY_TYPE_LINES );
2293: END IF;
2294:
2295: ----------------------------------------------------------------------------
2296: -- Check: A standard/planned PO cannot have any shipment price changes.
2297: ----------------------------------------------------------------------------
2298: IF (g_document_type = 'PO') THEN
2299: IF (g_is_complex_work_po=FALSE) THEN -- 2300: FOR i IN 1..p_chg.shipment_changes.get_count LOOP

Line 2313: END IF; -- standard/planned PO

2309: p_entity_id => G_ENTITY_TYPE_LINES );
2310: END IF;
2311: END LOOP; -- shipment changes
2312: END IF; --complex PO changes
2313: END IF; -- standard/planned PO
2314:
2315: ----------------------------------------------------------------------------
2316: -- Checks for Services Procurement fields and line types:
2317: ----------------------------------------------------------------------------

Line 2388: -- lines with a purchase basis of Temp Labor on standard POs.

2384: END IF; -- value basis
2385:
2386: --------------------------------------------------------------------------
2387: -- Services Check: Only allow start date and end date changes for
2388: -- lines with a purchase basis of Temp Labor on standard POs.
2389: --------------------------------------------------------------------------
2390: l_progress := '070';
2391: IF NOT ((g_document_type = 'PO') AND (g_document_subtype = 'STANDARD')
2392: AND (p_chg.line_changes.c_purchase_basis(i) = 'TEMP LABOR')) THEN

Line 2391: IF NOT ((g_document_type = 'PO') AND (g_document_subtype = 'STANDARD')

2387: -- Services Check: Only allow start date and end date changes for
2388: -- lines with a purchase basis of Temp Labor on standard POs.
2389: --------------------------------------------------------------------------
2390: l_progress := '070';
2391: IF NOT ((g_document_type = 'PO') AND (g_document_subtype = 'STANDARD')
2392: AND (p_chg.line_changes.c_purchase_basis(i) = 'TEMP LABOR')) THEN
2393: -- This is not a Temp Labor line on a standard PO.
2394:
2395: IF (p_chg.line_changes.start_date(i) IS NOT NULL) THEN

Line 2393: -- This is not a Temp Labor line on a standard PO.

2389: --------------------------------------------------------------------------
2390: l_progress := '070';
2391: IF NOT ((g_document_type = 'PO') AND (g_document_subtype = 'STANDARD')
2392: AND (p_chg.line_changes.c_purchase_basis(i) = 'TEMP LABOR')) THEN
2393: -- This is not a Temp Labor line on a standard PO.
2394:
2395: IF (p_chg.line_changes.start_date(i) IS NOT NULL) THEN
2396: add_error ( p_api_errors => g_api_errors,
2397: x_return_status => x_return_status,

Line 2986: -- SQL Why: To retrieve the lines on a standard/planned PO that may

2982: l_progress VARCHAR2(3) := '000';
2983:
2984: -- SQL What: Retrieves all the lines of the given PO that refer to
2985: -- a global agrement or quotation.
2986: -- SQL Why: To retrieve the lines on a standard/planned PO that may
2987: -- need to be re-priced from the price breaks.
2988: CURSOR po_line_ref_csr (p_po_header_id PO_HEADERS.po_header_id%TYPE) IS
2989: SELECT po_line_id, manual_price_change_flag
2990: FROM po_lines POL

Line 2996: -- SQL What: Retrieves all the standard/planned shipments of the

2992: AND (POL.from_header_id IS NOT NULL OR
2993: --
2994: POL.contract_id IS NOT NULL);
2995:
2996: -- SQL What: Retrieves all the standard/planned shipments of the
2997: -- given PO line that are not cancelled or finally closed.
2998: -- SQL Why: To roll down a line price change on a standard/planned PO
2999: -- to the shipments of that line.
3000: CURSOR po_shipment_csr (p_po_line_id PO_LINES.po_line_id%TYPE) IS

Line 2998: -- SQL Why: To roll down a line price change on a standard/planned PO

2994: POL.contract_id IS NOT NULL);
2995:
2996: -- SQL What: Retrieves all the standard/planned shipments of the
2997: -- given PO line that are not cancelled or finally closed.
2998: -- SQL Why: To roll down a line price change on a standard/planned PO
2999: -- to the shipments of that line.
3000: CURSOR po_shipment_csr (p_po_line_id PO_LINES.po_line_id%TYPE) IS
3001: SELECT line_location_id
3002: FROM po_line_locations

Line 3006: AND shipment_type IN ('PLANNED','STANDARD');

3002: FROM po_line_locations
3003: WHERE po_line_id = p_po_line_id
3004: AND (NVL(cancel_flag,'N') <> 'Y')
3005: AND (NVL(closed_code,'OPEN') <> 'FINALLY CLOSED')
3006: AND shipment_type IN ('PLANNED','STANDARD');
3007:
3008: l_po_line_id PO_LINES.po_line_id%TYPE;
3009: l_line_location_id PO_LINE_LOCATIONS.line_location_id%TYPE;
3010: l_new_price PO_LINE_LOCATIONS.price_override%TYPE;

Line 3190: -- Derivation #3: For a Standard PO sourced to a quotation, GA, or contract,

3186: END IF; -- document type is release
3187:
3188: l_progress := '030';
3189:
3190: -- Derivation #3: For a Standard PO sourced to a quotation, GA, or contract,
3191: -- if no new line price is specified, and there are quantity changes
3192: -- on a line, or need-by date or ship-to location changes on the first
3193: -- shipment of a line, get a new price from the price break.
3194:

Line 3195: IF (g_document_type = 'PO') AND (g_document_subtype = 'STANDARD') THEN

3191: -- if no new line price is specified, and there are quantity changes
3192: -- on a line, or need-by date or ship-to location changes on the first
3193: -- shipment of a line, get a new price from the price break.
3194:
3195: IF (g_document_type = 'PO') AND (g_document_subtype = 'STANDARD') THEN
3196:
3197: -- Loop through the lines that reference a quotation, GA, or contract.
3198: OPEN po_line_ref_csr ( g_po_header_id );
3199: LOOP

Line 3335: END IF; -- document type is standard PO or planned PO

3331: END IF; -- l_new_price
3332:
3333: END LOOP; -- PO lines with a GA or quotation reference
3334: CLOSE po_line_ref_csr;
3335: END IF; -- document type is standard PO or planned PO
3336:
3337: l_progress := '040';
3338:
3339: -- Derivation #4: For a standard or planned PO, roll down any line

Line 3339: -- Derivation #4: For a standard or planned PO, roll down any line

3335: END IF; -- document type is standard PO or planned PO
3336:
3337: l_progress := '040';
3338:
3339: -- Derivation #4: For a standard or planned PO, roll down any line
3340: -- price changes to all shipments that are not finally closed or cancelled.
3341:
3342: IF (g_document_type = 'PO') and (g_is_complex_work_po=FALSE ) THEN
3343: FOR i IN 1..p_chg.line_changes.get_count LOOP

Line 3394: END IF; -- document type is standard PO or planned PO

3390: END LOOP; -- split shipment changes
3391:
3392: END IF; -- new price is not null
3393: END LOOP; -- line changes
3394: END IF; -- document type is standard PO or planned PO
3395:
3396:
3397: -- BEGIN INVCONV sschinch 09/07/04
3398: /** l_progress := '050';

Line 4261: AND shipment_type IN ('STANDARD','PLANNED');

4257: INTO l_line_location_id
4258: FROM po_line_locations
4259: WHERE po_line_id = p_po_line_id
4260: AND shipment_num = l_min_shipment_num
4261: AND shipment_type IN ('STANDARD','PLANNED');
4262:
4263: RETURN l_line_location_id;
4264: EXCEPTION
4265: WHEN FND_API.g_exc_unexpected_error THEN

Line 4429: -- For a standard or planned PO, roll up any shipment quantity/amount

4425: END LOOP; -- distribution changes
4426:
4427: l_progress := '050';
4428:
4429: -- For a standard or planned PO, roll up any shipment quantity/amount
4430: -- changes to the line quantity/amount, if needed.
4431: IF g_document_type = 'PO' THEN
4432:
4433: -- Rollup each shipment quantity/amount change (including split shipments)

Line 4593: END IF; -- document type is standard PO or planned PO

4589:
4590: END IF; -- ship_has_qty_amt_change
4591: END LOOP; -- shipment changes
4592:
4593: END IF; -- document type is standard PO or planned PO
4594:
4595: EXCEPTION
4596: WHEN FND_API.g_exc_unexpected_error THEN
4597: PO_DEBUG.handle_unexp_error ( p_pkg_name => g_pkg_name,

Line 4719: AND shipment_type in ('STANDARD', 'PLANNED')

4715: SELECT line_location_id
4716: INTO l_line_location_id
4717: FROM po_line_locations
4718: WHERE po_line_id = p_chg.line_changes.po_line_id(i)
4719: AND shipment_type in ('STANDARD', 'PLANNED')
4720: AND NVL(cancel_flag,'N') <> 'Y'
4721: AND NVL(closed_code,'OPEN') <> 'FINALLY CLOSED';
4722:
4723: l_ship_chg_i := find_ship_change(p_chg, l_line_location_id);

Line 5271: AND shipment_type IN ('STANDARD', 'PLANNED');

5267: INTO l_qty_received,
5268: l_qty_billed
5269: FROM po_line_locations
5270: WHERE po_line_id = l_po_line_id
5271: AND shipment_type IN ('STANDARD', 'PLANNED');
5272:
5273: IF (l_new_qty < greatest(l_qty_received, l_qty_billed)) THEN
5274: add_error ( p_api_errors => g_api_errors,
5275: x_return_status => x_return_status,

Line 5291: AND shipment_type IN ('STANDARD', 'PLANNED','PREPAYMENT');

5287: INTO l_qty_received,
5288: l_qty_billed
5289: FROM po_line_locations
5290: WHERE po_line_id = l_po_line_id
5291: AND shipment_type IN ('STANDARD', 'PLANNED','PREPAYMENT');
5292:
5293: IF (l_new_qty < greatest(l_qty_received, l_qty_billed)) THEN
5294: add_error ( p_api_errors => g_api_errors,
5295: x_return_status => x_return_status,

Line 5310: -- Check: If there is a Standard PO price change, call an API to

5306: END IF; -- l_new_qty
5307:
5308: -- Bug 3312906 START
5309: --------------------------------------------------------------------------
5310: -- Check: If there is a Standard PO price change, call an API to
5311: -- determine whether price updates are allowed for this line.
5312: --------------------------------------------------------------------------
5313: l_progress := '040';
5314: IF (g_document_type = 'PO') AND (g_document_subtype='STANDARD')

Line 5314: IF (g_document_type = 'PO') AND (g_document_subtype='STANDARD')

5310: -- Check: If there is a Standard PO price change, call an API to
5311: -- determine whether price updates are allowed for this line.
5312: --------------------------------------------------------------------------
5313: l_progress := '040';
5314: IF (g_document_type = 'PO') AND (g_document_subtype='STANDARD')
5315: AND (l_new_price <> l_current_price) THEN
5316:
5317: l_last_msg_list_index := FND_MSG_PUB.count_msg;
5318:

Line 5351: END IF; -- document type is standard PO

5347: g_retroactive_price_change := G_PARAMETER_YES;
5348: PO_LINES_SV2.retroactive_change(l_po_line_id);
5349: END IF;
5350:
5351: END IF; -- document type is standard PO
5352: -- Bug 3312906 END
5353:
5354: --------------------------------------------------------------------------
5355: -- Check: (Services) Validate that the start date is not later than

Line 5413: AND shipment_type = 'STANDARD';

5409: INTO l_amt_received,
5410: l_amt_billed
5411: FROM po_line_locations
5412: WHERE po_line_id = l_po_line_id
5413: AND shipment_type = 'STANDARD';
5414:
5415: IF (l_new_amount < greatest(l_amt_received, l_amt_billed)) THEN
5416: add_error ( p_api_errors => g_api_errors,
5417: x_return_status => x_return_status,

Line 5432: -- on standard POs.

5428: --
5429: l_progress := '200';
5430: --------------------------------------------------------------------------
5431: -- (Services) Perform OTL-related checks for Rate-Based Temp Labor lines
5432: -- on standard POs.
5433: --------------------------------------------------------------------------
5434: IF (g_document_type = 'PO') AND (g_document_subtype = 'STANDARD')
5435: AND (p_chg.line_changes.c_value_basis(i) = 'RATE')
5436: AND (p_chg.line_changes.c_purchase_basis(i) = 'TEMP LABOR') THEN

Line 5434: IF (g_document_type = 'PO') AND (g_document_subtype = 'STANDARD')

5430: --------------------------------------------------------------------------
5431: -- (Services) Perform OTL-related checks for Rate-Based Temp Labor lines
5432: -- on standard POs.
5433: --------------------------------------------------------------------------
5434: IF (g_document_type = 'PO') AND (g_document_subtype = 'STANDARD')
5435: AND (p_chg.line_changes.c_value_basis(i) = 'RATE')
5436: AND (p_chg.line_changes.c_purchase_basis(i) = 'TEMP LABOR') THEN
5437:
5438: l_progress := '210';

Line 6848: -- (Services) For standard PO, re-default the price differentials if needed.

6844: NVL(tax_attribute_update_code,NVL2(g_calculate_tax_flag, 'UPDATE', null)) --
6845: WHERE p_chg.distribution_changes.po_distribution_id(i) IS NOT NULL
6846: AND po_distribution_id = p_chg.distribution_changes.po_distribution_id(i);
6847:
6848: -- (Services) For standard PO, re-default the price differentials if needed.
6849: IF (g_document_type = 'PO') AND (g_document_subtype = 'STANDARD') THEN
6850:
6851: FOR i IN 1..p_chg.line_changes.get_count LOOP
6852: l_new_from_line_loc_id := p_chg.line_changes.t_from_line_location_id(i);

Line 6849: IF (g_document_type = 'PO') AND (g_document_subtype = 'STANDARD') THEN

6845: WHERE p_chg.distribution_changes.po_distribution_id(i) IS NOT NULL
6846: AND po_distribution_id = p_chg.distribution_changes.po_distribution_id(i);
6847:
6848: -- (Services) For standard PO, re-default the price differentials if needed.
6849: IF (g_document_type = 'PO') AND (g_document_subtype = 'STANDARD') THEN
6850:
6851: FOR i IN 1..p_chg.line_changes.get_count LOOP
6852: l_new_from_line_loc_id := p_chg.line_changes.t_from_line_location_id(i);
6853:

Line 6872: -- Delete price differentials from Standard PO.

6868: l_ga_entity_type := 'BLANKET LINE';
6869: l_ga_entity_id := p_chg.line_changes.c_from_line_id(i);
6870: END IF;
6871:
6872: -- Delete price differentials from Standard PO.
6873: PO_PRICE_DIFFERENTIALS_PVT.delete_price_differentials (
6874: p_entity_type => l_po_entity_type,
6875: p_entity_id => l_po_entity_id
6876: );

Line 6878: -- Copy price differentials from GA to Standard PO.

6874: p_entity_type => l_po_entity_type,
6875: p_entity_id => l_po_entity_id
6876: );
6877:
6878: -- Copy price differentials from GA to Standard PO.
6879: PO_PRICE_DIFFERENTIALS_PVT.default_price_differentials (
6880: p_from_entity_type => l_ga_entity_type,
6881: p_from_entity_id => l_ga_entity_id,
6882: p_to_entity_type => l_po_entity_type,

Line 6977: -- For a new revision of a standard PO or a PA, if signature was required

6973: l_progress := '080';
6974: IF (g_document_type IN ('PO', 'PA')) THEN
6975:
6976: --
6977: -- For a new revision of a standard PO or a PA, if signature was required
6978: -- on any of the previous revisions, then Acceptance Required should be
6979: -- set to Document and Signature ('S').
6980:
6981: IF ((g_document_type = 'PO' AND g_document_subtype = 'STANDARD')

Line 6981: IF ((g_document_type = 'PO' AND g_document_subtype = 'STANDARD')

6977: -- For a new revision of a standard PO or a PA, if signature was required
6978: -- on any of the previous revisions, then Acceptance Required should be
6979: -- set to Document and Signature ('S').
6980:
6981: IF ((g_document_type = 'PO' AND g_document_subtype = 'STANDARD')
6982: OR (g_document_type = 'PA'))
6983: AND (l_new_revision_num <> g_revision_num) -- revision has changed
6984: AND PO_SIGNATURE_PVT.was_signature_required(g_po_header_id) THEN
6985:

Line 8037: -- on the releases of the blanket or standard POs of the GA with the

8033: -- mode, where we start the workflow in the background and return
8034: -- immediately, without issuing any commits.
8035: --p_mass_update_releases
8036: -- Blankets / GAs only: If 'Y', we will update the price
8037: -- on the releases of the blanket or standard POs of the GA with the
8038: -- retroactive price change on the blanket/GA line.
8039: --p_retroactive_price_change
8040: -- This parameter is used for performance reasons only.
8041: -- Releases / Standard POs only: If 'Y', indicates that

Line 8041: -- Releases / Standard POs only: If 'Y', indicates that

8037: -- on the releases of the blanket or standard POs of the GA with the
8038: -- retroactive price change on the blanket/GA line.
8039: --p_retroactive_price_change
8040: -- This parameter is used for performance reasons only.
8041: -- Releases / Standard POs only: If 'Y', indicates that
8042: -- this release/PO has been updated with a retroactive price change.
8043: -- If NULL or 'N', start_wf_process will query the database to figure out
8044: -- if there was a retroactive price change.
8045: --Notes:

Line 8092: -- Standard API initialization:

8088: END IF;
8089:
8090: x_return_status := FND_API.G_RET_STS_SUCCESS;
8091:
8092: -- Standard API initialization:
8093: IF NOT FND_API.compatible_api_call (
8094: p_current_version_number => l_api_version,
8095: p_caller_version_number => p_api_version,
8096: p_api_name => l_proc_name,

Line 8763: -- Adds the messages on the standard API message list (starting from

8759: -------------------------------------------------------------------------------
8760: --Start of Comments
8761: --Name: add_message_list_errors
8762: --Function:
8763: -- Adds the messages on the standard API message list (starting from
8764: -- p_start_index) to p_api_errors. Deletes the messages from the API message
8765: -- list once they have been transferred.
8766: --Pre-reqs:
8767: -- p_api_errors should be initialized.

Line 9049: -- Standard API specification parameter

9045: -- po entity LINE/SHIPMENT/DISTRIBUTION is to be deleted
9046: --Parameters:
9047: --IN:
9048: --p_init_msg_list
9049: -- Standard API specification parameter
9050: -- Pass FND_API.G_FALSE if message list has already been initialized for
9051: -- transaction else pass FND_API.G_TRUE
9052: --p_calling_program
9053: -- Calling module.

Line 9074: -- Standard API specification parameter

9070: --p_doc_type
9071: -- Document type of the PO [PO/PA]
9072: --OUT:
9073: --x_return_status
9074: -- Standard API specification parameter
9075: -- Can hold one of the following values:
9076: -- FND_API.G_RET_STS_SUCCESS (='S')
9077: -- FND_API.G_RET_STS_ERROR (='E')
9078: -- FND_API.G_RET_STS_UNEXP_ERROR (='U')

Line 9115: -- Standard start of API savepoint

9111: PO_LOG.proc_begin(d_module, 'p_doc_type', p_doc_type); PO_LOG.proc_begin(d_module, 'p_doc_subtype', p_doc_subtype); PO_LOG.proc_begin(d_module, 'p_doc_header_id', p_doc_header_id);
9112: PO_LOG.proc_begin(d_module, 'p_ga_flag', p_ga_flag); PO_LOG.proc_begin(d_module, 'p_conterms_exist_flag', p_conterms_exist_flag); PO_LOG.proc_begin(d_module, 'p_po_line_id', p_po_line_id);
9113: PO_LOG.proc_begin(d_module, 'p_line_loc_id', p_line_loc_id); PO_LOG.proc_begin(d_module, 'p_distribution_id', p_distribution_id);
9114: END IF;
9115: -- Standard start of API savepoint
9116: SAVEPOINT PO_PROCESS_DELETE_ACTION;
9117:
9118: --Initialize message list if necessary (p_init_msg_list is set to TRUE)
9119: IF FND_API.to_Boolean(p_init_msg_list)