74: IF l_ret_val NOT IN ('Y','N')
75: THEN
76: -- resource not exist for this user
77: fnd_message.set_name ('CN', 'CN_INVALID_PAYBYMODE');
78: fnd_msg_pub.ADD;
79: RAISE fnd_api.g_exc_error;
80: END IF ;
81: RETURN l_ret_val ;
82: END;
117: WHEN NO_DATA_FOUND
118: THEN
119: -- resource not exist for this user
120: fnd_message.set_name ('CN', 'CN_USER_RESOURCE_NF');
121: fnd_msg_pub.ADD;
122: RAISE fnd_api.g_exc_error;
123: END;
124:
125: -- Get number of parent_resource for current resource
190: WHEN NO_DATA_FOUND
191: THEN
192: -- resource not exist for this user
193: fnd_message.set_name ('CN', 'CN_USER_RESOURCE_NF');
194: fnd_msg_pub.ADD;
195: RAISE fnd_api.g_exc_error;
196: END;
197:
198: SELECT 1
324: EXCEPTION
325: WHEN fnd_api.g_exc_error
326: THEN
327: x_return_status := fnd_api.g_ret_sts_error;
328: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
329: WHEN OTHERS
330: THEN
331: x_return_status := fnd_api.g_ret_sts_unexp_error;
332:
329: WHEN OTHERS
330: THEN
331: x_return_status := fnd_api.g_ret_sts_unexp_error;
332:
333: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
334: THEN
335: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
336: END IF;
337:
331: x_return_status := fnd_api.g_ret_sts_unexp_error;
332:
333: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
334: THEN
335: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
336: END IF;
337:
338: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
339: END paid_payrun_audit;
334: THEN
335: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
336: END IF;
337:
338: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
339: END paid_payrun_audit;
340:
341: --
342: -- Procedure : Payrun_Audit
445: EXCEPTION
446: WHEN fnd_api.g_exc_error
447: THEN
448: x_return_status := fnd_api.g_ret_sts_error;
449: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
450: WHEN OTHERS
451: THEN
452: x_return_status := fnd_api.g_ret_sts_unexp_error;
453:
450: WHEN OTHERS
451: THEN
452: x_return_status := fnd_api.g_ret_sts_unexp_error;
453:
454: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
455: THEN
456: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
457: END IF;
458:
452: x_return_status := fnd_api.g_ret_sts_unexp_error;
453:
454: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
455: THEN
456: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
457: END IF;
458:
459: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
460: END payrun_audit;
455: THEN
456: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
457: END IF;
458:
459: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
460: END payrun_audit;
461:
462:
463: --===================================================================================
651: EXCEPTION
652: WHEN fnd_api.g_exc_error
653: THEN
654: x_return_status := fnd_api.g_ret_sts_error;
655: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
656: WHEN OTHERS
657: THEN
658: x_return_status := fnd_api.g_ret_sts_unexp_error;
659:
656: WHEN OTHERS
657: THEN
658: x_return_status := fnd_api.g_ret_sts_unexp_error;
659:
660: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
661: THEN
662: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
663: END IF;
664:
658: x_return_status := fnd_api.g_ret_sts_unexp_error;
659:
660: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
661: THEN
662: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
663: END IF;
664:
665: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
666: END worksheet_audit;
661: THEN
662: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
663: END IF;
664:
665: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
666: END worksheet_audit;
667:
668: -- Start of comments
669: -- API name : Payrun_Action
741:
742: -- Initialize message list if p_init_msg_list is set to TRUE.
743: IF fnd_api.to_boolean (p_init_msg_list)
744: THEN
745: fnd_msg_pub.initialize;
746: END IF;
747:
748: -- Initialize API return status to success
749: x_return_status := fnd_api.g_ret_sts_success;
759: WHERE payrun_id = p_payrun_id;
760: EXCEPTION
761: WHEN NO_DATA_FOUND
762: THEN
763: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
764: THEN
765: fnd_message.set_name ('CN', 'CN_PAYRUN_DOES_NOT_EXIST');
766: fnd_msg_pub.ADD;
767: END IF;
762: THEN
763: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
764: THEN
765: fnd_message.set_name ('CN', 'CN_PAYRUN_DOES_NOT_EXIST');
766: fnd_msg_pub.ADD;
767: END IF;
768:
769: RAISE fnd_api.g_exc_error;
770: END;
792:
793: IF err_num = -54
794: THEN
795: fnd_message.set_name ('CN', 'CN_INVALID_OBJECT_VERSION');
796: fnd_msg_pub.ADD;
797: RAISE fnd_api.g_exc_error;
798: ELSE
799: RAISE;
800: END IF;
802:
803: -- Check if user is Super User. Only super user can perform payrun action
804: /* Comment out for R12 payment security
805: IF is_superuser(p_period_id => l_period_id) = 0 THEN
806: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
807: FND_MESSAGE.SET_NAME ('CN','CN_PAYRUN_NOT_SU');
808: FND_MSG_PUB.Add;
809: END IF;
810: RAISE FND_API.G_EXC_ERROR ;
804: /* Comment out for R12 payment security
805: IF is_superuser(p_period_id => l_period_id) = 0 THEN
806: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
807: FND_MESSAGE.SET_NAME ('CN','CN_PAYRUN_NOT_SU');
808: FND_MSG_PUB.Add;
809: END IF;
810: RAISE FND_API.G_EXC_ERROR ;
811: END IF;
812: */
813:
814: -- cannot perform action on paid payrun
815: IF l_payrun_status = 'PAID'
816: THEN
817: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
818: THEN
819: fnd_message.set_name ('CN', 'CN_PAYRUN_PAID');
820: fnd_msg_pub.ADD;
821: END IF;
816: THEN
817: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
818: THEN
819: fnd_message.set_name ('CN', 'CN_PAYRUN_PAID');
820: fnd_msg_pub.ADD;
821: END IF;
822:
823: RAISE fnd_api.g_exc_error;
824: END IF;
831: AND payrun_id = p_payrun_id
832: AND rownum < 2;
833:
834: IF l_temp > 0 THEN
835: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
836: THEN
837: fnd_message.set_name ('CN', 'CN_WKSHT_STILL_PROCESSING');
838: fnd_msg_pub.ADD;
839: END IF;
834: IF l_temp > 0 THEN
835: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
836: THEN
837: fnd_message.set_name ('CN', 'CN_WKSHT_STILL_PROCESSING');
838: fnd_msg_pub.ADD;
839: END IF;
840: RAISE fnd_api.g_exc_error;
841: END IF;
842:
873:
874: --Added for R12 payment security check end.
875: IF l_payrun_status <> 'UNPAID'
876: THEN
877: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
878: THEN
879: fnd_message.set_name ('CN', 'CN_PAYRUN_ACTION_UNPAID');
880: fnd_msg_pub.ADD;
881: END IF;
876: THEN
877: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
878: THEN
879: fnd_message.set_name ('CN', 'CN_PAYRUN_ACTION_UNPAID');
880: fnd_msg_pub.ADD;
881: END IF;
882:
883: RAISE fnd_api.g_exc_error;
884: END IF;
895:
896: --Added for R12 payment security check end.
897: IF l_payrun_status <> 'FROZEN'
898: THEN
899: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
900: THEN
901: fnd_message.set_name ('CN', 'CN_PAYRUN_ACTION_UNFREEZE');
902: fnd_msg_pub.ADD;
903: END IF;
898: THEN
899: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
900: THEN
901: fnd_message.set_name ('CN', 'CN_PAYRUN_ACTION_UNFREEZE');
902: fnd_msg_pub.ADD;
903: END IF;
904:
905: RAISE fnd_api.g_exc_error;
906: END IF;
926: WHERE EXISTS (SELECT 1
927: FROM cn_payment_worksheets
928: WHERE payrun_id = p_payrun_id AND worksheet_status <> 'APPROVED');
929:
930: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
931: THEN
932: fnd_message.set_name ('CN', 'CN_PAYRUN_ACTION_PAY');
933: fnd_msg_pub.ADD;
934: END IF;
929:
930: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
931: THEN
932: fnd_message.set_name ('CN', 'CN_PAYRUN_ACTION_PAY');
933: fnd_msg_pub.ADD;
934: END IF;
935:
936: RAISE fnd_api.g_exc_error;
937: EXCEPTION
941: END;
942: ELSE
943: IF l_payrun_status <> 'FROZEN'
944: THEN
945: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
946: THEN
947: fnd_message.set_name ('CN', 'CN_PAYRUN_ACTION_PAY_FRZ');
948: fnd_msg_pub.ADD;
949: END IF;
944: THEN
945: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
946: THEN
947: fnd_message.set_name ('CN', 'CN_PAYRUN_ACTION_PAY_FRZ');
948: fnd_msg_pub.ADD;
949: END IF;
950:
951: RAISE fnd_api.g_exc_error;
952: END IF;
952: END IF;
953: END IF;
954: ELSE
955: -- invalid p_action
956: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
957: THEN
958: fnd_message.set_name ('CN', 'CN_PAYRUN_ACTION_NOT_EXIST');
959: fnd_msg_pub.ADD;
960: END IF;
955: -- invalid p_action
956: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
957: THEN
958: fnd_message.set_name ('CN', 'CN_PAYRUN_ACTION_NOT_EXIST');
959: fnd_msg_pub.ADD;
960: END IF;
961:
962: RAISE fnd_api.g_exc_error;
963: END IF;
985: COMMIT WORK;
986: END IF;
987:
988: -- Standard call to get message count and if count is 1, get message info.
989: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
990: EXCEPTION
991: WHEN fnd_api.g_exc_error
992: THEN
993: ROLLBACK TO payrun_action;
991: WHEN fnd_api.g_exc_error
992: THEN
993: ROLLBACK TO payrun_action;
994: x_return_status := fnd_api.g_ret_sts_error;
995: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
996: WHEN fnd_api.g_exc_unexpected_error
997: THEN
998: ROLLBACK TO payrun_action;
999: x_return_status := fnd_api.g_ret_sts_unexp_error;
996: WHEN fnd_api.g_exc_unexpected_error
997: THEN
998: ROLLBACK TO payrun_action;
999: x_return_status := fnd_api.g_ret_sts_unexp_error;
1000: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1001: WHEN OTHERS
1002: THEN
1003: ROLLBACK TO payrun_action;
1004: x_return_status := fnd_api.g_ret_sts_unexp_error;
1002: THEN
1003: ROLLBACK TO payrun_action;
1004: x_return_status := fnd_api.g_ret_sts_unexp_error;
1005:
1006: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1007: THEN
1008: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1009: END IF;
1010:
1004: x_return_status := fnd_api.g_ret_sts_unexp_error;
1005:
1006: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1007: THEN
1008: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1009: END IF;
1010:
1011: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1012: END payrun_action;
1007: THEN
1008: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1009: END IF;
1010:
1011: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1012: END payrun_action;
1013:
1014: -- Start of comments
1015: -- API name : Worksheet_action
1093:
1094: -- Initialize message list if p_init_msg_list is set to TRUE.
1095: IF fnd_api.to_boolean (p_init_msg_list)
1096: THEN
1097: fnd_msg_pub.initialize;
1098: END IF;
1099:
1100: -- Initialize API return status to success
1101: x_return_status := fnd_api.g_ret_sts_success;
1128: AND wk.org_id = s.org_id;
1129: EXCEPTION
1130: WHEN NO_DATA_FOUND
1131: THEN
1132: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1133: THEN
1134: fnd_message.set_name ('CN', 'CN_WKSHT_DOES_NOT_EXIST');
1135: fnd_msg_pub.ADD;
1136: END IF;
1131: THEN
1132: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1133: THEN
1134: fnd_message.set_name ('CN', 'CN_WKSHT_DOES_NOT_EXIST');
1135: fnd_msg_pub.ADD;
1136: END IF;
1137:
1138: RAISE fnd_api.g_exc_error;
1139: END;
1161:
1162: IF err_num = -54
1163: THEN
1164: fnd_message.set_name ('CN', 'CN_INVALID_OBJECT_VERSION');
1165: fnd_msg_pub.ADD;
1166: RAISE fnd_api.g_exc_error;
1167: ELSE
1168: RAISE;
1169: END IF;
1171:
1172: -- cannot perform action on paid payrun
1173: IF l_payrun_status = 'PAID'
1174: THEN
1175: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1176: THEN
1177: fnd_message.set_name ('CN', 'CN_PAYRUN_PAID');
1178: fnd_msg_pub.ADD;
1179: END IF;
1174: THEN
1175: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1176: THEN
1177: fnd_message.set_name ('CN', 'CN_PAYRUN_PAID');
1178: fnd_msg_pub.ADD;
1179: END IF;
1180:
1181: RAISE fnd_api.g_exc_error;
1182: END IF;
1193: WHEN NO_DATA_FOUND
1194: THEN
1195: -- resource not exist for this user
1196: fnd_message.set_name ('CN', 'CN_USER_RESOURCE_NF');
1197: fnd_msg_pub.ADD;
1198: RAISE fnd_api.g_exc_error;
1199: END;
1200:
1201: -- check if user can access this worksheet when
1248: AND m2.resource_id = re2.resource_id);
1249: EXCEPTION
1250: WHEN NO_DATA_FOUND
1251: THEN
1252: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1253: THEN
1254: fnd_message.set_name ('CN', 'CN_NO_SRP_ACCESS');
1255: fnd_msg_pub.ADD;
1256: END IF;
1251: THEN
1252: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1253: THEN
1254: fnd_message.set_name ('CN', 'CN_NO_SRP_ACCESS');
1255: fnd_msg_pub.ADD;
1256: END IF;
1257:
1258: RAISE fnd_api.g_exc_error;
1259: END;
1303:
1304: --Added for R12 payment security check end.
1305: IF l_payrun_status <> 'UNPAID' OR l_worksheet_rec.worksheet_status <> 'UNPAID'
1306: THEN
1307: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1308: THEN
1309: fnd_message.set_name ('CN', 'CN_WKSHT_ACTION_UNPAID');
1310: fnd_msg_pub.ADD;
1311: END IF;
1306: THEN
1307: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1308: THEN
1309: fnd_message.set_name ('CN', 'CN_WKSHT_ACTION_UNPAID');
1310: fnd_msg_pub.ADD;
1311: END IF;
1312:
1313: RAISE fnd_api.g_exc_error;
1314: END IF;
1323:
1324: --Added for R12 payment security check end.
1325: IF l_payrun_status <> 'UNPAID' OR l_worksheet_rec.worksheet_status NOT IN ('PROCESSING', 'UNPAID')
1326: THEN
1327: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1328: THEN
1329: fnd_message.set_name ('CN', 'CN_WKSHT_NOT_PROCESSING');
1330: fnd_msg_pub.ADD;
1331: END IF;
1326: THEN
1327: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1328: THEN
1329: fnd_message.set_name ('CN', 'CN_WKSHT_NOT_PROCESSING');
1330: fnd_msg_pub.ADD;
1331: END IF;
1332:
1333: RAISE fnd_api.g_exc_error;
1334: END IF;
1344:
1345: --Added for R12 payment security check end.
1346: IF l_payrun_status <> 'UNPAID' OR (l_worksheet_rec.worksheet_status NOT IN ('PROCESSING','FAILED'))
1347: THEN
1348: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1349: THEN
1350: fnd_message.set_name ('CN', 'CN_WKSHT_NOT_PROCESSING');
1351: fnd_msg_pub.ADD;
1352: END IF;
1347: THEN
1348: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1349: THEN
1350: fnd_message.set_name ('CN', 'CN_WKSHT_NOT_PROCESSING');
1351: fnd_msg_pub.ADD;
1352: END IF;
1353:
1354: RAISE fnd_api.g_exc_error;
1355: END IF;
1367:
1368: --Added for R12 payment security check end.
1369: IF l_payrun_status <> 'UNPAID' OR l_worksheet_rec.worksheet_status <> 'LOCKED'
1370: THEN
1371: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1372: THEN
1373: fnd_message.set_name ('CN', 'CN_WKSHT_ACTION_UNLOCK');
1374: fnd_msg_pub.ADD;
1375: END IF;
1370: THEN
1371: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1372: THEN
1373: fnd_message.set_name ('CN', 'CN_WKSHT_ACTION_UNLOCK');
1374: fnd_msg_pub.ADD;
1375: END IF;
1376:
1377: RAISE fnd_api.g_exc_error;
1378: END IF;
1389:
1390: --Added for R12 payment security check end.
1391: IF l_worksheet_rec.worksheet_status <> 'LOCKED'
1392: THEN
1393: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1394: THEN
1395: fnd_message.set_name ('CN', 'CN_WKSHT_ACTION_SUBMIT');
1396: fnd_msg_pub.ADD;
1397: END IF;
1392: THEN
1393: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1394: THEN
1395: fnd_message.set_name ('CN', 'CN_WKSHT_ACTION_SUBMIT');
1396: fnd_msg_pub.ADD;
1397: END IF;
1398:
1399: RAISE fnd_api.g_exc_error;
1400: END IF;
1423: --Added for R12 payment security check end.
1424: --- commented by fred
1425: IF l_worksheet_rec.worksheet_status <> 'SUBMITTED' AND l_worksheet_rec.worksheet_status <> 'APPROVED'
1426: THEN
1427: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1428: THEN
1429: fnd_message.set_name ('CN', 'CN_WKSHT_ACTION_APPROVE');
1430: fnd_msg_pub.ADD;
1431: END IF;
1426: THEN
1427: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1428: THEN
1429: fnd_message.set_name ('CN', 'CN_WKSHT_ACTION_APPROVE');
1430: fnd_msg_pub.ADD;
1431: END IF;
1432:
1433: RAISE fnd_api.g_exc_error;
1434: END IF;
1436: -- only manager or superuser can perform submit and approve
1437: -- Check if user is manager
1438: /* comment out as R12 payment security has been changed.
1439: IF is_superuser(p_period_id => l_pay_period_id) = 0 AND is_manager(p_period_id => l_pay_period_id) = 0 THEN
1440: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1441: FND_MESSAGE.SET_NAME ('CN','CN_WKSHT_NOT_MGR');
1442: FND_MSG_PUB.Add;
1443: END IF;
1444: RAISE FND_API.G_EXC_ERROR ;
1438: /* comment out as R12 payment security has been changed.
1439: IF is_superuser(p_period_id => l_pay_period_id) = 0 AND is_manager(p_period_id => l_pay_period_id) = 0 THEN
1440: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
1441: FND_MESSAGE.SET_NAME ('CN','CN_WKSHT_NOT_MGR');
1442: FND_MSG_PUB.Add;
1443: END IF;
1444: RAISE FND_API.G_EXC_ERROR ;
1445: END IF;
1446: */
1498: WHERE payment_worksheet_id = p_worksheet_id));
1499: EXCEPTION
1500: WHEN NO_DATA_FOUND
1501: THEN
1502: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1503: THEN
1504: fnd_message.set_name ('CN', 'CN_NO_SRP_ACCESS');
1505: fnd_msg_pub.ADD;
1506: END IF;
1501: THEN
1502: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1503: THEN
1504: fnd_message.set_name ('CN', 'CN_NO_SRP_ACCESS');
1505: fnd_msg_pub.ADD;
1506: END IF;
1507:
1508: RAISE fnd_api.g_exc_error;
1509: END;
1529: AND submit_by_user_id = fnd_global.user_id AND approval_status = 'APPROVED';
1530:
1531: IF l_tmp > 0
1532: THEN
1533: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1534: THEN
1535: fnd_message.set_name ('CN', 'CN_SAME_USER_APPROVE');
1536: fnd_msg_pub.ADD;
1537: END IF;
1532: THEN
1533: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1534: THEN
1535: fnd_message.set_name ('CN', 'CN_SAME_USER_APPROVE');
1536: fnd_msg_pub.ADD;
1537: END IF;
1538:
1539: RAISE fnd_api.g_exc_error;
1540: END IF;
1541: END IF;
1542:
1543: ELSE
1544: -- invalid p_action
1545: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1546: THEN
1547: fnd_message.set_name ('CN', 'CN_WKSHT_ACTION_NOT_EXIST');
1548: fnd_msg_pub.ADD;
1549: END IF;
1544: -- invalid p_action
1545: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1546: THEN
1547: fnd_message.set_name ('CN', 'CN_WKSHT_ACTION_NOT_EXIST');
1548: fnd_msg_pub.ADD;
1549: END IF;
1550:
1551: RAISE fnd_api.g_exc_error;
1552: END IF;
1576: COMMIT WORK;
1577: END IF;
1578:
1579: -- Standard call to get message count and if count is 1, get message info.
1580: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1581: EXCEPTION
1582: WHEN fnd_api.g_exc_error
1583: THEN
1584: ROLLBACK TO worksheet_action;
1582: WHEN fnd_api.g_exc_error
1583: THEN
1584: ROLLBACK TO worksheet_action;
1585: x_return_status := fnd_api.g_ret_sts_error;
1586: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1587: WHEN fnd_api.g_exc_unexpected_error
1588: THEN
1589: ROLLBACK TO worksheet_action;
1590: x_return_status := fnd_api.g_ret_sts_unexp_error;
1587: WHEN fnd_api.g_exc_unexpected_error
1588: THEN
1589: ROLLBACK TO worksheet_action;
1590: x_return_status := fnd_api.g_ret_sts_unexp_error;
1591: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1592: WHEN OTHERS
1593: THEN
1594: ROLLBACK TO worksheet_action;
1595: x_return_status := fnd_api.g_ret_sts_unexp_error;
1593: THEN
1594: ROLLBACK TO worksheet_action;
1595: x_return_status := fnd_api.g_ret_sts_unexp_error;
1596:
1597: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1598: THEN
1599: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1600: END IF;
1601:
1595: x_return_status := fnd_api.g_ret_sts_unexp_error;
1596:
1597: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_unexp_error)
1598: THEN
1599: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1600: END IF;
1601:
1602: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1603: END worksheet_action;
1598: THEN
1599: fnd_msg_pub.add_exc_msg (g_pkg_name, l_api_name);
1600: END IF;
1601:
1602: fnd_msg_pub.count_and_get (p_count => x_msg_count, p_data => x_msg_data, p_encoded => fnd_api.g_false);
1603: END worksheet_action;
1604:
1605: --R12 payment security
1606: FUNCTION get_security_access (
1631: END IF;
1632:
1633: l_access := LOWER (p_access);
1634:
1635: IF fnd_msg_pub.check_msg_level (fnd_msg_pub.g_msg_lvl_error)
1636: THEN
1637: fnd_message.set_name ('CN', 'CN_PMT_NO_ACCESS');
1638: fnd_message.set_token ('TYPE', l_type);
1639: fnd_message.set_token ('ACCESS', l_access);
1636: THEN
1637: fnd_message.set_name ('CN', 'CN_PMT_NO_ACCESS');
1638: fnd_message.set_token ('TYPE', l_type);
1639: fnd_message.set_token ('ACCESS', l_access);
1640: fnd_msg_pub.ADD;
1641: END IF;
1642: END IF; --l_ret_val = FALSE
1643:
1644: RETURN l_ret_val;