DBA Data[Home] [Help]

APPS.PO_PDOI_POSTPROC_PVT dependencies on FND_API

Line 215: x_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;

211: --CLM PDOI Integration
212: l_count NUMBER;
213: l_draft_id NUMBER;
214: l_uda_lines_tbl po_tbl_number := NULL;
215: x_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
216: l_template_id NUMBER;
217: l_doc_number VARCHAR2(100) := NULL;
218: l_line_template_id NUMBER;
219: l_shipment_template_id NUMBER;

Line 360: IF Nvl(x_return_status,FND_API.G_RET_STS_SUCCESS) = FND_API.G_RET_STS_SUCCESS

356: l_doc_rec.draft_id);
357: IF (PO_LOG.d_stmt) THEN
358: PO_LOG.stmt(d_module, d_position, 'x_return_status after import_uda_attrs', x_return_status);
359: END IF;
360: IF Nvl(x_return_status,FND_API.G_RET_STS_SUCCESS) = FND_API.G_RET_STS_SUCCESS
361: THEN
362:
363: validate_complex_pricing(l_doc_rec.po_header_id,
364: l_doc_rec.interface_header_id,

Line 383: IF (l_header_rejected = FND_API.G_FALSE) THEN

379: IF (PO_LOG.d_stmt) THEN
380: PO_LOG.stmt(d_module, d_position, 'l_header_rejected', l_header_rejected);
381: END IF;
382:
383: IF (l_header_rejected = FND_API.G_FALSE) THEN
384: d_position := 30;
385:
386: transfer_document_check
387: ( p_doc_rec => l_doc_rec,

Line 401: IF (l_transfer_flag = FND_API.G_FALSE) THEN

397: END IF;
398:
399: d_position := 40;
400:
401: IF (l_transfer_flag = FND_API.G_FALSE) THEN
402:
403: d_position := 50;
404:
405: -- Change the draft status back to 'DRAFT' (it was set to

Line 418: p_unlock_current => FND_API.G_FALSE

414: PO_DRAFTS_PVT.lock_document
415: ( p_po_header_id => l_doc_rec.po_header_id,
416: p_role => PO_PDOI_PARAMS.g_request.role,
417: p_role_user_id => FND_GLOBAL.user_id,
418: p_unlock_current => FND_API.G_FALSE
419: );
420:
421: IF (l_submit_for_buyer_acc_flag = FND_API.G_TRUE) THEN
422: d_position := 60;

Line 421: IF (l_submit_for_buyer_acc_flag = FND_API.G_TRUE) THEN

417: p_role_user_id => FND_GLOBAL.user_id,
418: p_unlock_current => FND_API.G_FALSE
419: );
420:
421: IF (l_submit_for_buyer_acc_flag = FND_API.G_TRUE) THEN
422: d_position := 60;
423:
424: IF (PO_LOG.d_stmt) THEN
425: PO_LOG.stmt(d_module, d_position, 'launch buyer acceptance process');

Line 439: IF ( l_doc_info.has_lines_to_notify = FND_API.G_TRUE) THEN

435: l_process_code := PO_PDOI_CONSTANTS.g_PROCESS_CODE_ACCEPTED;
436: ELSE
437: d_position := 70;
438:
439: IF ( l_doc_info.has_lines_to_notify = FND_API.G_TRUE) THEN
440: l_process_code := PO_PDOI_CONSTANTS.g_PROCESS_CODE_NOTIFIED;
441:
442: -- 5149827
443: -- If the changes are to go over price tolerance acceptance

Line 517: END IF; -- if transfer_flag = FND_API.G_FALSE

513: END IF; -- if document_type = 'BLANKET'
514:
515: d_position := 160;
516:
517: END IF; -- if transfer_flag = FND_API.G_FALSE
518:
519: d_position := 170;
520: -- bug 7277317
521: IF (x_process_code = 'I' ) THEN

Line 543: IF (l_remove_draft = FND_API.G_FALSE) THEN

539: PO_LOG.stmt(d_module, d_position, 'header gets rejected');
540: END IF;
541:
542: -- bug5129752
543: IF (l_remove_draft = FND_API.G_FALSE) THEN
544:
545: -- Change the draft status back to 'DRAFT' (it was set to
546: -- 'PDOI PROCESSING' during header grouping)
547: PO_DRAFTS_PVT.update_draft_status

Line 609: -- FND_API.G_TRUE if passed

605: --IN OUT:
606: --OUT:
607: --x_header_rejected
608: -- Whether the document passed validation or not
609: -- FND_API.G_TRUE if passed
610: -- FND_API.G_FALSE otherwise
611: --End of Comments
612: ------------------------------------------------------------------------
613: PROCEDURE remove_notified_draft_lines

Line 610: -- FND_API.G_FALSE otherwise

606: --OUT:
607: --x_header_rejected
608: -- Whether the document passed validation or not
609: -- FND_API.G_TRUE if passed
610: -- FND_API.G_FALSE otherwise
611: --End of Comments
612: ------------------------------------------------------------------------
613: PROCEDURE remove_notified_draft_lines
614: ( p_draft_id IN NUMBER

Line 720: -- FND_API.G_TRUE if passed

716: --IN OUT:
717: --OUT:
718: --x_header_rejected
719: -- Whether the document passed validation or not
720: -- FND_API.G_TRUE if passed
721: -- FND_API.G_FALSE otherwise
722: --End of Comments
723: ------------------------------------------------------------------------
724: PROCEDURE process_rejected_records IS

Line 721: -- FND_API.G_FALSE otherwise

717: --OUT:
718: --x_header_rejected
719: -- Whether the document passed validation or not
720: -- FND_API.G_TRUE if passed
721: -- FND_API.G_FALSE otherwise
722: --End of Comments
723: ------------------------------------------------------------------------
724: PROCEDURE process_rejected_records IS
725:

Line 776: ) = FND_API.G_FALSE ) THEN

772:
773: IF (PO_DRAFTS_PVT.is_draft_applicable
774: ( p_po_header_id => l_po_header_id_tbl(i),
775: p_role => PO_PDOI_PARAMS.g_request.role
776: ) = FND_API.G_FALSE ) THEN
777:
778: d_position := 40;
779:
780: l_dft_to_delete_tbl.EXTEND;

Line 804: IF (l_chg_exist_tbl(i) = FND_API.G_FALSE) THEN

800: ( p_draft_id_tbl => l_dft_exist_chg_check_tbl
801: );
802:
803: FOR i IN 1..l_dft_exist_chg_check_tbl.COUNT LOOP
804: IF (l_chg_exist_tbl(i) = FND_API.G_FALSE) THEN
805: l_dft_to_delete_tbl.EXTEND;
806: l_dft_to_delete_tbl(l_dft_to_delete_tbl.COUNT) :=
807: l_dft_exist_chg_check_tbl(i);
808: END IF;

Line 844: -- FND_API.G_TRUE if passed

840: --IN OUT:
841: --OUT:
842: --x_header_rejected
843: -- Whether the document passed validation or not
844: -- FND_API.G_TRUE if passed
845: -- FND_API.G_FALSE otherwise
846: --x_remove_draft
847: -- Whether draft has been removed
848: --End of Comments

Line 845: -- FND_API.G_FALSE otherwise

841: --OUT:
842: --x_header_rejected
843: -- Whether the document passed validation or not
844: -- FND_API.G_TRUE if passed
845: -- FND_API.G_FALSE otherwise
846: --x_remove_draft
847: -- Whether draft has been removed
848: --End of Comments
849: ------------------------------------------------------------------------

Line 871: x_header_rejected := FND_API.G_FALSE;

867: IF (PO_LOG.d_proc) THEN
868: PO_LOG.proc_begin(d_module);
869: END IF;
870:
871: x_header_rejected := FND_API.G_FALSE;
872:
873: -- Check 1: If a document has errors, Reject the whole document in the
874: -- following situations
875: -- 1) Standard PO

Line 879: IF ( p_doc_info.has_errors = FND_API.G_TRUE ) THEN

875: -- 1) Standard PO
876: -- 2) Local blankets uploaded through catalog upload
877: -- 3) Quotation upload through catalog upload (bug5461177)
878:
879: IF ( p_doc_info.has_errors = FND_API.G_TRUE ) THEN
880:
881: IF (PO_PDOI_PARAMS.g_request.document_type =
882: PO_PDOI_CONSTANTS.g_doc_type_STANDARD) THEN
883:

Line 912: x_header_rejected := FND_API.G_TRUE;

908: IF (PO_LOG.d_stmt) THEN
909: PO_LOG.stmt(d_module, d_position, 'failed Check 1');
910: END IF;
911:
912: x_header_rejected := FND_API.G_TRUE;
913:
914: END IF;
915: END IF;
916:

Line 921: IF (x_header_rejected = FND_API.G_FALSE) THEN

917: d_position := 20;
918:
919: -- add more checks here
920: -- Check 2: There should at least be one line that is valid
921: IF (x_header_rejected = FND_API.G_FALSE) THEN
922: IF ( p_doc_info.number_of_valid_lines = 0 ) THEN
923: IF (PO_LOG.d_stmt) THEN
924: PO_LOG.stmt(d_module, d_position, 'failed Check 2');
925: END IF;

Line 943: x_header_rejected := FND_API.G_TRUE;

939: );
940:
941: END IF;
942:
943: x_header_rejected := FND_API.G_TRUE;
944: END IF;
945: END IF;
946:
947: x_remove_draft := FND_API.G_FALSE;

Line 947: x_remove_draft := FND_API.G_FALSE;

943: x_header_rejected := FND_API.G_TRUE;
944: END IF;
945: END IF;
946:
947: x_remove_draft := FND_API.G_FALSE;
948:
949: IF (x_header_rejected = FND_API.G_TRUE) THEN
950:
951: -- bug5129752

Line 949: IF (x_header_rejected = FND_API.G_TRUE) THEN

945: END IF;
946:
947: x_remove_draft := FND_API.G_FALSE;
948:
949: IF (x_header_rejected = FND_API.G_TRUE) THEN
950:
951: -- bug5129752
952: -- Calculate x_remove_draft flag
953:

Line 955: FND_API.G_TRUE) THEN

951: -- bug5129752
952: -- Calculate x_remove_draft flag
953:
954: IF ( PO_PDOI_PARAMS.g_docs_info(p_doc_rec.interface_header_id).new_draft =
955: FND_API.G_TRUE) THEN
956: x_remove_draft := FND_API.G_TRUE;
957: END IF;
958:
959: -- If post validation fails, since records are already in draft tables,

Line 956: x_remove_draft := FND_API.G_TRUE;

952: -- Calculate x_remove_draft flag
953:
954: IF ( PO_PDOI_PARAMS.g_docs_info(p_doc_rec.interface_header_id).new_draft =
955: FND_API.G_TRUE) THEN
956: x_remove_draft := FND_API.G_TRUE;
957: END IF;
958:
959: -- If post validation fails, since records are already in draft tables,
960: -- besides setting the interface record to 'REJECTED', we also need to

Line 998: -- FND_API.G_TRUE if transfer needs to happen

994: -- Processing status values of the document
995: --IN OUT:
996: --OUT:
997: --x_transfer_flag
998: -- FND_API.G_TRUE if transfer needs to happen
999: -- FND_API.G_FALSE otherwise
1000: --x_submit_for_buyer_acc_flag
1001: -- FND_API.G_TRUE if the draft is submitted for buyer acceptance
1002: -- FND_API.G_FALSE otherwise

Line 999: -- FND_API.G_FALSE otherwise

995: --IN OUT:
996: --OUT:
997: --x_transfer_flag
998: -- FND_API.G_TRUE if transfer needs to happen
999: -- FND_API.G_FALSE otherwise
1000: --x_submit_for_buyer_acc_flag
1001: -- FND_API.G_TRUE if the draft is submitted for buyer acceptance
1002: -- FND_API.G_FALSE otherwise
1003: --End of Comments

Line 1001: -- FND_API.G_TRUE if the draft is submitted for buyer acceptance

997: --x_transfer_flag
998: -- FND_API.G_TRUE if transfer needs to happen
999: -- FND_API.G_FALSE otherwise
1000: --x_submit_for_buyer_acc_flag
1001: -- FND_API.G_TRUE if the draft is submitted for buyer acceptance
1002: -- FND_API.G_FALSE otherwise
1003: --End of Comments
1004: ------------------------------------------------------------------------
1005: PROCEDURE transfer_document_check

Line 1002: -- FND_API.G_FALSE otherwise

998: -- FND_API.G_TRUE if transfer needs to happen
999: -- FND_API.G_FALSE otherwise
1000: --x_submit_for_buyer_acc_flag
1001: -- FND_API.G_TRUE if the draft is submitted for buyer acceptance
1002: -- FND_API.G_FALSE otherwise
1003: --End of Comments
1004: ------------------------------------------------------------------------
1005: PROCEDURE transfer_document_check
1006: ( p_doc_rec IN doc_row_type,

Line 1016: l_has_over_tolerance_lines VARCHAR2(1) := FND_API.G_FALSE;

1012: d_api_name CONSTANT VARCHAR2(30) := 'transfer_document_check';
1013: d_module CONSTANT VARCHAR2(255) := d_pkg_name || d_api_name || '.';
1014: d_position NUMBER;
1015:
1016: l_has_over_tolerance_lines VARCHAR2(1) := FND_API.G_FALSE;
1017: l_role_auth_acceptance VARCHAR2(30);
1018:
1019: BEGIN
1020: d_position := 0;

Line 1037: x_transfer_flag := FND_API.G_TRUE;

1033: OR
1034: PO_PDOI_PARAMS.g_request.role = PO_GLOBAL.g_role_BUYER) THEN
1035:
1036: d_position := 10;
1037: x_transfer_flag := FND_API.G_TRUE;
1038: ELSE
1039: d_position := 20;
1040:
1041: x_transfer_flag := FND_API.G_FALSE;

Line 1041: x_transfer_flag := FND_API.G_FALSE;

1037: x_transfer_flag := FND_API.G_TRUE;
1038: ELSE
1039: d_position := 20;
1040:
1041: x_transfer_flag := FND_API.G_FALSE;
1042:
1043: -- If there is any line erroring out, or user explicitly prevents the
1044: -- document to be submitted, then document will not be submitted for
1045: -- buyer acceptance

Line 1049: x_submit_for_buyer_acc_flag := FND_API.G_FALSE;

1045: -- buyer acceptance
1046: IF (p_doc_info.number_of_errored_lines > 0
1047: OR NVL(PO_PDOI_PARAMS.g_request.submit_dft_flag, 'N') = 'N') THEN
1048:
1049: x_submit_for_buyer_acc_flag := FND_API.G_FALSE;
1050: ELSE
1051: x_submit_for_buyer_acc_flag := FND_API.G_TRUE;
1052: END IF;
1053:

Line 1051: x_submit_for_buyer_acc_flag := FND_API.G_TRUE;

1047: OR NVL(PO_PDOI_PARAMS.g_request.submit_dft_flag, 'N') = 'N') THEN
1048:
1049: x_submit_for_buyer_acc_flag := FND_API.G_FALSE;
1050: ELSE
1051: x_submit_for_buyer_acc_flag := FND_API.G_TRUE;
1052: END IF;
1053:
1054: END IF; -- if not ga or ...
1055:

Line 1121: IF (l_need_to_create_src_rules = FND_API.G_TRUE) THEN

1117: l_need_to_create_src_rules := need_to_create_sourcing_rules
1118: ( p_doc_rec => p_doc_rec
1119: );
1120:
1121: IF (l_need_to_create_src_rules = FND_API.G_TRUE) THEN
1122:
1123: get_lines_for_src_rules
1124: ( p_doc_rec => p_doc_rec,
1125: x_lines => l_lines

Line 1185: IF (l_return_status = FND_API.G_RET_STS_SUCCESS) THEN

1181: x_return_status => l_return_status
1182: );
1183: -- bug 7277317 added an if condition to check the return status of submission check
1184: -- proceed the below logic only if return status is success
1185: IF (l_return_status = FND_API.G_RET_STS_SUCCESS) THEN
1186: x_process_code := NULL;
1187: IF ( l_approval_method = PO_PDOI_CONSTANTS.g_appr_method_INIT_APPROVAL) THEN
1188: d_position := 40;
1189:

Line 1204: IF (l_need_to_create_src_rules = FND_API.G_TRUE) THEN

1200: d_position := 50;
1201:
1202: l_new_auth_status := 'APPROVED';
1203:
1204: IF (l_need_to_create_src_rules = FND_API.G_TRUE) THEN
1205:
1206: IF (PO_LOG.d_stmt) THEN
1207: PO_LOG.stmt(d_module, d_position, 'creating sourcing rules');
1208: END IF;

Line 1224: IF (l_need_to_encumber = FND_API.G_TRUE) THEN

1220: ( p_doc_rec => p_doc_rec,
1221: p_new_auth_status => l_new_auth_status
1222: );
1223:
1224: IF (l_need_to_encumber = FND_API.G_TRUE) THEN
1225: d_position := 80;
1226:
1227: -- bug4907624
1228: -- Removed the code that sets the document to PRE-APPROVED status

Line 1243: IF (l_fund_reserve_result = FND_API.G_FALSE) THEN

1239: ( p_doc_rec => p_doc_rec,
1240: x_result => l_fund_reserve_result
1241: );
1242:
1243: IF (l_fund_reserve_result = FND_API.G_FALSE) THEN
1244:
1245:
1246: IF (PO_LOG.d_stmt) THEN
1247: PO_LOG.stmt(d_module, d_position, 'Fund reservation was not done correctly');

Line 1355: IF (l_need_to_create_src_rules = FND_API.G_TRUE) THEN

1351: l_need_to_create_src_rules := need_to_create_sourcing_rules
1352: ( p_doc_rec => p_doc_rec
1353: );
1354:
1355: IF (l_need_to_create_src_rules = FND_API.G_TRUE) THEN
1356: d_position := 20;
1357: get_lines_for_src_rules
1358: ( p_doc_rec => p_doc_rec,
1359: x_lines => l_lines

Line 1375: IF (l_doc_info.has_lines_to_notify = FND_API.G_TRUE) THEN

1371: IF (PO_LOG.d_stmt) THEN
1372: PO_LOG.stmt(d_module, d_position, 'Called transfer draft to txn');
1373: END IF;
1374:
1375: IF (l_doc_info.has_lines_to_notify = FND_API.G_TRUE) THEN
1376: -- set header level process code to NOTIFIED
1377: UPDATE po_headers_interface
1378: SET process_code = 'NOTIFIED'
1379: WHERE interface_header_id = p_doc_rec.interface_header_id;

Line 1434: IF (l_return_status = FND_API.G_RET_STS_SUCCESS) THEN

1430: );
1431:
1432: -- bug 7277317 added an if condition to check the return status of submission check
1433: -- proceed the below logic only if return status is success
1434: IF (l_return_status = FND_API.G_RET_STS_SUCCESS) THEN
1435: x_process_code := NULL;
1436: IF ( l_approval_method = PO_PDOI_CONSTANTS.g_appr_method_INIT_APPROVAL) THEN
1437: d_position := 50;
1438:

Line 1455: IF (l_need_to_create_src_rules = FND_API.G_TRUE) THEN

1451: -- l_new_auth_status := 'APPROVED';
1452: -- Bug10300319 if original doc stat is null then update_documet_status throws error
1453: l_new_auth_status := nvl(p_doc_rec.ORIG_AUTH_STATUS,'INCOMPLETE');
1454:
1455: IF (l_need_to_create_src_rules = FND_API.G_TRUE) THEN
1456: d_position := 60;
1457: process_sourcing_rules
1458: ( p_doc_rec => p_doc_rec,
1459: p_approval_status => l_new_auth_status,

Line 1559: IF (l_need_to_create_src_rules = FND_API.G_TRUE) THEN

1555: l_need_to_create_src_rules := need_to_create_sourcing_rules
1556: ( p_doc_rec => p_doc_rec
1557: );
1558:
1559: IF (l_need_to_create_src_rules = FND_API.G_TRUE) THEN
1560: d_position := 20;
1561: get_lines_for_src_rules
1562: ( p_doc_rec => p_doc_rec,
1563: x_lines => l_lines

Line 1585: IF (l_need_to_create_src_rules = FND_API.G_TRUE) THEN

1581: PO_LOG.stmt(d_module, d_position, 'l_approval_method', l_approval_method);
1582: END IF;
1583:
1584: IF (l_approval_method = PO_PDOI_CONSTANTS.g_appr_method_AUTO_APPROVE) THEN
1585: IF (l_need_to_create_src_rules = FND_API.G_TRUE) THEN
1586: d_position := 50;
1587:
1588: IF (PO_LOG.d_stmt) THEN
1589: PO_LOG.stmt(d_module, d_position, 'creating sourcing rules');

Line 1672: IF (l_need_to_create_src_rules = FND_API.G_TRUE) THEN

1668: l_need_to_create_src_rules := need_to_create_sourcing_rules
1669: ( p_doc_rec => p_doc_rec
1670: );
1671:
1672: IF (l_need_to_create_src_rules = FND_API.G_TRUE) THEN
1673: d_position := 30;
1674: get_lines_for_src_rules
1675: ( p_doc_rec => p_doc_rec,
1676: x_lines => l_lines

Line 1688: IF (l_doc_info.has_lines_to_notify = FND_API.G_TRUE) THEN

1684:
1685: d_position := 40;
1686: transfer_draft_to_txn (p_doc_rec => p_doc_rec);
1687:
1688: IF (l_doc_info.has_lines_to_notify = FND_API.G_TRUE) THEN
1689: d_position := 10;
1690:
1691: -- set header level process code to NOTIFIED
1692: UPDATE po_headers_interface

Line 1730: IF (l_need_to_create_src_rules = FND_API.G_TRUE) THEN

1726: PO_LOG.stmt(d_module, d_position, 'l_approval_method', l_approval_method);
1727: END IF;
1728:
1729: IF (l_approval_method = PO_PDOI_CONSTANTS.g_appr_method_AUTO_APPROVE) THEN
1730: IF (l_need_to_create_src_rules = FND_API.G_TRUE) THEN
1731: d_position := 60;
1732:
1733: IF (PO_LOG.d_stmt) THEN
1734: PO_LOG.stmt(d_module, d_position, 'Creating Sourcing rules');

Line 1948: --l_return_status := FND_API.G_RET_STS_ERROR;

1944: );
1945: END LOOP;
1946: END IF; -- End l_return_status='S'
1947: /*Incorrect Statement*/
1948: --l_return_status := FND_API.G_RET_STS_ERROR;
1949:
1950: END IF; -- END ACRN
1951:
1952: -- ACRN proj end

Line 2049: l_return_status := FND_API.G_RET_STS_ERROR;

2045: p_headers => l_headers
2046: );
2047:
2048: -- If Total Order Value is less than the funded value, do not launch Approval Workflow
2049: l_return_status := FND_API.G_RET_STS_ERROR;
2050:
2051: END IF;
2052:
2053: END LOOP;

Line 2059: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN

2055: END IF;
2056: END IF;
2057: -- CLM Partial Funding Changes - End
2058:
2059: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS ) THEN
2060: d_position := 40; -- CLM Partial Funding Changes
2061:
2062: -- change document status to 'INCOMPLETE'
2063: update_document_status

Line 2098: IF (p_return_status = FND_API.G_RET_STS_SUCCESS) THEN

2094: x_return_status => p_return_status
2095: );
2096: -- bug 7277317 added an if condition to check the return status of submission check
2097: -- proceed the below logic only if return status is success
2098: IF (p_return_status = FND_API.G_RET_STS_SUCCESS) THEN
2099: x_process_code := NULL;
2100: IF ( l_approval_method = PO_PDOI_CONSTANTS.g_appr_method_INIT_APPROVAL) THEN
2101: d_position := 60;
2102:

Line 2125: IF ( l_need_to_encumber = FND_API.G_TRUE) THEN

2121: IF (PO_LOG.d_stmt) THEN
2122: PO_LOG.stmt(d_module, d_position, 'l_need_to_encumber', l_need_to_encumber);
2123: END IF;
2124:
2125: IF ( l_need_to_encumber = FND_API.G_TRUE) THEN
2126: d_position := 80;
2127: -- Temporarily setting the status to PRE-APPROVED
2128: update_document_status
2129: ( p_doc_rec => p_doc_rec,

Line 2141: IF (l_fund_reserve_result = FND_API.G_FALSE) THEN

2137: ( p_doc_rec => p_doc_rec,
2138: x_result => l_fund_reserve_result
2139: );
2140:
2141: IF (l_fund_reserve_result = FND_API.G_FALSE) THEN
2142: d_position := 100;
2143: IF (PO_LOG.d_stmt) THEN
2144: PO_LOG.stmt(d_module, d_position, 'failed fund reservation');
2145: END IF;

Line 2166: IF (l_fund_reserve_result = FND_API.G_FALSE) AND (l_new_auth_status = 'PRE-APPROVED') THEN

2162:
2163: /*6851752 Start
2164: Launch Approval, when it fails funds check and the Authrization status is PRE-APPROVED*/
2165:
2166: IF (l_fund_reserve_result = FND_API.G_FALSE) AND (l_new_auth_status = 'PRE-APPROVED') THEN
2167:
2168: IF (PO_LOG.d_stmt) THEN
2169: PO_LOG.stmt(d_module, d_position, 'launching approval workflow');
2170: END IF;

Line 2377: x_return_status := FND_API.G_RET_STS_ERROR;

2373: );
2374: END LOOP;
2375: END IF; -- End l_return_status='S'
2376:
2377: x_return_status := FND_API.G_RET_STS_ERROR;
2378:
2379:
2380: END IF; -- END ACRN
2381:

Line 2385: IF (l_return_status = FND_API.G_RET_STS_SUCCESS ) THEN

2381:
2382: --END ACRN proj
2383:
2384:
2385: IF (l_return_status = FND_API.G_RET_STS_SUCCESS ) THEN
2386:
2387: d_position := 30;
2388:
2389: get_approval_method

Line 2419: IF (p_return_status = FND_API.G_RET_STS_SUCCESS) THEN

2415: x_return_status => p_return_status
2416: );
2417: -- bug 7277317 added an if condition to check the return status of submission check
2418: -- proceed the below logic only if return status is success
2419: IF (p_return_status = FND_API.G_RET_STS_SUCCESS) THEN
2420: x_process_code := NULL;
2421: IF ( l_approval_method = PO_PDOI_CONSTANTS.g_appr_method_INIT_APPROVAL) THEN
2422: d_position := 40;
2423: IF (PO_LOG.d_stmt) THEN

Line 2433: l_update_auth_status := FND_API.G_TRUE;

2429: );
2430:
2431: ELSIF (l_approval_method = PO_PDOI_CONSTANTS.g_appr_method_AUTO_APPROVE) THEN
2432: d_position := 50;
2433: l_update_auth_status := FND_API.G_TRUE;
2434: -- 2435: -- from the original doc for update action>
2436: -- l_new_auth_status := 'APPROVED';
2437: -- Bug10300319 if original doc stat is null then update_documet_status throws error

Line 2450: IF (l_need_to_encumber = FND_API.G_TRUE) THEN

2446: IF (PO_LOG.d_stmt) THEN
2447: PO_LOG.stmt(d_module, d_position, 'l_need_to_encumber', l_need_to_encumber);
2448: END IF;
2449:
2450: IF (l_need_to_encumber = FND_API.G_TRUE) THEN
2451: d_position := 60;
2452: -- reserve document
2453: reserve_fund
2454: ( p_doc_rec => p_doc_rec,

Line 2458: IF (l_fund_reserve_result = FND_API.G_FALSE) THEN

2454: ( p_doc_rec => p_doc_rec,
2455: x_result => l_fund_reserve_result
2456: );
2457:
2458: IF (l_fund_reserve_result = FND_API.G_FALSE) THEN
2459: d_position := 70;
2460: IF (PO_LOG.d_stmt) THEN
2461: PO_LOG.stmt(d_module, d_position, 'l_approval_method', l_approval_method);
2462: END IF;

Line 2466: l_update_auth_status := FND_API.G_FALSE;

2462: END IF;
2463:
2464: -- No need to set the authorziation_status because transfer program
2465: -- should have handled the approval status properly
2466: l_update_auth_status := FND_API.G_FALSE;
2467: END IF;
2468: END IF;
2469:
2470: IF (l_update_auth_status = FND_API.G_TRUE) THEN

Line 2470: IF (l_update_auth_status = FND_API.G_TRUE) THEN

2466: l_update_auth_status := FND_API.G_FALSE;
2467: END IF;
2468: END IF;
2469:
2470: IF (l_update_auth_status = FND_API.G_TRUE) THEN
2471: d_position := 80;
2472: update_document_status
2473: ( p_doc_rec => p_doc_rec,
2474: p_auth_status => l_new_auth_status,

Line 2717: RETURN FND_API.G_TRUE;

2713: END IF;
2714:
2715: IF ( NVL(p_doc_rec.load_sourcing_rules_flag,
2716: PO_PDOI_PARAMS.g_request.create_sourcing_rules_flag) = 'Y') THEN
2717: RETURN FND_API.G_TRUE;
2718: ELSE
2719: RETURN FND_API.G_FALSE;
2720: END IF;
2721:

Line 2719: RETURN FND_API.G_FALSE;

2715: IF ( NVL(p_doc_rec.load_sourcing_rules_flag,
2716: PO_PDOI_PARAMS.g_request.create_sourcing_rules_flag) = 'Y') THEN
2717: RETURN FND_API.G_TRUE;
2718: ELSE
2719: RETURN FND_API.G_FALSE;
2720: END IF;
2721:
2722: EXCEPTION
2723: WHEN OTHERS THEN

Line 2877: p_init_msg_list => FND_API.G_FALSE,

2873: END IF;
2874:
2875: PO_CREATE_SR_ASL.create_sourcing_rules_asl
2876: ( p_api_version => 1.0,
2877: p_init_msg_list => FND_API.G_FALSE,
2878: p_commit => FND_API.G_FALSE,
2879: x_return_status => l_return_status,
2880: x_msg_count => l_msg_count,
2881: x_msg_data => l_msg_data,

Line 2878: p_commit => FND_API.G_FALSE,

2874:
2875: PO_CREATE_SR_ASL.create_sourcing_rules_asl
2876: ( p_api_version => 1.0,
2877: p_init_msg_list => FND_API.G_FALSE,
2878: p_commit => FND_API.G_FALSE,
2879: x_return_status => l_return_status,
2880: x_msg_count => l_msg_count,
2881: x_msg_data => l_msg_data,
2882: p_interface_header_id => p_doc_rec.interface_header_id,

Line 2905: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN

2901: p_interface_error_code => 'PO_DOCS_OPEN_INTERFACE',
2902: x_header_processable_flag => l_header_processable_flag
2903: );
2904:
2905: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
2906: d_position := 40;
2907: IF (PO_LOG.d_stmt) THEN
2908: PO_LOG.stmt(d_module, d_position, 'Sourcing rule creation failed' ||
2909: ' with status: ' || l_return_status || '. Continue to ' ||

Line 2964: l_delete_processed_draft := FND_API.G_TRUE;

2960: -- Delete draft if buyer initiates PDOI or document is not GA
2961: IF (PO_PDOI_PARAMS.g_request.role = PO_GLOBAL.g_role_BUYER
2962: OR
2963: p_doc_rec.ga_flag <> 'Y') THEN
2964: l_delete_processed_draft := FND_API.G_TRUE;
2965: ELSE
2966: l_delete_processed_draft := FND_API.G_FALSE;
2967: END IF;
2968:

Line 2966: l_delete_processed_draft := FND_API.G_FALSE;

2962: OR
2963: p_doc_rec.ga_flag <> 'Y') THEN
2964: l_delete_processed_draft := FND_API.G_TRUE;
2965: ELSE
2966: l_delete_processed_draft := FND_API.G_FALSE;
2967: END IF;
2968:
2969: d_position := 10;
2970:

Line 2973: p_init_msg_list => FND_API.G_FALSE,

2969: d_position := 10;
2970:
2971: PO_DRAFTS_PVT.transfer_draft_to_txn
2972: ( p_api_version => 1.0,
2973: p_init_msg_list => FND_API.G_FALSE,
2974: p_draft_id => p_doc_rec.draft_id,
2975: p_po_header_id => p_doc_rec.po_header_id,
2976: p_delete_processed_draft => l_delete_processed_draft,
2977: p_acceptance_action => NULL,

Line 2981: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN

2977: p_acceptance_action => NULL,
2978: x_return_status => l_return_status
2979: );
2980:
2981: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
2982: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2983: END IF;
2984:
2985: -- bug4907624

Line 2982: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

2978: x_return_status => l_return_status
2979: );
2980:
2981: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
2982: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2983: END IF;
2984:
2985: -- bug4907624
2986: -- Commit txn table changes once transfer is done

Line 3153: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN

3149: x_msg_count => l_msg_count,
3150: x_msg_data => l_msg_data
3151: );
3152:
3153: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
3154: d_position := 20;
3155: IF (PO_LOG.d_stmt) THEN
3156: PO_LOG.stmt(d_module, d_position, 'Archiving failed');
3157: END IF;

Line 3158: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

3154: d_position := 20;
3155: IF (PO_LOG.d_stmt) THEN
3156: PO_LOG.stmt(d_module, d_position, 'Archiving failed');
3157: END IF;
3158: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3159: END IF;
3160:
3161: IF (PO_LOG.d_proc) THEN
3162: PO_LOG.proc_end(d_module);

Line 3221: l_approved_date := FND_API.G_MISS_DATE;

3217: /*Bug 8490582 The following code cause the status to update wrongly and document not visible on form/page so commenting the line
3218: ELSIF (p_auth_status = 'REQUIRES_REAPPROVAL') THEN */
3219: ELSIF (p_auth_status = 'REQUIRES REAPPROVAL') THEN
3220: l_approved_flag := 'R';
3221: l_approved_date := FND_API.G_MISS_DATE;
3222: ELSIF (p_auth_status = 'REJECTED') THEN --
3223: l_approved_flag := 'F';
3224: l_approved_date := FND_API.G_MISS_DATE;
3225: ELSIF (p_auth_status = 'PRE-APPROVED') THEN

Line 3224: l_approved_date := FND_API.G_MISS_DATE;

3220: l_approved_flag := 'R';
3221: l_approved_date := FND_API.G_MISS_DATE;
3222: ELSIF (p_auth_status = 'REJECTED') THEN --
3223: l_approved_flag := 'F';
3224: l_approved_date := FND_API.G_MISS_DATE;
3225: ELSIF (p_auth_status = 'PRE-APPROVED') THEN
3226: l_approved_flag := 'N';
3227: l_approved_date := FND_API.G_MISS_DATE;
3228: ELSIF (p_auth_status = 'APPROVED') THEN

Line 3227: l_approved_date := FND_API.G_MISS_DATE;

3223: l_approved_flag := 'F';
3224: l_approved_date := FND_API.G_MISS_DATE;
3225: ELSIF (p_auth_status = 'PRE-APPROVED') THEN
3226: l_approved_flag := 'N';
3227: l_approved_date := FND_API.G_MISS_DATE;
3228: ELSIF (p_auth_status = 'APPROVED') THEN
3229: l_approved_flag := 'Y';
3230: l_approved_date := SYSDATE;
3231: ELSE

Line 3232: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

3228: ELSIF (p_auth_status = 'APPROVED') THEN
3229: l_approved_flag := 'Y';
3230: l_approved_date := SYSDATE;
3231: ELSE
3232: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3233: END IF;
3234:
3235: ELSIF (PO_PDOI_PARAMS.g_request.document_type =
3236: PO_PDOI_CONSTANTS.g_DOC_TYPE_QUOTATION) THEN

Line 3253: FND_API.G_MISS_DATE, approved_date,

3249: UPDATE po_headers_all
3250: SET authorization_status = p_auth_status,
3251: approved_flag = l_approved_flag,
3252: approved_date = DECODE(l_approved_date,
3253: FND_API.G_MISS_DATE, approved_date,
3254: l_approved_date),
3255: last_update_date = SYSDATE,
3256: last_updated_by = FND_GLOBAL.user_id,
3257: last_update_login = FND_GLOBAL.login_id

Line 3324: -- FND_API.G_TRUE if successful. FND_API.G_FALSE otherwise

3320: -- Some attribute values of the document
3321: --IN OUT:
3322: --OUT:
3323: --x_result
3324: -- FND_API.G_TRUE if successful. FND_API.G_FALSE otherwise
3325: --End of Comments
3326: ------------------------------------------------------------------------
3327: PROCEDURE reserve_fund
3328: ( p_doc_rec IN doc_row_type,

Line 3351: x_result := FND_API.G_TRUE; -- bug4907624

3347: IF (PO_LOG.d_proc) THEN
3348: PO_LOG.proc_begin(d_module);
3349: END IF;
3350:
3351: x_result := FND_API.G_TRUE; -- bug4907624
3352:
3353: d_position := 10;
3354: PO_PDOI_UTL.get_processing_doctype_info
3355: ( x_doc_type => l_doc_type,

Line 3383: IF (l_return_status IN (FND_API.G_RET_STS_ERROR,

3379: x_po_return_code => l_po_return_code,
3380: x_online_report_id => l_online_report_id
3381: );
3382:
3383: IF (l_return_status IN (FND_API.G_RET_STS_ERROR,
3384: FND_API.G_RET_STS_UNEXP_ERROR)) THEN
3385: d_position := 30;
3386: IF (PO_LOG.d_stmt) THEN
3387: PO_LOG.stmt(d_module, d_position, 'Encumbrance returned system error');

Line 3384: FND_API.G_RET_STS_UNEXP_ERROR)) THEN

3380: x_online_report_id => l_online_report_id
3381: );
3382:
3383: IF (l_return_status IN (FND_API.G_RET_STS_ERROR,
3384: FND_API.G_RET_STS_UNEXP_ERROR)) THEN
3385: d_position := 30;
3386: IF (PO_LOG.d_stmt) THEN
3387: PO_LOG.stmt(d_module, d_position, 'Encumbrance returned system error');
3388: END IF;

Line 3390: x_result := FND_API.G_FALSE; -- bug4907624

3386: IF (PO_LOG.d_stmt) THEN
3387: PO_LOG.stmt(d_module, d_position, 'Encumbrance returned system error');
3388: END IF;
3389:
3390: x_result := FND_API.G_FALSE; -- bug4907624
3391: ELSE
3392: IF (l_po_return_code IN (PO_DOCUMENT_FUNDS_PVT.g_return_SUCCESS,
3393: PO_DOCUMENT_FUNDS_PVT.g_return_WARNING)) THEN
3394:

Line 3405: x_result := FND_API.G_FALSE; -- bug4907624

3401: d_position := 50;
3402: IF (PO_LOG.d_stmt) THEN
3403: PO_LOG.stmt(d_module, d_position, 'Fund Reservation failed');
3404: END IF;
3405: x_result := FND_API.G_FALSE; -- bug4907624
3406: END IF;
3407:
3408: END IF;
3409:

Line 3448: l_check_encumbrance_setting VARCHAR2(1) := FND_API.G_FALSE;

3444: d_api_name CONSTANT VARCHAR2(30) := 'need_to_encumber';
3445: d_module CONSTANT VARCHAR2(255) := d_pkg_name || d_api_name || '.';
3446: d_position NUMBER;
3447:
3448: l_check_encumbrance_setting VARCHAR2(1) := FND_API.G_FALSE;
3449: l_need_to_encumber VARCHAR2(1);
3450:
3451: BEGIN
3452: d_position := 0;

Line 3468: l_need_to_encumber := FND_API.G_TRUE;

3464:
3465: IF (PO_PDOI_PARAMS.g_sys.po_encumbrance_flag = 'Y' AND
3466: p_new_auth_status = 'APPROVED') THEN
3467:
3468: l_need_to_encumber := FND_API.G_TRUE;
3469: ELSE
3470: l_need_to_encumber := FND_API.G_FALSE;
3471: END IF;
3472:

Line 3470: l_need_to_encumber := FND_API.G_FALSE;

3466: p_new_auth_status = 'APPROVED') THEN
3467:
3468: l_need_to_encumber := FND_API.G_TRUE;
3469: ELSE
3470: l_need_to_encumber := FND_API.G_FALSE;
3471: END IF;
3472:
3473: ELSIF (PO_PDOI_PARAMS.g_request.document_type =
3474: PO_PDOI_CONSTANTS.g_DOC_TYPE_BLANKET ) THEN

Line 3482: l_need_to_encumber := FND_API.G_TRUE;

3478: p_doc_rec.action <> PO_PDOI_CONSTANTS.g_ACTION_UPDATE AND
3479: p_doc_rec.encumbrance_required_flag = 'Y' AND
3480: p_new_auth_status = 'APPROVED') THEN
3481:
3482: l_need_to_encumber := FND_API.G_TRUE;
3483: ELSE
3484: l_need_to_encumber := FND_API.G_FALSE;
3485: END IF;
3486: ELSE

Line 3484: l_need_to_encumber := FND_API.G_FALSE;

3480: p_new_auth_status = 'APPROVED') THEN
3481:
3482: l_need_to_encumber := FND_API.G_TRUE;
3483: ELSE
3484: l_need_to_encumber := FND_API.G_FALSE;
3485: END IF;
3486: ELSE
3487: -- for other documents, we do not need to encumber
3488: l_need_to_encumber := FND_API.G_FALSE;

Line 3488: l_need_to_encumber := FND_API.G_FALSE;

3484: l_need_to_encumber := FND_API.G_FALSE;
3485: END IF;
3486: ELSE
3487: -- for other documents, we do not need to encumber
3488: l_need_to_encumber := FND_API.G_FALSE;
3489: END IF;
3490:
3491: IF (PO_LOG.d_stmt) THEN
3492: PO_LOG.stmt(d_module, d_position, 'l_need_to_encumber', l_need_to_encumber);

Line 3718: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

3714: IF (PO_LOG.d_stmt) THEN
3715: PO_LOG.stmt(d_module, d_position, 'Supply creation failed');
3716: END IF;
3717:
3718: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3719: END IF;
3720:
3721: IF (PO_LOG.d_proc) THEN
3722: PO_LOG.proc_end(d_module);

Line 3779: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN

3775: p_line_id => NULL,
3776: p_line_location_id => NULL
3777: );
3778:
3779: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
3780: d_position := 10;
3781: IF (PO_LOG.d_stmt) THEN
3782: PO_LOG.stmt(d_module, d_position, 'create delivery record failed');
3783: END IF;

Line 3784: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

3780: d_position := 10;
3781: IF (PO_LOG.d_stmt) THEN
3782: PO_LOG.stmt(d_module, d_position, 'create delivery record failed');
3783: END IF;
3784: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3785: END IF;
3786:
3787: IF (PO_LOG.d_proc) THEN
3788: PO_LOG.proc_end(d_module);

Line 3857: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;

3853: IF (PO_LOG.d_stmt) THEN
3854: PO_LOG.stmt(d_module, d_position, 'PO Closing failed');
3855: END IF;
3856:
3857: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3858: END IF;
3859:
3860: IF (PO_LOG.d_proc) THEN
3861: PO_LOG.proc_end(d_module);

Line 3975: IF (x_return_status <> FND_API.G_RET_STS_SUCCESS) THEN

3971: p_calling_program => 'PDOI',
3972: x_return_status => x_return_status
3973: );
3974:
3975: IF (x_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
3976: -- handle tax calculation error
3977: -- 1. insert warning to error interface table
3978: PO_PDOI_ERR_UTL.add_warning
3979: (

Line 4064: x_return_status := FND_API.G_RET_STS_SUCCESS;

4060: , x_msg_data => x_msg_data
4061: , x_online_report_id => x_online_report_id
4062: );
4063: else
4064: x_return_status := FND_API.G_RET_STS_SUCCESS;
4065: end if;
4066:
4067: IF (x_return_status <> FND_API.G_RET_STS_SUCCESS OR x_online_report_id IS NOT null) THEN
4068: -- write the error into log

Line 4067: IF (x_return_status <> FND_API.G_RET_STS_SUCCESS OR x_online_report_id IS NOT null) THEN

4063: else
4064: x_return_status := FND_API.G_RET_STS_SUCCESS;
4065: end if;
4066:
4067: IF (x_return_status <> FND_API.G_RET_STS_SUCCESS OR x_online_report_id IS NOT null) THEN
4068: -- write the error into log
4069: --PO_LOG.stmt(d_module, d_position,'Submission Check Failed');
4070: x_count := 0;
4071:

Line 4113: x_return_status := FND_API.G_RET_STS_ERROR;

4109: END IF;
4110: END IF;
4111: END IF; /*Bug 10300319*/
4112: if x_count > 0 then
4113: x_return_status := FND_API.G_RET_STS_ERROR;
4114: end if;
4115: END IF;
4116:
4117: IF (PO_LOG.d_proc) THEN

Line 4287: IF Nvl(x_return_status, FND_API.G_RET_STS_SUCCESS) <> FND_API.G_RET_STS_SUCCESS

4283: x_msg_data);
4284: IF (PO_LOG.d_stmt) THEN
4285: PO_LOG.stmt(d_module, d_position,'x_return_status after IMPORT_UDA_ATTRS : '|| x_return_status);
4286: END IF;
4287: IF Nvl(x_return_status, FND_API.G_RET_STS_SUCCESS) <> FND_API.G_RET_STS_SUCCESS
4288: THEN
4289: l_invalid_line_count := l_invalid_line_count + 1;
4290: END IF;
4291:

Line 4296: x_return_status := FND_API.G_RET_STS_ERROR;

4292: END LOOP;
4293:
4294: IF l_invalid_line_count > 0
4295: THEN
4296: x_return_status := FND_API.G_RET_STS_ERROR;
4297: RETURN;
4298: END IF;
4299:
4300: EXCEPTION

Line 4520: x_return_status := FND_API.G_RET_STS_ERROR;

4516: END LOOP;
4517:
4518: IF l_error_count > 0
4519: THEN
4520: x_return_status := FND_API.G_RET_STS_ERROR;
4521: ELSE
4522: x_return_status := FND_API.G_RET_STS_SUCCESS;
4523: END IF;
4524:

Line 4522: x_return_status := FND_API.G_RET_STS_SUCCESS;

4518: IF l_error_count > 0
4519: THEN
4520: x_return_status := FND_API.G_RET_STS_ERROR;
4521: ELSE
4522: x_return_status := FND_API.G_RET_STS_SUCCESS;
4523: END IF;
4524:
4525: IF (PO_LOG.d_stmt) THEN
4526: PO_LOG.stmt(d_module, d_position,'x_return_status :'|| x_return_status);

Line 4626: x_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;

4622: l_delimiter VARCHAR2(2);
4623: l_template_id NUMBER;
4624: l_doc_number VARCHAR2(100) := NULL;
4625: l_count NUMBER := 0;
4626: x_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
4627:
4628:
4629: BEGIN
4630: