334: IF (PO_LOG.d_proc) THEN
335: PO_LOG.proc_begin (d_module);
336: END IF;
337:
338: l_acceptance_required := FND_API.G_TRUE;
339:
340: l_org_id :=
341: PO_WF_UTIL_PKG.GetItemAttrNumber
342: ( itemtype => itemType,
377: );
378:
379:
380: IF (l_acceptance_level = 'NOT_REQUIRED') THEN
381: l_acceptance_required := FND_API.G_FALSE;
382:
383: ELSE
384:
385: -- bug5570989
402:
403: -- Clean up process...
404: -- IF there are still lines that require acceptance, make sure that
405: -- the changes they are making are supported by Diff Summary
406: IF (l_acceptance_required = FND_API.G_TRUE) THEN
407:
408: l_acceptance_required :=
409: autoaccept_unchanged_records
410: ( p_draft_id => l_draft_id
458: itemkey => itemkey,
459: aname => 'BUYER_ACCEPTANCE_REQUIRED'
460: );
461:
462: IF (l_accept_required = FND_API.G_TRUE) THEN
463: resultout := WF_ENGINE.eng_completed || ':Y';
464: ELSE
465: resultout := WF_ENGINE.eng_completed || ':N';
466: END IF;
501: itemkey => itemkey,
502: aname => 'TRANSFER_IF_AUTOACCEPT_ALL'
503: );
504:
505: IF (l_transfer_flag = FND_API.G_TRUE) THEN
506: resultout := WF_ENGINE.eng_completed || ':Y';
507: ELSE
508: resultout := WF_ENGINE.eng_completed || ':N';
509: END IF;
845: p_change_accepted_value => 'N',
846: x_return_status => l_return_status
847: );
848:
849: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
850: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
851: END IF;
852:
853:
846: x_return_status => l_return_status
847: );
848:
849: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
850: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
851: END IF;
852:
853:
854: IF (PO_LOG.d_proc) THEN
990: d_position := 10;
991:
992: PO_DRAFTS_PVT.transfer_draft_to_txn
993: ( p_api_version => 1.0,
994: p_init_msg_list => FND_API.G_TRUE,
995: p_draft_id => l_draft_id,
996: p_po_header_id => l_po_header_id,
997: p_delete_processed_draft => FND_API.G_FALSE,
998: p_acceptance_action => l_acceptance_action,
993: ( p_api_version => 1.0,
994: p_init_msg_list => FND_API.G_TRUE,
995: p_draft_id => l_draft_id,
996: p_po_header_id => l_po_header_id,
997: p_delete_processed_draft => FND_API.G_FALSE,
998: p_acceptance_action => l_acceptance_action,
999: x_return_status => l_return_status
1000: );
1001:
998: p_acceptance_action => l_acceptance_action,
999: x_return_status => l_return_status
1000: );
1001:
1002: IF (l_return_status <> FND_API.g_RET_STS_SUCCESS) THEN
1003:
1004: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1005: END IF;
1006:
1000: );
1001:
1002: IF (l_return_status <> FND_API.g_RET_STS_SUCCESS) THEN
1003:
1004: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1005: END IF;
1006:
1007: IF (PO_LOG.d_proc) THEN
1008: PO_LOG.proc_end (d_module);
1300: PO_LOG.proc_begin (d_module, 'p_draft_id', p_draft_id);
1301: PO_LOG.proc_begin (d_module, 'p_reject_line_id_list.COUNT', p_reject_line_id_list.COUNT);
1302: END IF;
1303:
1304: x_return_status := FND_API.g_RET_STS_SUCCESS;
1305:
1306: d_position := 10;
1307:
1308: -- bug5187544 START
1318: IF (PO_LOG.d_stmt) THEN
1319: PO_LOG.stmt (d_module, d_position, 'l_return_status', l_return_status);
1320: END IF;
1321:
1322: IF (l_return_status = FND_API.G_RET_STS_ERROR) THEN
1323: x_return_status := l_return_status;
1324: RETURN;
1325:
1326: ELSIF (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1322: IF (l_return_status = FND_API.G_RET_STS_ERROR) THEN
1323: x_return_status := l_return_status;
1324: RETURN;
1325:
1326: ELSIF (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1327: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1328: END IF;
1329:
1330: -- bug5187544 END
1323: x_return_status := l_return_status;
1324: RETURN;
1325:
1326: ELSIF (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1327: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1328: END IF;
1329:
1330: -- bug5187544 END
1331:
1339: p_change_accepted_value => 'N',
1340: x_return_status => l_return_status
1341: );
1342:
1343: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1344: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1345: END IF;
1346:
1347: IF (PO_LOG.d_proc) THEN
1340: x_return_status => l_return_status
1341: );
1342:
1343: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1344: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1345: END IF;
1346:
1347: IF (PO_LOG.d_proc) THEN
1348: PO_LOG.proc_end (d_module);
1353: PO_MESSAGE_S.add_exc_msg
1354: ( p_pkg_name => d_pkg_name,
1355: p_procedure_name => d_api_name || '.' || d_position
1356: );
1357: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1358: END record_disposition;
1359:
1360: -----------------------------------------------------------------------
1361: --Start of Comments
1399:
1400: BEGIN
1401: d_position := 0;
1402:
1403: x_return_status := FND_API.G_RET_STS_SUCCESS;
1404:
1405: IF (PO_LOG.d_proc) THEN
1406: PO_LOG.proc_begin (d_module, 'p_draft_id', p_draft_id);
1407: END IF;
1461: ( p_pkg_name => d_pkg_name,
1462: p_procedure_name => d_api_name || '.' || d_position
1463: );
1464:
1465: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1466: END complete_resp_to_changes;
1467:
1468:
1469: -----------------------------------------------------------------------
1480: -- draft unique identifier
1481: --IN OUT:
1482: --OUT:
1483: --Returns:
1484: -- FND_API.G_TRUE if manual acceptance is required
1485: -- FND_API.G_FALSE otherwise
1486: --Notes:
1487: --Testing:
1488: --End of Comments
1481: --IN OUT:
1482: --OUT:
1483: --Returns:
1484: -- FND_API.G_TRUE if manual acceptance is required
1485: -- FND_API.G_FALSE otherwise
1486: --Notes:
1487: --Testing:
1488: --End of Comments
1489: ------------------------------------------------------------------------
1497: d_position NUMBER;
1498:
1499: l_index NUMBER;
1500:
1501: l_manual_accept_required VARCHAR2(1) := FND_API.G_FALSE;
1502: l_need_to_check_tolerance VARCHAR2(1) := FND_API.G_FALSE;
1503: l_has_autoaccepted_line VARCHAR2(1) := FND_API.G_FALSE;
1504: l_over_tolerance VARCHAR2(1);
1505:
1498:
1499: l_index NUMBER;
1500:
1501: l_manual_accept_required VARCHAR2(1) := FND_API.G_FALSE;
1502: l_need_to_check_tolerance VARCHAR2(1) := FND_API.G_FALSE;
1503: l_has_autoaccepted_line VARCHAR2(1) := FND_API.G_FALSE;
1504: l_over_tolerance VARCHAR2(1);
1505:
1506: l_check_tolerance_index_tbl DBMS_SQL.NUMBER_TABLE;
1499: l_index NUMBER;
1500:
1501: l_manual_accept_required VARCHAR2(1) := FND_API.G_FALSE;
1502: l_need_to_check_tolerance VARCHAR2(1) := FND_API.G_FALSE;
1503: l_has_autoaccepted_line VARCHAR2(1) := FND_API.G_FALSE;
1504: l_over_tolerance VARCHAR2(1);
1505:
1506: l_check_tolerance_index_tbl DBMS_SQL.NUMBER_TABLE;
1507:
1564: -- Otherwise, we need to check price tolerance to see if manual acceptance
1565: -- is necessary
1566: FOR i IN 1..l_po_line_id_tbl.COUNT LOOP
1567: IF (l_new_line_flag_tbl(i) = 'Y') THEN
1568: l_manual_accept_required := FND_API.G_TRUE;
1569: ELSE
1570: -- add to the table that indicates what rows we need to check
1571: -- for tolerance
1572: l_check_tolerance_index_tbl(i) := i;
1569: ELSE
1570: -- add to the table that indicates what rows we need to check
1571: -- for tolerance
1572: l_check_tolerance_index_tbl(i) := i;
1573: l_need_to_check_tolerance := FND_API.G_TRUE;
1574: END IF;
1575: END LOOP;
1576:
1577: d_position := 20;
1575: END LOOP;
1576:
1577: d_position := 20;
1578:
1579: IF (l_need_to_check_tolerance = FND_API.G_TRUE) THEN
1580:
1581: PO_PDOI_PRICE_TOLERANCE_PVT.get_price_tolerance
1582: ( p_index_tbl => l_check_tolerance_index_tbl,
1583: p_po_header_id_tbl => l_po_header_id_tbl,
1601: p_old_price => l_old_price_tbl(l_index),
1602: p_new_price => l_new_price_tbl(l_index)
1603: );
1604:
1605: IF (l_over_tolerance = FND_API.G_FALSE) THEN
1606: -- need to autoaccept this line
1607: l_autoaccept_tbl.EXTEND;
1608: l_autoaccept_tbl(l_autoaccept_tbl.COUNT) := l_po_line_id_tbl(l_index);
1609:
1606: -- need to autoaccept this line
1607: l_autoaccept_tbl.EXTEND;
1608: l_autoaccept_tbl(l_autoaccept_tbl.COUNT) := l_po_line_id_tbl(l_index);
1609:
1610: l_has_autoaccepted_line := FND_API.G_TRUE;
1611: ELSE
1612: -- require manual acceptance, if there is a line that goes over
1613: -- price tolerance limit
1614: l_manual_accept_required := FND_API.G_TRUE;
1610: l_has_autoaccepted_line := FND_API.G_TRUE;
1611: ELSE
1612: -- require manual acceptance, if there is a line that goes over
1613: -- price tolerance limit
1614: l_manual_accept_required := FND_API.G_TRUE;
1615: END IF;
1616:
1617: l_index := l_check_tolerance_index_tbl.NEXT(l_index);
1618: END LOOP;
1619:
1620: d_position := 50;
1621:
1622: -- For the lines that do not exceed price tolerance, autoaccept them.
1623: IF (l_has_autoaccepted_line = FND_API.G_TRUE) THEN
1624: -- bug5035979
1625: -- cascade acceptance value to lower level as well.
1626: cascade_change_acceptance
1627: ( p_draft_id => p_draft_id,
1629: p_change_accepted_value => 'Y',
1630: x_return_status => l_return_status
1631: );
1632:
1633: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1634: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1635: END IF;
1636: END IF;
1637:
1630: x_return_status => l_return_status
1631: );
1632:
1633: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1634: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1635: END IF;
1636: END IF;
1637:
1638: END IF;
1730: d_api_name CONSTANT VARCHAR2(30) := 'autoaccept_deleted_records';
1731: d_module CONSTANT VARCHAR2(255) := PO_LOG.get_subprogram_base(d_pkg_name, d_api_name);
1732: d_position NUMBER;
1733:
1734: l_has_record_to_accept VARCHAR2(1) := FND_API.G_TRUE;
1735:
1736: BEGIN
1737:
1738: d_position := 0;
1834: -- draft unique identifier
1835: --IN OUT:
1836: --OUT:
1837: --Returns:
1838: -- FND_API.G_TRUE if there's still record in the draft to accept
1839: -- FND_API.G_FALSE otherwise
1840: --Notes:
1841: --Testing:
1842: --End of Comments
1835: --IN OUT:
1836: --OUT:
1837: --Returns:
1838: -- FND_API.G_TRUE if there's still record in the draft to accept
1839: -- FND_API.G_FALSE otherwise
1840: --Notes:
1841: --Testing:
1842: --End of Comments
1843: ------------------------------------------------------------------------
1849: d_api_name CONSTANT VARCHAR2(30) := 'autoaccept_unchanged_records';
1850: d_module CONSTANT VARCHAR2(255) := PO_LOG.get_subprogram_base(d_pkg_name, d_api_name);
1851: d_position NUMBER;
1852:
1853: l_has_record_to_accept VARCHAR2(1) := FND_API.G_TRUE;
1854:
1855: BEGIN
1856:
1857: d_position := 0;
2986: -- draft unique identifier
2987: --IN OUT:
2988: --OUT:
2989: --Return:
2990: -- FND_API.G_TRUE if there's still record in the draft to accept
2991: -- FND_API.G_FALSE otherwise
2992: --Notes:
2993: --Testing:
2994: --End of Comments
2987: --IN OUT:
2988: --OUT:
2989: --Return:
2990: -- FND_API.G_TRUE if there's still record in the draft to accept
2991: -- FND_API.G_FALSE otherwise
2992: --Notes:
2993: --Testing:
2994: --End of Comments
2995: ------------------------------------------------------------------------
3001: d_api_name CONSTANT VARCHAR2(30) := 'has_record_to_accept';
3002: d_module CONSTANT VARCHAR2(255) := PO_LOG.get_subprogram_base(d_pkg_name, d_api_name);
3003: d_position NUMBER;
3004:
3005: l_has_record_to_accept VARCHAR2(1) := FND_API.G_TRUE;
3006:
3007: BEGIN
3008:
3009: d_position := 0;
3011: IF (PO_LOG.d_proc) THEN
3012: PO_LOG.proc_begin (d_module);
3013: END IF;
3014:
3015: SELECT NVL(MAX(FND_API.G_TRUE), FND_API.G_FALSE)
3016: INTO l_has_record_to_accept
3017: FROM DUAL
3018: WHERE EXISTS
3019: ( SELECT 1
3221: PO_LOG.proc_begin (d_module, 'p_draft_id', p_draft_id);
3222: PO_LOG.proc_begin (d_module, 'p_line_id_list.COUNT', p_line_id_list.COUNT);
3223: END IF;
3224:
3225: x_return_status := FND_API.g_RET_STS_SUCCESS;
3226:
3227: -- Update records in PO_LINES_DRAFT_ALL based on the list of lines to change
3228: -- in p_line_id_list;
3229: FORALL i IN 1..p_line_id_list.COUNT
3298: PO_MESSAGE_S.add_exc_msg
3299: ( p_pkg_name => d_pkg_name,
3300: p_procedure_name => d_api_name || '.' || d_position
3301: );
3302: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3303: END cascade_change_acceptance;
3304:
3305: -- bug5035979 END
3306:
3345: BEGIN
3346:
3347: d_position := 0;
3348:
3349: x_return_status := FND_API.G_RET_STS_SUCCESS;
3350:
3351: IF (PO_LOG.d_proc) THEN
3352: PO_LOG.proc_begin (d_module, 'p_draft_id', p_draft_id);
3353: END IF;
3411: DELETE FROM po_session_gt
3412: WHERE key = l_key;
3413:
3414: IF (x_invalid_line_id_list.COUNT > 0) THEN
3415: x_return_status := FND_API.G_RET_STS_ERROR;
3416: END IF;
3417:
3418: IF (PO_LOG.d_proc) THEN
3419: PO_LOG.proc_end (d_module);
3424: PO_MESSAGE_S.add_exc_msg
3425: ( p_pkg_name => d_pkg_name,
3426: p_procedure_name => d_api_name || '.' || d_position
3427: );
3428: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3429: END validate_disposition;
3430:
3431: -- bug5187544 END
3432: