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);
1281: PO_LOG.proc_begin (d_module, 'p_draft_id', p_draft_id);
1282: PO_LOG.proc_begin (d_module, 'p_reject_line_id_list.COUNT', p_reject_line_id_list.COUNT);
1283: END IF;
1284:
1285: x_return_status := FND_API.g_RET_STS_SUCCESS;
1286:
1287: d_position := 10;
1288:
1289: -- bug5187544 START
1299: IF (PO_LOG.d_stmt) THEN
1300: PO_LOG.stmt (d_module, d_position, 'l_return_status', l_return_status);
1301: END IF;
1302:
1303: IF (l_return_status = FND_API.G_RET_STS_ERROR) THEN
1304: x_return_status := l_return_status;
1305: RETURN;
1306:
1307: ELSIF (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1303: IF (l_return_status = FND_API.G_RET_STS_ERROR) THEN
1304: x_return_status := l_return_status;
1305: RETURN;
1306:
1307: ELSIF (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1308: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1309: END IF;
1310:
1311: -- bug5187544 END
1304: x_return_status := l_return_status;
1305: RETURN;
1306:
1307: ELSIF (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1308: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1309: END IF;
1310:
1311: -- bug5187544 END
1312:
1320: p_change_accepted_value => 'N',
1321: x_return_status => l_return_status
1322: );
1323:
1324: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1325: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1326: END IF;
1327:
1328: IF (PO_LOG.d_proc) THEN
1321: x_return_status => l_return_status
1322: );
1323:
1324: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1325: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1326: END IF;
1327:
1328: IF (PO_LOG.d_proc) THEN
1329: PO_LOG.proc_end (d_module);
1334: PO_MESSAGE_S.add_exc_msg
1335: ( p_pkg_name => d_pkg_name,
1336: p_procedure_name => d_api_name || '.' || d_position
1337: );
1338: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1339: END record_disposition;
1340:
1341: -----------------------------------------------------------------------
1342: --Start of Comments
1379:
1380: BEGIN
1381: d_position := 0;
1382:
1383: x_return_status := FND_API.G_RET_STS_SUCCESS;
1384:
1385: IF (PO_LOG.d_proc) THEN
1386: PO_LOG.proc_begin (d_module, 'p_draft_id', p_draft_id);
1387: END IF;
1435: ( p_pkg_name => d_pkg_name,
1436: p_procedure_name => d_api_name || '.' || d_position
1437: );
1438:
1439: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1440: END complete_resp_to_changes;
1441:
1442:
1443: -----------------------------------------------------------------------
1454: -- draft unique identifier
1455: --IN OUT:
1456: --OUT:
1457: --Returns:
1458: -- FND_API.G_TRUE if manual acceptance is required
1459: -- FND_API.G_FALSE otherwise
1460: --Notes:
1461: --Testing:
1462: --End of Comments
1455: --IN OUT:
1456: --OUT:
1457: --Returns:
1458: -- FND_API.G_TRUE if manual acceptance is required
1459: -- FND_API.G_FALSE otherwise
1460: --Notes:
1461: --Testing:
1462: --End of Comments
1463: ------------------------------------------------------------------------
1471: d_position NUMBER;
1472:
1473: l_index NUMBER;
1474:
1475: l_manual_accept_required VARCHAR2(1) := FND_API.G_FALSE;
1476: l_need_to_check_tolerance VARCHAR2(1) := FND_API.G_FALSE;
1477: l_has_autoaccepted_line VARCHAR2(1) := FND_API.G_FALSE;
1478: l_over_tolerance VARCHAR2(1);
1479:
1472:
1473: l_index NUMBER;
1474:
1475: l_manual_accept_required VARCHAR2(1) := FND_API.G_FALSE;
1476: l_need_to_check_tolerance VARCHAR2(1) := FND_API.G_FALSE;
1477: l_has_autoaccepted_line VARCHAR2(1) := FND_API.G_FALSE;
1478: l_over_tolerance VARCHAR2(1);
1479:
1480: l_check_tolerance_index_tbl DBMS_SQL.NUMBER_TABLE;
1473: l_index NUMBER;
1474:
1475: l_manual_accept_required VARCHAR2(1) := FND_API.G_FALSE;
1476: l_need_to_check_tolerance VARCHAR2(1) := FND_API.G_FALSE;
1477: l_has_autoaccepted_line VARCHAR2(1) := FND_API.G_FALSE;
1478: l_over_tolerance VARCHAR2(1);
1479:
1480: l_check_tolerance_index_tbl DBMS_SQL.NUMBER_TABLE;
1481:
1538: -- Otherwise, we need to check price tolerance to see if manual acceptance
1539: -- is necessary
1540: FOR i IN 1..l_po_line_id_tbl.COUNT LOOP
1541: IF (l_new_line_flag_tbl(i) = 'Y') THEN
1542: l_manual_accept_required := FND_API.G_TRUE;
1543: ELSE
1544: -- add to the table that indicates what rows we need to check
1545: -- for tolerance
1546: l_check_tolerance_index_tbl(i) := i;
1543: ELSE
1544: -- add to the table that indicates what rows we need to check
1545: -- for tolerance
1546: l_check_tolerance_index_tbl(i) := i;
1547: l_need_to_check_tolerance := FND_API.G_TRUE;
1548: END IF;
1549: END LOOP;
1550:
1551: d_position := 20;
1549: END LOOP;
1550:
1551: d_position := 20;
1552:
1553: IF (l_need_to_check_tolerance = FND_API.G_TRUE) THEN
1554:
1555: PO_PDOI_PRICE_TOLERANCE_PVT.get_price_tolerance
1556: ( p_index_tbl => l_check_tolerance_index_tbl,
1557: p_po_header_id_tbl => l_po_header_id_tbl,
1575: p_old_price => l_old_price_tbl(l_index),
1576: p_new_price => l_new_price_tbl(l_index)
1577: );
1578:
1579: IF (l_over_tolerance = FND_API.G_FALSE) THEN
1580: -- need to autoaccept this line
1581: l_autoaccept_tbl.EXTEND;
1582: l_autoaccept_tbl(l_autoaccept_tbl.COUNT) := l_po_line_id_tbl(l_index);
1583:
1580: -- need to autoaccept this line
1581: l_autoaccept_tbl.EXTEND;
1582: l_autoaccept_tbl(l_autoaccept_tbl.COUNT) := l_po_line_id_tbl(l_index);
1583:
1584: l_has_autoaccepted_line := FND_API.G_TRUE;
1585: ELSE
1586: -- require manual acceptance, if there is a line that goes over
1587: -- price tolerance limit
1588: l_manual_accept_required := FND_API.G_TRUE;
1584: l_has_autoaccepted_line := FND_API.G_TRUE;
1585: ELSE
1586: -- require manual acceptance, if there is a line that goes over
1587: -- price tolerance limit
1588: l_manual_accept_required := FND_API.G_TRUE;
1589: END IF;
1590:
1591: l_index := l_check_tolerance_index_tbl.NEXT(l_index);
1592: END LOOP;
1593:
1594: d_position := 50;
1595:
1596: -- For the lines that do not exceed price tolerance, autoaccept them.
1597: IF (l_has_autoaccepted_line = FND_API.G_TRUE) THEN
1598: -- bug5035979
1599: -- cascade acceptance value to lower level as well.
1600: cascade_change_acceptance
1601: ( p_draft_id => p_draft_id,
1603: p_change_accepted_value => 'Y',
1604: x_return_status => l_return_status
1605: );
1606:
1607: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1608: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1609: END IF;
1610: END IF;
1611:
1604: x_return_status => l_return_status
1605: );
1606:
1607: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
1608: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1609: END IF;
1610: END IF;
1611:
1612: END IF;
1704: d_api_name CONSTANT VARCHAR2(30) := 'autoaccept_deleted_records';
1705: d_module CONSTANT VARCHAR2(255) := PO_LOG.get_subprogram_base(d_pkg_name, d_api_name);
1706: d_position NUMBER;
1707:
1708: l_has_record_to_accept VARCHAR2(1) := FND_API.G_TRUE;
1709:
1710: BEGIN
1711:
1712: d_position := 0;
1808: -- draft unique identifier
1809: --IN OUT:
1810: --OUT:
1811: --Returns:
1812: -- FND_API.G_TRUE if there's still record in the draft to accept
1813: -- FND_API.G_FALSE otherwise
1814: --Notes:
1815: --Testing:
1816: --End of Comments
1809: --IN OUT:
1810: --OUT:
1811: --Returns:
1812: -- FND_API.G_TRUE if there's still record in the draft to accept
1813: -- FND_API.G_FALSE otherwise
1814: --Notes:
1815: --Testing:
1816: --End of Comments
1817: ------------------------------------------------------------------------
1823: d_api_name CONSTANT VARCHAR2(30) := 'autoaccept_unchanged_records';
1824: d_module CONSTANT VARCHAR2(255) := PO_LOG.get_subprogram_base(d_pkg_name, d_api_name);
1825: d_position NUMBER;
1826:
1827: l_has_record_to_accept VARCHAR2(1) := FND_API.G_TRUE;
1828:
1829: BEGIN
1830:
1831: d_position := 0;
2960: -- draft unique identifier
2961: --IN OUT:
2962: --OUT:
2963: --Return:
2964: -- FND_API.G_TRUE if there's still record in the draft to accept
2965: -- FND_API.G_FALSE otherwise
2966: --Notes:
2967: --Testing:
2968: --End of Comments
2961: --IN OUT:
2962: --OUT:
2963: --Return:
2964: -- FND_API.G_TRUE if there's still record in the draft to accept
2965: -- FND_API.G_FALSE otherwise
2966: --Notes:
2967: --Testing:
2968: --End of Comments
2969: ------------------------------------------------------------------------
2975: d_api_name CONSTANT VARCHAR2(30) := 'has_record_to_accept';
2976: d_module CONSTANT VARCHAR2(255) := PO_LOG.get_subprogram_base(d_pkg_name, d_api_name);
2977: d_position NUMBER;
2978:
2979: l_has_record_to_accept VARCHAR2(1) := FND_API.G_TRUE;
2980:
2981: BEGIN
2982:
2983: d_position := 0;
2985: IF (PO_LOG.d_proc) THEN
2986: PO_LOG.proc_begin (d_module);
2987: END IF;
2988:
2989: SELECT NVL(MAX(FND_API.G_TRUE), FND_API.G_FALSE)
2990: INTO l_has_record_to_accept
2991: FROM DUAL
2992: WHERE EXISTS
2993: ( SELECT 1
3195: PO_LOG.proc_begin (d_module, 'p_draft_id', p_draft_id);
3196: PO_LOG.proc_begin (d_module, 'p_line_id_list.COUNT', p_line_id_list.COUNT);
3197: END IF;
3198:
3199: x_return_status := FND_API.g_RET_STS_SUCCESS;
3200:
3201: -- Update records in PO_LINES_DRAFT_ALL based on the list of lines to change
3202: -- in p_line_id_list;
3203: FORALL i IN 1..p_line_id_list.COUNT
3272: PO_MESSAGE_S.add_exc_msg
3273: ( p_pkg_name => d_pkg_name,
3274: p_procedure_name => d_api_name || '.' || d_position
3275: );
3276: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3277: END cascade_change_acceptance;
3278:
3279: -- bug5035979 END
3280:
3319: BEGIN
3320:
3321: d_position := 0;
3322:
3323: x_return_status := FND_API.G_RET_STS_SUCCESS;
3324:
3325: IF (PO_LOG.d_proc) THEN
3326: PO_LOG.proc_begin (d_module, 'p_draft_id', p_draft_id);
3327: END IF;
3385: DELETE FROM po_session_gt
3386: WHERE key = l_key;
3387:
3388: IF (x_invalid_line_id_list.COUNT > 0) THEN
3389: x_return_status := FND_API.G_RET_STS_ERROR;
3390: END IF;
3391:
3392: IF (PO_LOG.d_proc) THEN
3393: PO_LOG.proc_end (d_module);
3398: PO_MESSAGE_S.add_exc_msg
3399: ( p_pkg_name => d_pkg_name,
3400: p_procedure_name => d_api_name || '.' || d_position
3401: );
3402: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3403: END validate_disposition;
3404:
3405: -- bug5187544 END
3406: