116: AND user_status_id = p_user_status_id;
117:
118: BEGIN
119: -- Initialize API return status to sucess
120: x_return_status := FND_API.G_RET_STS_SUCCESS;
121:
122: OPEN system_status_csr(p_user_status_id, p_status_type);
123: FETCH system_status_csr INTO x_system_status;
124: CLOSE system_status_csr;
124: CLOSE system_status_csr;
125:
126: EXCEPTION
127: WHEN OTHERS THEN
128: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
129: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
130: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_INVALID_STATUS_CODE');
131: FND_MSG_PUB.add;
132: END IF;
131: FND_MSG_PUB.add;
132: END IF;
133: -- Standard call to get message count and if count=1, get the message
134: FND_MSG_PUB.Count_And_Get (
135: p_encoded => FND_API.G_FALSE,
136: p_count => x_msg_count,
137: p_data => x_msg_data
138: );
139: END Get_System_Status;
165: AND seeded_flag = 'Y';
166:
167: BEGIN
168: -- Initialize API return status to sucess
169: x_return_status := FND_API.G_RET_STS_SUCCESS;
170:
171: OPEN Get_Status_csr;
172: FETCH Get_Status_csr INTO x_user_status_id;
173: CLOSE Get_Status_csr;
172: FETCH Get_Status_csr INTO x_user_status_id;
173: CLOSE Get_Status_csr;
174: EXCEPTION
175: WHEN OTHERS THEN
176: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
177: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
178: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_INVALID_USER_STATUS');
179: FND_MSG_PUB.add;
180: END IF;
255: l_temp_orig_claim VARCHAR2(30);
256:
257: BEGIN
258: -- Initialize API return status to sucess
259: x_return_status := FND_API.G_RET_STS_SUCCESS;
260:
261: IF (p_split_from_claim_id is null OR
262: p_split_from_claim_id = FND_API.G_MISS_NUM) THEN
263:
258: -- Initialize API return status to sucess
259: x_return_status := FND_API.G_RET_STS_SUCCESS;
260:
261: IF (p_split_from_claim_id is null OR
262: p_split_from_claim_id = FND_API.G_MISS_NUM) THEN
263:
264: OPEN prefix_csr(p_custom_setup_id);
265: FETCH prefix_csr INTO l_prefix;
266: CLOSE prefix_csr;
269: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
270: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_SUFFIX_NOT_FOUND');
271: FND_MSG_PUB.add;
272: END IF;
273: RAISE FND_API.G_EXC_ERROR;
274: END IF;
275:
276: OPEN c_seq_csr;
277: FETCH c_seq_csr INTO l_seq;
339: /* IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
340: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_NUMBER_TOO_LARGE');
341: FND_MSG_PUB.add;
342: END IF;
343: RAISE FND_API.G_EXC_ERROR; */
344:
345: ELSE
346: l_temp_claim_number := l_parent_claim_number;
347: END IF;
350: END IF;
351: x_claim_number := l_claim_number;
352:
353: EXCEPTION
354: WHEN FND_API.G_EXC_ERROR THEN
355: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
356: WHEN OTHERS THEN
357: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
358: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
351: x_claim_number := l_claim_number;
352:
353: EXCEPTION
354: WHEN FND_API.G_EXC_ERROR THEN
355: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
356: WHEN OTHERS THEN
357: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
358: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
359: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_NO_CLAIM_NUMBER');
353: EXCEPTION
354: WHEN FND_API.G_EXC_ERROR THEN
355: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
356: WHEN OTHERS THEN
357: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
358: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
359: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_NO_CLAIM_NUMBER');
360: FND_MSG_PUB.add;
361: END IF;
359: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_NO_CLAIM_NUMBER');
360: FND_MSG_PUB.add;
361: END IF;
362: FND_MSG_PUB.Count_And_Get (
363: p_encoded => FND_API.G_FALSE,
364: p_count => x_msg_count,
365: p_data => x_msg_data
366: );
367: END Get_Claim_Number;
471:
472: BEGIN
473:
474: -- Initialize API return status to sucess
475: x_return_status := FND_API.G_RET_STS_SUCCESS;
476:
477: -- Get customer info
478: OPEN cust_info_csr (l_claim.cust_account_id);
479: FETCH cust_info_csr INTO l_bill_to_id, l_pseudo_contact_id;
487: -- default it to cust_account_id if not a source deduction
488: -- end if
489: -- end if
490: IF (l_claim.ship_to_cust_account_id IS NULL OR
491: l_claim.ship_to_cust_account_id = FND_API.G_MISS_NUM) THEN
492: IF (l_claim.cust_shipto_acct_site_id is not null AND
493: l_claim.cust_shipto_acct_site_id <> FND_API.G_MISS_NUM) THEN
494: OPEN shipto_cust_account_id_csr(l_claim.cust_shipto_acct_site_id);
495: FETCH shipto_cust_account_id_csr INTO l_claim.ship_to_cust_account_id;
489: -- end if
490: IF (l_claim.ship_to_cust_account_id IS NULL OR
491: l_claim.ship_to_cust_account_id = FND_API.G_MISS_NUM) THEN
492: IF (l_claim.cust_shipto_acct_site_id is not null AND
493: l_claim.cust_shipto_acct_site_id <> FND_API.G_MISS_NUM) THEN
494: OPEN shipto_cust_account_id_csr(l_claim.cust_shipto_acct_site_id);
495: FETCH shipto_cust_account_id_csr INTO l_claim.ship_to_cust_account_id;
496: CLOSE shipto_cust_account_id_csr;
497: ELSE
495: FETCH shipto_cust_account_id_csr INTO l_claim.ship_to_cust_account_id;
496: CLOSE shipto_cust_account_id_csr;
497: ELSE
498: IF (l_claim.SOURCE_OBJECT_ID IS NULL OR
499: l_claim.SOURCE_OBJECT_ID = FND_API.G_MISS_NUM) THEN
500: l_claim.ship_to_cust_account_id := l_claim.cust_account_id;
501: ELSE -- Added the condition for 6338281
502: IF ((l_claim.SOURCE_OBJECT_ID IS NOT NULL OR
503: l_claim.SOURCE_OBJECT_ID <> FND_API.G_MISS_NUM) AND l_claim.cust_shipto_acct_site_id is null
499: l_claim.SOURCE_OBJECT_ID = FND_API.G_MISS_NUM) THEN
500: l_claim.ship_to_cust_account_id := l_claim.cust_account_id;
501: ELSE -- Added the condition for 6338281
502: IF ((l_claim.SOURCE_OBJECT_ID IS NOT NULL OR
503: l_claim.SOURCE_OBJECT_ID <> FND_API.G_MISS_NUM) AND l_claim.cust_shipto_acct_site_id is null
504: OR l_claim.cust_shipto_acct_site_id = FND_API.G_MISS_NUM ) THEN
505: l_claim.ship_to_cust_account_id := l_claim.cust_account_id;
506: END IF;
507: END IF;
500: l_claim.ship_to_cust_account_id := l_claim.cust_account_id;
501: ELSE -- Added the condition for 6338281
502: IF ((l_claim.SOURCE_OBJECT_ID IS NOT NULL OR
503: l_claim.SOURCE_OBJECT_ID <> FND_API.G_MISS_NUM) AND l_claim.cust_shipto_acct_site_id is null
504: OR l_claim.cust_shipto_acct_site_id = FND_API.G_MISS_NUM ) THEN
505: l_claim.ship_to_cust_account_id := l_claim.cust_account_id;
506: END IF;
507: END IF;
508: END IF;
512: -- if ship to site info is null then
513: -- default to primary ship to of shipto_cust_account_id if not a source deduction
514: -- end if
515: -- Added the souce_object_class check for 6338281
516: IF (l_claim.cust_shipto_acct_site_id is null OR l_claim.cust_shipto_acct_site_id = FND_API.G_MISS_NUM)
517: AND (l_claim.SOURCE_OBJECT_ID IS NULL OR l_claim.SOURCE_OBJECT_ID = FND_API.G_MISS_NUM OR
518: l_claim.SOURCE_OBJECT_CLASS IN ('BATCH','SOFT_FUND','SPECIAL_PRICE')) THEN
519: OPEN cust_shipinfo_csr (l_claim.ship_to_cust_account_id);
520: FETCH cust_shipinfo_csr INTO l_claim.cust_shipto_acct_site_id;
513: -- default to primary ship to of shipto_cust_account_id if not a source deduction
514: -- end if
515: -- Added the souce_object_class check for 6338281
516: IF (l_claim.cust_shipto_acct_site_id is null OR l_claim.cust_shipto_acct_site_id = FND_API.G_MISS_NUM)
517: AND (l_claim.SOURCE_OBJECT_ID IS NULL OR l_claim.SOURCE_OBJECT_ID = FND_API.G_MISS_NUM OR
518: l_claim.SOURCE_OBJECT_CLASS IN ('BATCH','SOFT_FUND','SPECIAL_PRICE')) THEN
519: OPEN cust_shipinfo_csr (l_claim.ship_to_cust_account_id);
520: FETCH cust_shipinfo_csr INTO l_claim.cust_shipto_acct_site_id;
521: CLOSE cust_shipinfo_csr;
521: CLOSE cust_shipinfo_csr;
522: END IF;
523:
524:
525: IF (l_claim.cust_shipto_acct_site_id is null OR l_claim.cust_shipto_acct_site_id = FND_API.G_MISS_NUM)
526: THEN
527: l_claim.ship_to_cust_account_id := NULL;
528: END IF;
529:
534: -- if still null then
535: -- default bill_to site based on the cust_account_id
536: -- end if;
537: IF (l_claim.cust_billto_acct_site_id is null OR
538: l_claim.cust_billto_acct_site_id = FND_API.G_MISS_NUM) THEN
539: IF l_claim.cust_shipto_acct_site_id IS NOT NULL AND l_claim.ship_to_cust_account_id = l_claim.cust_account_id THEN
540: OPEN bill_to_bsd_ship_to_csr (l_claim.cust_shipto_acct_site_id);
541: FETCH bill_to_bsd_ship_to_csr INTO l_claim.cust_billto_acct_site_id;
542: CLOSE bill_to_bsd_ship_to_csr;
553: -- elsif bill_to site is not null
554: -- default salesrep_id based on the bill_to site
555: -- end if;
556: IF (l_claim.sales_rep_id is null OR
557: l_claim.sales_rep_id = FND_API.G_MISS_NUM) THEN
558:
559: -- If this is a deduction, we will try to get the salesrep_id from the transaction.
560: -- If we can't, we will try to default it based on shipto, billto and cust_acct_id.
561: --//Bug Fix: 7378832
560: -- If we can't, we will try to default it based on shipto, billto and cust_acct_id.
561: --//Bug Fix: 7378832
562: IF l_claim.SOURCE_OBJECT_CLASS IN ('INVOICE','DM') THEN
563: IF (l_claim.SOURCE_OBJECT_ID is not NULL AND
564: l_claim.SOURCE_OBJECT_ID <> FND_API.G_MISS_NUM) THEN
565: OPEN PRM_SALES_REP_CSR (l_claim.source_object_id);
566: FETCH PRM_SALES_REP_CSR INTO l_claim.sales_rep_id;
567: CLOSE PRM_SALES_REP_CSR;
568: END IF;
569: END IF;
570:
571: IF (l_claim.sales_rep_id is null) THEN
572: IF l_claim.cust_shipto_acct_site_id is not null AND
573: l_claim.cust_shipto_acct_site_id <> FND_API.G_MISS_NUM AND
574: l_shipto_cust_account_id is not null AND
575: l_shipto_cust_account_id = l_claim.cust_account_id THEN
576:
577: OPEN salesrep_csr(l_claim.cust_shipto_acct_site_id);
581:
582: -- Try billto_acct_site_id if salesrep id is still null
583: IF (l_claim.sales_rep_id is null AND
584: l_claim.cust_billto_acct_site_id is not null AND
585: l_claim.cust_billto_acct_site_id <> FND_API.G_MISS_NUM) THEN
586:
587: OPEN salesrep_csr(l_claim.cust_billto_acct_site_id);
588: FETCH salesrep_csr INTO l_claim.sales_rep_id;
589: CLOSE salesrep_csr;
595: -- if pseudo_contact_id is not null
596: -- default contact_id based on pseudo_contact_id and cust_account_id
597: -- end if;
598: IF (l_claim.CONTACT_ID is null OR
599: l_claim.contact_id = FND_API.G_MISS_NUM) THEN
600:
601: -- If this is a deduction, we will try to get the salesrep_id from the transaction.
602: -- If we can't, we will try to default it based on shipto, billto and cust_acct_id.
603: IF (l_claim.SOURCE_OBJECT_ID is not NULL AND
600:
601: -- If this is a deduction, we will try to get the salesrep_id from the transaction.
602: -- If we can't, we will try to default it based on shipto, billto and cust_acct_id.
603: IF (l_claim.SOURCE_OBJECT_ID is not NULL AND
604: l_claim.SOURCE_OBJECT_ID <> FND_API.G_MISS_NUM) THEN
605: OPEN billto_contact_CSR (l_claim.source_object_id);
606: FETCH billto_contact_CSR INTO l_contact_id;
607: CLOSE billto_contact_CSR;
608:
622: END IF;
623:
624: x_claim := l_claim;
625: EXCEPTION
626: WHEN FND_API.G_EXC_ERROR THEN
627: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
628: WHEN OTHERS THEN
629: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
630: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
623:
624: x_claim := l_claim;
625: EXCEPTION
626: WHEN FND_API.G_EXC_ERROR THEN
627: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
628: WHEN OTHERS THEN
629: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
630: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
631: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_CUSTOMER_INFO_ERR');
625: EXCEPTION
626: WHEN FND_API.G_EXC_ERROR THEN
627: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
628: WHEN OTHERS THEN
629: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
630: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
631: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_CUSTOMER_INFO_ERR');
632: FND_MSG_PUB.add;
633: END IF;
664: l_days_due number;
665: BEGIN
666:
667: -- Initialize API return status to sucess
668: x_return_status := FND_API.G_RET_STS_SUCCESS;
669:
670: -- get customer info from trade profile
671: OPEN days_due_csr(p_cust_accout_id);
672: FETCH days_due_csr into l_days_due;
682: END IF;
683: END IF;
684: x_days_due:= l_days_due;
685: EXCEPTION
686: WHEN FND_API.G_EXC_ERROR THEN
687: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
688: WHEN OTHERS THEN
689: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
690: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
683: END IF;
684: x_days_due:= l_days_due;
685: EXCEPTION
686: WHEN FND_API.G_EXC_ERROR THEN
687: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
688: WHEN OTHERS THEN
689: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
690: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
691: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_DAYS_DUE_ERR');
685: EXCEPTION
686: WHEN FND_API.G_EXC_ERROR THEN
687: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
688: WHEN OTHERS THEN
689: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
690: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
691: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_DAYS_DUE_ERR');
692: FND_MSG_PUB.add;
693: END IF;
805: WHERE location_id = p_location_id;
806:
807: BEGIN
808: -- Initialize API return status to sucess
809: x_return_status := FND_API.G_RET_STS_SUCCESS;
810:
811: -- get account_code
812: IF p_shipto_site_id is not null THEN
813: OPEN account_code_csr(p_shipto_site_id);
917: x_account_classification := l_account_classification;
918: x_account_hierarchy := l_account_hierarchy;
919:
920: EXCEPTION
921: WHEN FND_API.G_EXC_ERROR THEN
922: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
923: WHEN OTHERS THEN
924: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
925: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
918: x_account_hierarchy := l_account_hierarchy;
919:
920: EXCEPTION
921: WHEN FND_API.G_EXC_ERROR THEN
922: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
923: WHEN OTHERS THEN
924: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
925: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
926: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_OFF_QUAL_ERR');
920: EXCEPTION
921: WHEN FND_API.G_EXC_ERROR THEN
922: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
923: WHEN OTHERS THEN
924: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
925: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
926: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_OFF_QUAL_ERR');
927: FND_MSG_PUB.add;
928: END IF;
1007: l_access_list_index number;
1008: BEGIN
1009:
1010: -- Initialize API return status to sucess
1011: x_return_status := FND_API.G_RET_STS_SUCCESS;
1012:
1013: x_owner_id := null;
1014:
1015: get_offer_qualifiers(
1032: x_account_classification => l_account_classification,
1033: x_account_hierarchy => l_account_hierarchy,
1034: x_return_status => x_return_status
1035: );
1036: IF x_return_status = FND_API.g_ret_sts_error THEN
1037: RAISE FND_API.g_exc_error;
1038: ELSIF x_return_status = FND_API.g_ret_sts_unexp_error THEN
1039: RAISE FND_API.g_exc_error;
1040: END IF;
1033: x_account_hierarchy => l_account_hierarchy,
1034: x_return_status => x_return_status
1035: );
1036: IF x_return_status = FND_API.g_ret_sts_error THEN
1037: RAISE FND_API.g_exc_error;
1038: ELSIF x_return_status = FND_API.g_ret_sts_unexp_error THEN
1039: RAISE FND_API.g_exc_error;
1040: END IF;
1041:
1034: x_return_status => x_return_status
1035: );
1036: IF x_return_status = FND_API.g_ret_sts_error THEN
1037: RAISE FND_API.g_exc_error;
1038: ELSIF x_return_status = FND_API.g_ret_sts_unexp_error THEN
1039: RAISE FND_API.g_exc_error;
1040: END IF;
1041:
1042: -- bulk_trans_rec_type instantiation
1035: );
1036: IF x_return_status = FND_API.g_ret_sts_error THEN
1037: RAISE FND_API.g_exc_error;
1038: ELSIF x_return_status = FND_API.g_ret_sts_unexp_error THEN
1039: RAISE FND_API.g_exc_error;
1040: END IF;
1041:
1042: -- bulk_trans_rec_type instantiation
1043: -- logic control properties
1255: -- source_id : TM :-1003
1256: -- trasns_id : -1007 : offer, -1302: claim
1257: JTF_TERR_ASSIGN_PUB.get_winners
1258: ( p_api_version_number => 1.0,
1259: p_init_msg_list => FND_API.G_FALSE,
1260:
1261: p_use_type => l_use_type,
1262: p_source_id => -1003,
1263: p_trans_id => -1302,
1262: p_source_id => -1003,
1263: p_trans_id => -1302,
1264: p_trans_rec => lp_gen_bulk_rec,
1265:
1266: p_resource_type => FND_API.G_MISS_CHAR,
1267: p_role => FND_API.G_MISS_CHAR,
1268: p_top_level_terr_id => FND_API.G_MISS_NUM,
1269: p_num_winners => FND_API.G_MISS_NUM,
1270:
1263: p_trans_id => -1302,
1264: p_trans_rec => lp_gen_bulk_rec,
1265:
1266: p_resource_type => FND_API.G_MISS_CHAR,
1267: p_role => FND_API.G_MISS_CHAR,
1268: p_top_level_terr_id => FND_API.G_MISS_NUM,
1269: p_num_winners => FND_API.G_MISS_NUM,
1270:
1271: x_return_status => l_return_status,
1264: p_trans_rec => lp_gen_bulk_rec,
1265:
1266: p_resource_type => FND_API.G_MISS_CHAR,
1267: p_role => FND_API.G_MISS_CHAR,
1268: p_top_level_terr_id => FND_API.G_MISS_NUM,
1269: p_num_winners => FND_API.G_MISS_NUM,
1270:
1271: x_return_status => l_return_status,
1272: x_msg_count => l_msg_count,
1265:
1266: p_resource_type => FND_API.G_MISS_CHAR,
1267: p_role => FND_API.G_MISS_CHAR,
1268: p_top_level_terr_id => FND_API.G_MISS_NUM,
1269: p_num_winners => FND_API.G_MISS_NUM,
1270:
1271: x_return_status => l_return_status,
1272: x_msg_count => l_msg_count,
1273: x_msg_data => l_msg_data,
1272: x_msg_count => l_msg_count,
1273: x_msg_data => l_msg_data,
1274: x_winners_rec => l_gen_return_rec
1275: );
1276: IF l_return_status = FND_API.g_ret_sts_error THEN
1277: RAISE FND_API.g_exc_error;
1278: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1279: RAISE FND_API.g_exc_unexpected_error;
1280: END IF;
1273: x_msg_data => l_msg_data,
1274: x_winners_rec => l_gen_return_rec
1275: );
1276: IF l_return_status = FND_API.g_ret_sts_error THEN
1277: RAISE FND_API.g_exc_error;
1278: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1279: RAISE FND_API.g_exc_unexpected_error;
1280: END IF;
1281:
1274: x_winners_rec => l_gen_return_rec
1275: );
1276: IF l_return_status = FND_API.g_ret_sts_error THEN
1277: RAISE FND_API.g_exc_error;
1278: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1279: RAISE FND_API.g_exc_unexpected_error;
1280: END IF;
1281:
1282: IF OZF_DEBUG_HIGH_ON THEN
1275: );
1276: IF l_return_status = FND_API.g_ret_sts_error THEN
1277: RAISE FND_API.g_exc_error;
1278: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1279: RAISE FND_API.g_exc_unexpected_error;
1280: END IF;
1281:
1282: IF OZF_DEBUG_HIGH_ON THEN
1283: ozf_utility_PVT.debug_message('winner count:' || l_gen_return_Rec.terr_id.count );
1401: END IF;
1402: x_access_list := l_access_list;
1403:
1404: EXCEPTION
1405: WHEN FND_API.G_EXC_ERROR THEN
1406: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1407: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1408: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1409: WHEN OTHERS THEN
1402: x_access_list := l_access_list;
1403:
1404: EXCEPTION
1405: WHEN FND_API.G_EXC_ERROR THEN
1406: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1407: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1408: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1409: WHEN OTHERS THEN
1410: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1403:
1404: EXCEPTION
1405: WHEN FND_API.G_EXC_ERROR THEN
1406: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1407: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1408: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1409: WHEN OTHERS THEN
1410: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1411: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,'Get_owner');
1404: EXCEPTION
1405: WHEN FND_API.G_EXC_ERROR THEN
1406: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1407: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1408: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1409: WHEN OTHERS THEN
1410: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1411: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,'Get_owner');
1412: END IF;
1409: WHEN OTHERS THEN
1410: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1411: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,'Get_owner');
1412: END IF;
1413: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1414: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1415: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_GET_OWNER_ERR');
1416: FND_MSG_PUB.add;
1417: END IF;
1456: WHERE task_id = p_task_id;
1457:
1458: BEGIN
1459: -- Initialize API return status to sucess
1460: x_return_status := FND_API.G_RET_STS_SUCCESS;
1461:
1462: IF OZF_DEBUG_LOW_ON THEN
1463: FND_MESSAGE.Set_Name('OZF','OZF_API_DEBUG_MESSAGE');
1464: FND_MESSAGE.Set_Token('TEXT','create task from template');
1467:
1468: -- Generate taks template
1469: JTF_TASKS_PUB.create_task_from_template(
1470: p_api_version => l_api_version
1471: ,p_init_msg_list => FND_API.g_false
1472: ,p_commit => FND_API.g_false
1473: ,x_return_status => l_return_status
1474: ,x_msg_count => l_msg_count
1475: ,x_msg_data => l_msg_data
1468: -- Generate taks template
1469: JTF_TASKS_PUB.create_task_from_template(
1470: p_api_version => l_api_version
1471: ,p_init_msg_list => FND_API.g_false
1472: ,p_commit => FND_API.g_false
1473: ,x_return_status => l_return_status
1474: ,x_msg_count => l_msg_count
1475: ,x_msg_data => l_msg_data
1476: ,p_task_template_group_id => p_task_template_group_id
1479: ,p_source_object_id => l_claim_id
1480: ,p_source_object_name=> p_claim_number
1481: ,x_task_details_tbl => l_task_details_tbl
1482: );
1483: IF l_return_status = FND_API.G_RET_STS_SUCCESS THEN
1484: -- Generate tasks
1485: FOR i in 1..l_task_details_tbl.count LOOP
1486:
1487: OPEN task_status_csr(l_task_details_tbl(i).task_id);
1504: x_msg_count => l_msg_count ,
1505: x_msg_data => l_msg_data,
1506: X_TASK_ASSIGNMENT_ID => l_task_assignment_id
1507: );
1508: IF l_return_status = FND_API.g_ret_sts_error THEN
1509: RAISE FND_API.g_exc_error;
1510: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1511: RAISE FND_API.g_exc_unexpected_error;
1512: END IF;
1505: x_msg_data => l_msg_data,
1506: X_TASK_ASSIGNMENT_ID => l_task_assignment_id
1507: );
1508: IF l_return_status = FND_API.g_ret_sts_error THEN
1509: RAISE FND_API.g_exc_error;
1510: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1511: RAISE FND_API.g_exc_unexpected_error;
1512: END IF;
1513:
1506: X_TASK_ASSIGNMENT_ID => l_task_assignment_id
1507: );
1508: IF l_return_status = FND_API.g_ret_sts_error THEN
1509: RAISE FND_API.g_exc_error;
1510: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1511: RAISE FND_API.g_exc_unexpected_error;
1512: END IF;
1513:
1514: END LOOP;
1507: );
1508: IF l_return_status = FND_API.g_ret_sts_error THEN
1509: RAISE FND_API.g_exc_error;
1510: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1511: RAISE FND_API.g_exc_unexpected_error;
1512: END IF;
1513:
1514: END LOOP;
1515: ELSIF l_return_status = FND_API.g_ret_sts_error THEN
1511: RAISE FND_API.g_exc_unexpected_error;
1512: END IF;
1513:
1514: END LOOP;
1515: ELSIF l_return_status = FND_API.g_ret_sts_error THEN
1516: RAISE FND_API.g_exc_error;
1517: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1518: RAISE FND_API.g_exc_unexpected_error;
1519: END IF;
1512: END IF;
1513:
1514: END LOOP;
1515: ELSIF l_return_status = FND_API.g_ret_sts_error THEN
1516: RAISE FND_API.g_exc_error;
1517: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1518: RAISE FND_API.g_exc_unexpected_error;
1519: END IF;
1520: EXCEPTION
1513:
1514: END LOOP;
1515: ELSIF l_return_status = FND_API.g_ret_sts_error THEN
1516: RAISE FND_API.g_exc_error;
1517: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1518: RAISE FND_API.g_exc_unexpected_error;
1519: END IF;
1520: EXCEPTION
1521: WHEN FND_API.G_EXC_ERROR THEN
1514: END LOOP;
1515: ELSIF l_return_status = FND_API.g_ret_sts_error THEN
1516: RAISE FND_API.g_exc_error;
1517: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1518: RAISE FND_API.g_exc_unexpected_error;
1519: END IF;
1520: EXCEPTION
1521: WHEN FND_API.G_EXC_ERROR THEN
1522: x_return_status := FND_API.G_RET_STS_ERROR;
1517: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1518: RAISE FND_API.g_exc_unexpected_error;
1519: END IF;
1520: EXCEPTION
1521: WHEN FND_API.G_EXC_ERROR THEN
1522: x_return_status := FND_API.G_RET_STS_ERROR;
1523: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1524: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1525: WHEN OTHERS THEN
1518: RAISE FND_API.g_exc_unexpected_error;
1519: END IF;
1520: EXCEPTION
1521: WHEN FND_API.G_EXC_ERROR THEN
1522: x_return_status := FND_API.G_RET_STS_ERROR;
1523: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1524: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1525: WHEN OTHERS THEN
1526: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1519: END IF;
1520: EXCEPTION
1521: WHEN FND_API.G_EXC_ERROR THEN
1522: x_return_status := FND_API.G_RET_STS_ERROR;
1523: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1524: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1525: WHEN OTHERS THEN
1526: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1527: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
1520: EXCEPTION
1521: WHEN FND_API.G_EXC_ERROR THEN
1522: x_return_status := FND_API.G_RET_STS_ERROR;
1523: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1524: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1525: WHEN OTHERS THEN
1526: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1527: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
1528: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_TASK_API_ERR');
1522: x_return_status := FND_API.G_RET_STS_ERROR;
1523: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1524: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1525: WHEN OTHERS THEN
1526: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1527: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
1528: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_TASK_API_ERR');
1529: FND_MSG_PUB.add;
1530: END IF;
1605: WHERE org_id = MO_GLOBAL.GET_CURRENT_ORG_ID();
1606:
1607: BEGIN
1608:
1609: x_return_status := FND_API.G_RET_STS_SUCCESS;
1610:
1611: IF (l_cust_account_id IS NOT NULL)
1612: OR (l_cust_account_id <> FND_API.G_MISS_NUM)
1613: THEN
1608:
1609: x_return_status := FND_API.G_RET_STS_SUCCESS;
1610:
1611: IF (l_cust_account_id IS NOT NULL)
1612: OR (l_cust_account_id <> FND_API.G_MISS_NUM)
1613: THEN
1614: --Get the thresholds from customer trade profile based on account id
1615: OPEN get_cst_trd_prfl_wo_thr_csr(l_cust_account_id);
1616: FETCH get_cst_trd_prfl_wo_thr_csr
1617: INTO l_ded_pos_write_off_threshold, l_opy_neg_write_off_threshold;
1618: CLOSE get_cst_trd_prfl_wo_thr_csr;
1619:
1620: --START 1
1621: IF (l_ded_pos_write_off_threshold IS NULL OR l_ded_pos_write_off_threshold = FND_API.G_MISS_NUM)
1622: AND(l_opy_neg_write_off_threshold IS NULL OR l_opy_neg_write_off_threshold = FND_API.G_MISS_NUM)
1623: THEN
1624:
1625: --Get the customers party_id
1618: CLOSE get_cst_trd_prfl_wo_thr_csr;
1619:
1620: --START 1
1621: IF (l_ded_pos_write_off_threshold IS NULL OR l_ded_pos_write_off_threshold = FND_API.G_MISS_NUM)
1622: AND(l_opy_neg_write_off_threshold IS NULL OR l_opy_neg_write_off_threshold = FND_API.G_MISS_NUM)
1623: THEN
1624:
1625: --Get the customers party_id
1626: OPEN get_party_id_csr(l_cust_account_id);
1626: OPEN get_party_id_csr(l_cust_account_id);
1627: FETCH get_party_id_csr INTO l_party_id;
1628: CLOSE get_party_id_csr;
1629:
1630: IF (l_party_id IS NOT NULL AND l_party_id <> FND_API.G_MISS_NUM)
1631: THEN
1632: --Get the thresholds from customer trade profile based on party id
1633: OPEN get_prt_trd_prfl_wo_thr_csr(l_party_id);
1634: FETCH get_prt_trd_prfl_wo_thr_csr
1634: FETCH get_prt_trd_prfl_wo_thr_csr
1635: INTO l_ded_pos_write_off_threshold, l_opy_neg_write_off_threshold;
1636: CLOSE get_prt_trd_prfl_wo_thr_csr;
1637:
1638: IF (l_ded_pos_write_off_threshold IS NULL OR l_ded_pos_write_off_threshold = FND_API.G_MISS_NUM)
1639: AND(l_opy_neg_write_off_threshold IS NULL OR l_opy_neg_write_off_threshold = FND_API.G_MISS_NUM)
1640: THEN
1641: --if the thresholds are null then get from the system paramters.
1642: l_get_thr_frm_sysparam := true;
1635: INTO l_ded_pos_write_off_threshold, l_opy_neg_write_off_threshold;
1636: CLOSE get_prt_trd_prfl_wo_thr_csr;
1637:
1638: IF (l_ded_pos_write_off_threshold IS NULL OR l_ded_pos_write_off_threshold = FND_API.G_MISS_NUM)
1639: AND(l_opy_neg_write_off_threshold IS NULL OR l_opy_neg_write_off_threshold = FND_API.G_MISS_NUM)
1640: THEN
1641: --if the thresholds are null then get from the system paramters.
1642: l_get_thr_frm_sysparam := true;
1643: END IF;
1667: x_ded_pos_write_off_threshold := l_ded_pos_write_off_threshold;
1668: x_opy_neg_write_off_threshold := l_opy_neg_write_off_threshold;
1669:
1670: EXCEPTION
1671: WHEN FND_API.G_EXC_ERROR THEN
1672: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1673: WHEN OTHERS THEN
1674: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1675: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1668: x_opy_neg_write_off_threshold := l_opy_neg_write_off_threshold;
1669:
1670: EXCEPTION
1671: WHEN FND_API.G_EXC_ERROR THEN
1672: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1673: WHEN OTHERS THEN
1674: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1675: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1676: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_WO_THRESHOLD_ERROR');
1670: EXCEPTION
1671: WHEN FND_API.G_EXC_ERROR THEN
1672: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1673: WHEN OTHERS THEN
1674: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1675: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1676: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_WO_THRESHOLD_ERROR');
1677: FND_MSG_PUB.ADD;
1678: END IF;
1745: WHERE org_id = MO_GLOBAL.GET_CURRENT_ORG_ID();
1746:
1747: BEGIN
1748:
1749: x_return_status := FND_API.G_RET_STS_SUCCESS;
1750:
1751: --Get the write-off thresholds
1752: get_write_off_threshold( p_cust_account_id => l_cust_account_id
1753: , x_ded_pos_write_off_threshold => l_ded_pos_threshold_amount
1754: , x_opy_neg_write_off_threshold => l_opy_neg_threshold_amount
1755: , x_return_status => l_return_status
1756: );
1757:
1758: IF (l_return_status = FND_API.G_RET_STS_ERROR) THEN
1759: RAISE FND_API.g_exc_error;
1760: ELSIF (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1761: RAISE FND_API.g_exc_unexpected_error;
1762: END IF;
1755: , x_return_status => l_return_status
1756: );
1757:
1758: IF (l_return_status = FND_API.G_RET_STS_ERROR) THEN
1759: RAISE FND_API.g_exc_error;
1760: ELSIF (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1761: RAISE FND_API.g_exc_unexpected_error;
1762: END IF;
1763:
1756: );
1757:
1758: IF (l_return_status = FND_API.G_RET_STS_ERROR) THEN
1759: RAISE FND_API.g_exc_error;
1760: ELSIF (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1761: RAISE FND_API.g_exc_unexpected_error;
1762: END IF;
1763:
1764: --Get the functional currency code
1757:
1758: IF (l_return_status = FND_API.G_RET_STS_ERROR) THEN
1759: RAISE FND_API.g_exc_error;
1760: ELSIF (l_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
1761: RAISE FND_API.g_exc_unexpected_error;
1762: END IF;
1763:
1764: --Get the functional currency code
1765: OPEN gp_func_currency_cd_csr;
1768:
1769: --Default the transaction currency code to functional currency
1770: -- if the transaction currency code is null
1771: IF (l_currency_code IS NULL
1772: OR l_currency_code = FND_API.G_MISS_CHAR) THEN
1773: l_currency_code := l_functional_currency_code;
1774: END IF;
1775:
1776: --If the transaction currency code is different from the functional currency code
1776: --If the transaction currency code is different from the functional currency code
1777: -- ensure that the exchange type is not null.
1778: IF (l_currency_code <> l_functional_currency_code) THEN
1779: IF (l_exchange_rate_type IS NULL
1780: OR l_exchange_rate_type = FND_API.G_MISS_CHAR) THEN
1781: --Get the default exchange rate type
1782: OPEN get_exchange_rate_type_csr;
1783: FETCH get_exchange_rate_type_csr INTO l_exchange_rate_type;
1784: CLOSE get_exchange_rate_type_csr;
1785:
1786:
1787: --If the exchange rate type is null then raise an error
1788: IF (l_exchange_rate_type IS NULL
1789: OR l_exchange_rate_type = FND_API.G_MISS_CHAR) THEN
1790: IF FND_MSG_PUB.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1791: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_CONTYPE_MISSING');
1792: FND_MSG_PUB.add;
1793: END IF;
1790: IF FND_MSG_PUB.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
1791: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_CONTYPE_MISSING');
1792: FND_MSG_PUB.add;
1793: END IF;
1794: RAISE FND_API.G_EXC_ERROR;
1795: END IF;
1796: END IF;
1797:
1798: --Check the exchange rate date.
1796: END IF;
1797:
1798: --Check the exchange rate date.
1799: IF (l_exchange_rate_date IS NULL
1800: OR l_exchange_rate_date = FND_API.G_MISS_DATE) THEN
1801: l_exchange_rate_date := SYSDATE;
1802: END IF;
1803:
1804: IF OZF_DEBUG_HIGH_ON THEN
1817: P_AMOUNT => l_amount,
1818: X_RETURN_STATUS => l_return_status,
1819: X_ACC_AMOUNT => l_acc_amount,
1820: X_RATE => l_rate);
1821: IF (l_return_status = FND_API.g_ret_sts_error) THEN
1822: RAISE FND_API.g_exc_error;
1823: ELSIF (l_return_status = FND_API.g_ret_sts_unexp_error) THEN
1824: RAISE FND_API.g_exc_unexpected_error;
1825: END IF;
1818: X_RETURN_STATUS => l_return_status,
1819: X_ACC_AMOUNT => l_acc_amount,
1820: X_RATE => l_rate);
1821: IF (l_return_status = FND_API.g_ret_sts_error) THEN
1822: RAISE FND_API.g_exc_error;
1823: ELSIF (l_return_status = FND_API.g_ret_sts_unexp_error) THEN
1824: RAISE FND_API.g_exc_unexpected_error;
1825: END IF;
1826:
1819: X_ACC_AMOUNT => l_acc_amount,
1820: X_RATE => l_rate);
1821: IF (l_return_status = FND_API.g_ret_sts_error) THEN
1822: RAISE FND_API.g_exc_error;
1823: ELSIF (l_return_status = FND_API.g_ret_sts_unexp_error) THEN
1824: RAISE FND_API.g_exc_unexpected_error;
1825: END IF;
1826:
1827: l_exchange_rate := l_rate;
1820: X_RATE => l_rate);
1821: IF (l_return_status = FND_API.g_ret_sts_error) THEN
1822: RAISE FND_API.g_exc_error;
1823: ELSIF (l_return_status = FND_API.g_ret_sts_unexp_error) THEN
1824: RAISE FND_API.g_exc_unexpected_error;
1825: END IF;
1826:
1827: l_exchange_rate := l_rate;
1828: l_acctd_amount := l_acc_amount;
1881: px_acctd_amount_remaining := l_acctd_amount_remaining;
1882:
1883:
1884: EXCEPTION
1885: WHEN FND_API.G_EXC_ERROR THEN
1886: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1887: WHEN OTHERS THEN
1888: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1889: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1882:
1883:
1884: EXCEPTION
1885: WHEN FND_API.G_EXC_ERROR THEN
1886: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1887: WHEN OTHERS THEN
1888: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1889: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1890: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_WRITE_OFF_SETUP_ERR');
1884: EXCEPTION
1885: WHEN FND_API.G_EXC_ERROR THEN
1886: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1887: WHEN OTHERS THEN
1888: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1889: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1890: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_WRITE_OFF_SETUP_ERR');
1891: FND_MSG_PUB.add;
1892: END IF;
1941: WHERE h.cust_account_id = p_cust_id;
1942:
1943: BEGIN
1944:
1945: x_return_status := FND_API.g_ret_sts_success;
1946:
1947: OPEN c_party_id(l_cust_account_id);
1948: FETCH c_party_id INTO l_party_id;
1949: CLOSE c_party_id;
1947: OPEN c_party_id(l_cust_account_id);
1948: FETCH c_party_id INTO l_party_id;
1949: CLOSE c_party_id;
1950:
1951: IF (l_customer_reason is not NULL or l_customer_reason <> FND_API.G_MISS_CHAR) AND
1952: (l_reason_code_id is NULL or l_reason_code_id = FND_API.G_MISS_NUM) THEN
1953: -- ----------------------------------------------------------------------------
1954: -- Call OZF_CODE_CONVERSION_PVT.convert_code.
1955: -- ----------------------------------------------------------------------------
1948: FETCH c_party_id INTO l_party_id;
1949: CLOSE c_party_id;
1950:
1951: IF (l_customer_reason is not NULL or l_customer_reason <> FND_API.G_MISS_CHAR) AND
1952: (l_reason_code_id is NULL or l_reason_code_id = FND_API.G_MISS_NUM) THEN
1953: -- ----------------------------------------------------------------------------
1954: -- Call OZF_CODE_CONVERSION_PVT.convert_code.
1955: -- ----------------------------------------------------------------------------
1956: OZF_CODE_CONVERSION_PVT.convert_code(
1962: X_Return_Status => l_return_status,
1963: X_Msg_Count => l_msg_count,
1964: X_Msg_Data => l_msg_data );
1965:
1966: IF l_return_status = FND_API.g_ret_sts_error THEN
1967: RAISE FND_API.g_exc_error;
1968: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1969: RAISE FND_API.g_exc_unexpected_error;
1970: END IF;
1963: X_Msg_Count => l_msg_count,
1964: X_Msg_Data => l_msg_data );
1965:
1966: IF l_return_status = FND_API.g_ret_sts_error THEN
1967: RAISE FND_API.g_exc_error;
1968: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1969: RAISE FND_API.g_exc_unexpected_error;
1970: END IF;
1971:
1964: X_Msg_Data => l_msg_data );
1965:
1966: IF l_return_status = FND_API.g_ret_sts_error THEN
1967: RAISE FND_API.g_exc_error;
1968: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1969: RAISE FND_API.g_exc_unexpected_error;
1970: END IF;
1971:
1972: IF l_internal_code is not null THEN
1965:
1966: IF l_return_status = FND_API.g_ret_sts_error THEN
1967: RAISE FND_API.g_exc_error;
1968: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
1969: RAISE FND_API.g_exc_unexpected_error;
1970: END IF;
1971:
1972: IF l_internal_code is not null THEN
1973: l_claim_reason_code_id := to_number(l_internal_code);
1981: THEN
1982: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_NO_REASON_MAPPING');
1983: FND_MSG_PUB.add;
1984: END IF;
1985: RAISE FND_API.G_EXC_ERROR;
1986: END IF;
1987: END IF;
1988:
1989: px_reason_code_id := l_reason_code_id;
1987: END IF;
1988:
1989: px_reason_code_id := l_reason_code_id;
1990: EXCEPTION
1991: WHEN FND_API.G_EXC_ERROR THEN
1992: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1993: WHEN OTHERS THEN
1994: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1995: END Get_Customer_Reason;
1988:
1989: px_reason_code_id := l_reason_code_id;
1990: EXCEPTION
1991: WHEN FND_API.G_EXC_ERROR THEN
1992: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1993: WHEN OTHERS THEN
1994: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1995: END Get_Customer_Reason;
1996:
1990: EXCEPTION
1991: WHEN FND_API.G_EXC_ERROR THEN
1992: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1993: WHEN OTHERS THEN
1994: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1995: END Get_Customer_Reason;
1996:
1997:
1998: ---------------------------------------------------------------------
2016: ---------------------------------------------------------------------
2017:
2018: PROCEDURE Create_Claim_Association(
2019: p_api_version IN NUMBER,
2020: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
2021: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2022: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
2023: p_claim_id IN NUMBER,
2024: p_offer_id IN NUMBER,
2017:
2018: PROCEDURE Create_Claim_Association(
2019: p_api_version IN NUMBER,
2020: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
2021: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2022: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
2023: p_claim_id IN NUMBER,
2024: p_offer_id IN NUMBER,
2025: p_claim_amt IN NUMBER,
2018: PROCEDURE Create_Claim_Association(
2019: p_api_version IN NUMBER,
2020: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
2021: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2022: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
2023: p_claim_id IN NUMBER,
2024: p_offer_id IN NUMBER,
2025: p_claim_amt IN NUMBER,
2026: p_claim_acc_amt IN NUMBER,
2070: BEGIN
2071:
2072:
2073: SAVEPOINT Create_Claim_Association;
2074: IF NOT FND_API.Compatible_API_Call (
2075: l_api_version,
2076: p_api_version,
2077: l_api_name,
2078: G_PKG_NAME)
2076: p_api_version,
2077: l_api_name,
2078: G_PKG_NAME)
2079: THEN
2080: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2081: END IF;
2082: -- Debug Message
2083: IF OZF_DEBUG_LOW_ON THEN
2084: FND_MESSAGE.Set_Name('OZF','OZF_API_DEBUG_MESSAGE');
2085: FND_MESSAGE.Set_Token('TEXT',l_api_name||': Start');
2086: FND_MSG_PUB.Add;
2087: END IF;
2088: --Initialize message list if p_init_msg_list is TRUE.
2089: IF FND_API.To_Boolean (p_init_msg_list) THEN
2090: FND_MSG_PUB.initialize;
2091: END IF;
2092:
2093: x_return_status := FND_API.G_RET_STS_SUCCESS;
2089: IF FND_API.To_Boolean (p_init_msg_list) THEN
2090: FND_MSG_PUB.initialize;
2091: END IF;
2092:
2093: x_return_status := FND_API.G_RET_STS_SUCCESS;
2094:
2095: IF OZF_DEBUG_HIGH_ON THEN
2096: OZF_Utility_PVT.debug_message('Start :' || l_api_name);
2097: END IF;
2114: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
2115: fnd_message.set_name('OZF', 'OZF_OFF_DIFF_CLAIM_CUSTOMER');
2116: fnd_msg_pub.add;
2117: END IF;
2118: RAISE fnd_api.g_exc_error;
2119: END IF;
2120:
2121: -- End of Fix for Bug#16301558
2122:
2130:
2131:
2132: OZF_CLAIM_LINE_PVT.Create_Claim_Line(
2133: p_api_version => l_api_version
2134: , p_init_msg_list => FND_API.g_false
2135: , p_commit => FND_API.g_false
2136: , p_validation_level => FND_API.g_valid_level_full
2137: , x_return_status => l_return_status
2138: , x_msg_data => l_msg_data
2131:
2132: OZF_CLAIM_LINE_PVT.Create_Claim_Line(
2133: p_api_version => l_api_version
2134: , p_init_msg_list => FND_API.g_false
2135: , p_commit => FND_API.g_false
2136: , p_validation_level => FND_API.g_valid_level_full
2137: , x_return_status => l_return_status
2138: , x_msg_data => l_msg_data
2139: , x_msg_count => l_msg_count
2132: OZF_CLAIM_LINE_PVT.Create_Claim_Line(
2133: p_api_version => l_api_version
2134: , p_init_msg_list => FND_API.g_false
2135: , p_commit => FND_API.g_false
2136: , p_validation_level => FND_API.g_valid_level_full
2137: , x_return_status => l_return_status
2138: , x_msg_data => l_msg_data
2139: , x_msg_count => l_msg_count
2140: , p_claim_line_rec => l_claim_line_rec
2141: , p_mode => OZF_CLAIM_UTILITY_PVT.g_auto_mode
2142: , x_claim_line_id => l_claim_line_id
2143: );
2144:
2145: IF l_return_status = FND_API.g_ret_sts_error THEN
2146: RAISE FND_API.g_exc_error;
2147: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
2148: RAISE FND_API.g_exc_error;
2149: END IF;
2142: , x_claim_line_id => l_claim_line_id
2143: );
2144:
2145: IF l_return_status = FND_API.g_ret_sts_error THEN
2146: RAISE FND_API.g_exc_error;
2147: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
2148: RAISE FND_API.g_exc_error;
2149: END IF;
2150:
2143: );
2144:
2145: IF l_return_status = FND_API.g_ret_sts_error THEN
2146: RAISE FND_API.g_exc_error;
2147: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
2148: RAISE FND_API.g_exc_error;
2149: END IF;
2150:
2151: IF OZF_DEBUG_HIGH_ON THEN
2144:
2145: IF l_return_status = FND_API.g_ret_sts_error THEN
2146: RAISE FND_API.g_exc_error;
2147: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
2148: RAISE FND_API.g_exc_error;
2149: END IF;
2150:
2151: IF OZF_DEBUG_HIGH_ON THEN
2152: OZF_Utility_PVT.debug_message('Claim lines created l_claim_line_id =' || l_claim_line_id);
2167: , l_funds_util_flt.total_amount;
2168:
2169: OZF_CLAIM_ACCRUAL_PVT.Update_Group_Line_Util(
2170: p_api_version => l_api_version
2171: ,p_init_msg_list => FND_API.g_false
2172: ,p_commit => FND_API.g_false
2173: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2174: ,x_return_status => l_return_status
2175: ,x_msg_count => x_msg_count
2168:
2169: OZF_CLAIM_ACCRUAL_PVT.Update_Group_Line_Util(
2170: p_api_version => l_api_version
2171: ,p_init_msg_list => FND_API.g_false
2172: ,p_commit => FND_API.g_false
2173: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2174: ,x_return_status => l_return_status
2175: ,x_msg_count => x_msg_count
2176: ,x_msg_data => x_msg_data
2169: OZF_CLAIM_ACCRUAL_PVT.Update_Group_Line_Util(
2170: p_api_version => l_api_version
2171: ,p_init_msg_list => FND_API.g_false
2172: ,p_commit => FND_API.g_false
2173: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
2174: ,x_return_status => l_return_status
2175: ,x_msg_count => x_msg_count
2176: ,x_msg_data => x_msg_data
2177: ,p_summary_view => 'ACTIVITY'
2176: ,x_msg_data => x_msg_data
2177: ,p_summary_view => 'ACTIVITY'
2178: ,p_funds_util_flt => l_funds_util_flt
2179: );
2180: IF l_return_status = FND_API.g_ret_sts_error THEN
2181: RAISE FND_API.g_exc_error;
2182: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
2183: RAISE FND_API.g_exc_error;
2184: END IF;
2177: ,p_summary_view => 'ACTIVITY'
2178: ,p_funds_util_flt => l_funds_util_flt
2179: );
2180: IF l_return_status = FND_API.g_ret_sts_error THEN
2181: RAISE FND_API.g_exc_error;
2182: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
2183: RAISE FND_API.g_exc_error;
2184: END IF;
2185:
2178: ,p_funds_util_flt => l_funds_util_flt
2179: );
2180: IF l_return_status = FND_API.g_ret_sts_error THEN
2181: RAISE FND_API.g_exc_error;
2182: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
2183: RAISE FND_API.g_exc_error;
2184: END IF;
2185:
2186: CLOSE csr_claim_line;
2179: );
2180: IF l_return_status = FND_API.g_ret_sts_error THEN
2181: RAISE FND_API.g_exc_error;
2182: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
2183: RAISE FND_API.g_exc_error;
2184: END IF;
2185:
2186: CLOSE csr_claim_line;
2187:
2186: CLOSE csr_claim_line;
2187:
2188:
2189: EXCEPTION
2190: WHEN FND_API.G_EXC_ERROR THEN
2191: -- IF ( NOT G_UPDATE_CALLED ) THEN
2192: ROLLBACK TO Create_Claim_Association;
2193: -- END IF;
2194: x_return_status := FND_API.G_RET_STS_ERROR;
2190: WHEN FND_API.G_EXC_ERROR THEN
2191: -- IF ( NOT G_UPDATE_CALLED ) THEN
2192: ROLLBACK TO Create_Claim_Association;
2193: -- END IF;
2194: x_return_status := FND_API.G_RET_STS_ERROR;
2195: -- Standard call to get message count and if count=1, get the message
2196: FND_MSG_PUB.Count_And_Get (
2197: p_encoded => FND_API.G_FALSE,
2198: p_count => x_msg_count,
2193: -- END IF;
2194: x_return_status := FND_API.G_RET_STS_ERROR;
2195: -- Standard call to get message count and if count=1, get the message
2196: FND_MSG_PUB.Count_And_Get (
2197: p_encoded => FND_API.G_FALSE,
2198: p_count => x_msg_count,
2199: p_data => x_msg_data
2200: );
2201: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2197: p_encoded => FND_API.G_FALSE,
2198: p_count => x_msg_count,
2199: p_data => x_msg_data
2200: );
2201: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2202: -- IF ( NOT G_UPDATE_CALLED ) THEN
2203: ROLLBACK TO Create_Claim_Association;
2204: -- END IF;
2205: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2201: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2202: -- IF ( NOT G_UPDATE_CALLED ) THEN
2203: ROLLBACK TO Create_Claim_Association;
2204: -- END IF;
2205: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2206: -- Standard call to get message count and if count=1, get the message
2207: FND_MSG_PUB.Count_And_Get (
2208: p_encoded => FND_API.G_FALSE,
2209: p_count => x_msg_count,
2204: -- END IF;
2205: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2206: -- Standard call to get message count and if count=1, get the message
2207: FND_MSG_PUB.Count_And_Get (
2208: p_encoded => FND_API.G_FALSE,
2209: p_count => x_msg_count,
2210: p_data => x_msg_data
2211: );
2212: WHEN OTHERS THEN
2212: WHEN OTHERS THEN
2213: -- IF ( NOT G_UPDATE_CALLED ) THEN
2214: ROLLBACK TO Create_Claim_Association;
2215: -- END IF;
2216: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2217: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
2218: THEN
2219: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2220: END IF;
2219: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
2220: END IF;
2221: -- Standard call to get message count and if count=1, get the message
2222: FND_MSG_PUB.Count_And_Get (
2223: p_encoded => FND_API.G_FALSE,
2224: p_count => x_msg_count,
2225: p_data => x_msg_data
2226: );
2227: --
2273:
2274: BEGIN
2275:
2276: -- Initialize API return status to sucess
2277: x_return_status := FND_API.G_RET_STS_SUCCESS;
2278: x_pass := true;
2279:
2280: OPEN amount_csr(p_claim.claim_id);
2281: FETCH amount_csr into l_info;
2388: */
2389:
2390: EXCEPTION
2391: WHEN OTHERS THEN
2392: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2393: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
2394: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_AMOUNT_CHANGE_ERR');
2395: FND_MSG_PUB.add;
2396: END IF;
2435:
2436: l_count number:=0;
2437: BEGIN
2438: -- Initialize API return status to sucess
2439: x_return_status := FND_API.G_RET_STS_SUCCESS;
2440:
2441: IF ((p_claim_number is null) OR
2442: (p_claim_number = FND_API.G_MISS_CHAR)) THEN
2443: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
2438: -- Initialize API return status to sucess
2439: x_return_status := FND_API.G_RET_STS_SUCCESS;
2440:
2441: IF ((p_claim_number is null) OR
2442: (p_claim_number = FND_API.G_MISS_CHAR)) THEN
2443: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
2444: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_MISSING_CLAIM_NUM');
2445: FND_MSG_PUB.add;
2446: END IF;
2443: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
2444: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_MISSING_CLAIM_NUM');
2445: FND_MSG_PUB.add;
2446: END IF;
2447: x_return_status := FND_API.g_ret_sts_error;
2448: ELSE
2449: -- claim_id will never be not null at this point.
2450: -- so we first check whether this is a new claim or not.
2451: l_count := 0;
2465: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
2466: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_DUP_CLAIM_NUM_NEW');
2467: FND_MSG_PUB.add;
2468: END IF;
2469: x_return_status := FND_API.g_ret_sts_error;
2470: END IF;
2471: ELSE
2472: -- check claim_number for an old claim. Here claim_number and claim_id should match
2473: -- and claim_number should be unique.
2480: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
2481: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_ID_NUM_MISS');
2482: FND_MSG_PUB.add;
2483: END IF;
2484: x_return_status := FND_API.g_ret_sts_error;
2485: ELSE
2486: l_count := 0;
2487: OPEN get_claim_id_num_csr(p_claim_number);
2488: FETCH get_claim_id_num_csr INTO l_count;
2492: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
2493: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_DUP_CLAIM_NUM');
2494: FND_MSG_PUB.add;
2495: END IF;
2496: x_return_status := FND_API.g_ret_sts_error;
2497: END IF;
2498: END IF;
2499: END IF;
2500: END IF;
2504: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
2505: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_NUM_CHECK_ERROR');
2506: FND_MSG_PUB.add;
2507: END IF;
2508: x_return_status := FND_API.g_ret_sts_unexp_error;
2509: END check_claim_number;
2510:
2511: ---------------------------------------------------------------------
2512: -- PROCEDURE
2530: IS
2531: l_return_status varchar2(30);
2532: BEGIN
2533: -- Initialize API return status to sucess
2534: x_return_status := FND_API.G_RET_STS_SUCCESS;
2535:
2536: -- check for duplicate claim numbers
2537: check_claim_number(
2538: p_claim_id => p_claim_rec.claim_id,
2574: l_default_action_id number;
2575: BEGIN
2576:
2577: If (p_reason_code_id is not null and
2578: p_reason_code_id <> FND_API.G_MISS_NUM) THEN
2579: OPEN default_action_id_csr(p_reason_code_id);
2580: FETCH default_action_id_csr into l_default_action_id;
2581: CLOSE default_action_id_csr;
2582:
2621:
2622: BEGIN
2623:
2624: -- Initialize API return status to sucess
2625: x_return_status := FND_API.G_RET_STS_SUCCESS;
2626: x_pass := true;
2627:
2628: OPEN deduction_info_csr(p_claim.claim_id);
2629: FETCH deduction_info_csr into l_deduction_info;
2658: END IF;
2659:
2660: EXCEPTION
2661: WHEN OTHERS THEN
2662: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2663: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
2664: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_DED_CHK_ERR');
2665: FND_MSG_PUB.add;
2666: END IF;
2671: -- Complete_Claim_Rec
2672: --
2673: -- PURPOSE
2674: -- For Update_Claim, some attributes may be passed in as
2675: -- FND_API.g_miss_char/num/date if the user doesn't want to
2676: -- update those attributes. This procedure will replace the
2677: -- "g_miss" attributes with current database values.
2678: --
2679: -- PARAMETERS
2677: -- "g_miss" attributes with current database values.
2678: --
2679: -- PARAMETERS
2680: -- p_claim_rec : the record which may contain attributes as
2681: -- FND_API.g_miss_char/num/date
2682: -- x_complete_rec: the complete record after all "g_miss" items
2683: -- have been replaced by current database values
2684: ---------------------------------------------------------------------
2685: PROCEDURE Complete_Claim_Rec (
2696:
2697: BEGIN
2698:
2699: -- Initialize API return status to sucess
2700: x_return_status := FND_API.G_RET_STS_SUCCESS;
2701:
2702: x_complete_rec := p_claim_rec;
2703:
2704: OPEN c_claim(p_claim_rec.claim_id);
2708: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
2709: FND_MESSAGE.set_name('OZF','OZF_API_RECORD_NOT_FOUND');
2710: FND_MSG_PUB.add;
2711: END IF;
2712: RAISE FND_API.g_exc_error;
2713: END IF;
2714: CLOSE c_claim;
2715:
2716: IF p_claim_rec.claim_id = FND_API.G_MISS_NUM THEN
2712: RAISE FND_API.g_exc_error;
2713: END IF;
2714: CLOSE c_claim;
2715:
2716: IF p_claim_rec.claim_id = FND_API.G_MISS_NUM THEN
2717: x_complete_rec.claim_id := NULL;
2718: END IF;
2719: IF p_claim_rec.claim_id IS NULL THEN
2720: x_complete_rec.claim_id := l_claim_rec.claim_id;
2718: END IF;
2719: IF p_claim_rec.claim_id IS NULL THEN
2720: x_complete_rec.claim_id := l_claim_rec.claim_id;
2721: END IF;
2722: IF p_claim_rec.batch_id = FND_API.G_MISS_NUM THEN
2723: x_complete_rec.batch_id := NULL;
2724: END IF;
2725: IF p_claim_rec.batch_id IS NULL THEN
2726: x_complete_rec.batch_id := l_claim_rec.batch_id;
2724: END IF;
2725: IF p_claim_rec.batch_id IS NULL THEN
2726: x_complete_rec.batch_id := l_claim_rec.batch_id;
2727: END IF;
2728: IF p_claim_rec.claim_number = FND_API.G_MISS_CHAR THEN
2729: x_complete_rec.claim_number := NULL;
2730: END IF;
2731: IF p_claim_rec.claim_number IS NULL THEN
2732: x_complete_rec.claim_number := l_claim_rec.claim_number;
2730: END IF;
2731: IF p_claim_rec.claim_number IS NULL THEN
2732: x_complete_rec.claim_number := l_claim_rec.claim_number;
2733: END IF;
2734: IF p_claim_rec.claim_type_id = FND_API.G_MISS_NUM THEN
2735: x_complete_rec.claim_type_id := NULL;
2736: END IF;
2737: IF p_claim_rec.claim_type_id IS NULL THEN
2738: x_complete_rec.claim_type_id := l_claim_rec.claim_type_id;
2736: END IF;
2737: IF p_claim_rec.claim_type_id IS NULL THEN
2738: x_complete_rec.claim_type_id := l_claim_rec.claim_type_id;
2739: END IF;
2740: IF p_claim_rec.claim_class = FND_API.G_MISS_CHAR THEN
2741: x_complete_rec.claim_class := NULL;
2742: END IF;
2743: IF p_claim_rec.claim_class IS NULL THEN
2744: x_complete_rec.claim_class := l_claim_rec.claim_class;
2742: END IF;
2743: IF p_claim_rec.claim_class IS NULL THEN
2744: x_complete_rec.claim_class := l_claim_rec.claim_class;
2745: END IF;
2746: IF p_claim_rec.claim_date = FND_API.G_MISS_DATE THEN
2747: x_complete_rec.claim_date := NULL;
2748: END IF;
2749: IF p_claim_rec.claim_date IS NULL THEN
2750: x_complete_rec.claim_date := l_claim_rec.claim_date;
2748: END IF;
2749: IF p_claim_rec.claim_date IS NULL THEN
2750: x_complete_rec.claim_date := l_claim_rec.claim_date;
2751: END IF;
2752: IF p_claim_rec.due_date = FND_API.G_MISS_DATE THEN
2753: x_complete_rec.due_date := NULL;
2754: END IF;
2755: IF p_claim_rec.due_date IS NULL THEN
2756: x_complete_rec.due_date := l_claim_rec.due_date;
2754: END IF;
2755: IF p_claim_rec.due_date IS NULL THEN
2756: x_complete_rec.due_date := l_claim_rec.due_date;
2757: END IF;
2758: IF p_claim_rec.owner_id = FND_API.G_MISS_NUM THEN
2759: x_complete_rec.owner_id := NULL;
2760: END IF;
2761: IF p_claim_rec.owner_id IS NULL THEN
2762: x_complete_rec.owner_id := l_claim_rec.owner_id;
2760: END IF;
2761: IF p_claim_rec.owner_id IS NULL THEN
2762: x_complete_rec.owner_id := l_claim_rec.owner_id;
2763: END IF;
2764: IF p_claim_rec.history_event = FND_API.G_MISS_CHAR THEN
2765: x_complete_rec.history_event := NULL;
2766: END IF;
2767: IF p_claim_rec.history_event IS NULL THEN
2768: x_complete_rec.history_event := l_claim_rec.history_event;
2766: END IF;
2767: IF p_claim_rec.history_event IS NULL THEN
2768: x_complete_rec.history_event := l_claim_rec.history_event;
2769: END IF;
2770: IF p_claim_rec.history_event_date = FND_API.G_MISS_DATE THEN
2771: x_complete_rec.history_event_date := NULL;
2772: END IF;
2773: IF p_claim_rec.history_event_date IS NULL THEN
2774: x_complete_rec.history_event_date := l_claim_rec.history_event_date;
2772: END IF;
2773: IF p_claim_rec.history_event_date IS NULL THEN
2774: x_complete_rec.history_event_date := l_claim_rec.history_event_date;
2775: END IF;
2776: IF p_claim_rec.history_event_description = FND_API.G_MISS_CHAR THEN
2777: x_complete_rec.history_event_description := NULL;
2778: END IF;
2779: IF p_claim_rec.history_event_description IS NULL THEN
2780: x_complete_rec.history_event_description := l_claim_rec.history_event_description;
2778: END IF;
2779: IF p_claim_rec.history_event_description IS NULL THEN
2780: x_complete_rec.history_event_description := l_claim_rec.history_event_description;
2781: END IF;
2782: IF p_claim_rec.split_from_claim_id = FND_API.G_MISS_NUM THEN
2783: x_complete_rec.split_from_claim_id := NULL;
2784: END IF;
2785: IF p_claim_rec.split_from_claim_id IS NULL THEN
2786: x_complete_rec.split_from_claim_id := l_claim_rec.split_from_claim_id;
2784: END IF;
2785: IF p_claim_rec.split_from_claim_id IS NULL THEN
2786: x_complete_rec.split_from_claim_id := l_claim_rec.split_from_claim_id;
2787: END IF;
2788: IF p_claim_rec.duplicate_claim_id = FND_API.G_MISS_NUM THEN
2789: x_complete_rec.duplicate_claim_id := NULL;
2790: END IF;
2791: IF p_claim_rec.duplicate_claim_id IS NULL THEN
2792: x_complete_rec.duplicate_claim_id := l_claim_rec.duplicate_claim_id;
2790: END IF;
2791: IF p_claim_rec.duplicate_claim_id IS NULL THEN
2792: x_complete_rec.duplicate_claim_id := l_claim_rec.duplicate_claim_id;
2793: END IF;
2794: IF p_claim_rec.split_date = FND_API.G_MISS_DATE THEN
2795: x_complete_rec.split_date := NULL;
2796: END IF;
2797: IF p_claim_rec.split_date IS NULL THEN
2798: x_complete_rec.split_date := l_claim_rec.split_date;
2797: IF p_claim_rec.split_date IS NULL THEN
2798: x_complete_rec.split_date := l_claim_rec.split_date;
2799: END IF;
2800:
2801: IF p_claim_rec.root_claim_id = FND_API.G_MISS_NUM THEN
2802: x_complete_rec.root_claim_id := NULL;
2803: END IF;
2804: IF p_claim_rec.root_claim_id IS NULL THEN
2805: x_complete_rec.root_claim_id := l_claim_rec.root_claim_id;
2803: END IF;
2804: IF p_claim_rec.root_claim_id IS NULL THEN
2805: x_complete_rec.root_claim_id := l_claim_rec.root_claim_id;
2806: END IF;
2807: IF p_claim_rec.amount = FND_API.G_MISS_NUM THEN
2808: x_complete_rec.amount := NULL;
2809: END IF;
2810: IF p_claim_rec.amount IS NULL THEN
2811: x_complete_rec.amount := l_claim_rec.amount;
2809: END IF;
2810: IF p_claim_rec.amount IS NULL THEN
2811: x_complete_rec.amount := l_claim_rec.amount;
2812: END IF;
2813: IF p_claim_rec.amount_adjusted = FND_API.G_MISS_NUM THEN
2814: x_complete_rec.amount_adjusted := NULL;
2815: END IF;
2816: IF p_claim_rec.amount_adjusted IS NULL THEN
2817: x_complete_rec.amount_adjusted := l_claim_rec.amount_adjusted;
2815: END IF;
2816: IF p_claim_rec.amount_adjusted IS NULL THEN
2817: x_complete_rec.amount_adjusted := l_claim_rec.amount_adjusted;
2818: END IF;
2819: IF p_claim_rec.amount_remaining = FND_API.G_MISS_NUM THEN
2820: x_complete_rec.amount_remaining := NULL;
2821: END IF;
2822: IF p_claim_rec.amount_remaining IS NULL THEN
2823: x_complete_rec.amount_remaining := l_claim_rec.amount_remaining;
2821: END IF;
2822: IF p_claim_rec.amount_remaining IS NULL THEN
2823: x_complete_rec.amount_remaining := l_claim_rec.amount_remaining;
2824: END IF;
2825: IF p_claim_rec.amount_settled = FND_API.G_MISS_NUM THEN
2826: x_complete_rec.amount_settled := NULL;
2827: END IF;
2828: IF p_claim_rec.amount_settled IS NULL THEN
2829: x_complete_rec.amount_settled := l_claim_rec.amount_settled;
2827: END IF;
2828: IF p_claim_rec.amount_settled IS NULL THEN
2829: x_complete_rec.amount_settled := l_claim_rec.amount_settled;
2830: END IF;
2831: IF p_claim_rec.acctd_amount = FND_API.G_MISS_NUM THEN
2832: x_complete_rec.acctd_amount := NULL;
2833: END IF;
2834: IF p_claim_rec.acctd_amount IS NULL THEN
2835: x_complete_rec.acctd_amount := l_claim_rec.acctd_amount;
2833: END IF;
2834: IF p_claim_rec.acctd_amount IS NULL THEN
2835: x_complete_rec.acctd_amount := l_claim_rec.acctd_amount;
2836: END IF;
2837: IF p_claim_rec.acctd_amount_remaining = FND_API.G_MISS_NUM THEN
2838: x_complete_rec.acctd_amount_remaining := NULL;
2839: END IF;
2840: IF p_claim_rec.acctd_amount_remaining IS NULL THEN
2841: x_complete_rec.acctd_amount_remaining := l_claim_rec.acctd_amount_remaining ;
2839: END IF;
2840: IF p_claim_rec.acctd_amount_remaining IS NULL THEN
2841: x_complete_rec.acctd_amount_remaining := l_claim_rec.acctd_amount_remaining ;
2842: END IF;
2843: IF p_claim_rec.acctd_amount_adjusted = FND_API.G_MISS_NUM THEN
2844: x_complete_rec.acctd_amount_adjusted := NULL;
2845: END IF;
2846: IF p_claim_rec.acctd_amount_adjusted IS NULL THEN
2847: x_complete_rec.acctd_amount_adjusted := l_claim_rec.acctd_amount_adjusted;
2845: END IF;
2846: IF p_claim_rec.acctd_amount_adjusted IS NULL THEN
2847: x_complete_rec.acctd_amount_adjusted := l_claim_rec.acctd_amount_adjusted;
2848: END IF;
2849: IF p_claim_rec.acctd_amount_settled = FND_API.G_MISS_NUM THEN
2850: x_complete_rec.acctd_amount_settled := NULL;
2851: END IF;
2852: IF p_claim_rec.acctd_amount_settled IS NULL THEN
2853: x_complete_rec.acctd_amount_settled := l_claim_rec.acctd_amount_settled;
2851: END IF;
2852: IF p_claim_rec.acctd_amount_settled IS NULL THEN
2853: x_complete_rec.acctd_amount_settled := l_claim_rec.acctd_amount_settled;
2854: END IF;
2855: IF p_claim_rec.tax_amount = FND_API.G_MISS_NUM THEN
2856: x_complete_rec.tax_amount := NULL;
2857: END IF;
2858: IF p_claim_rec.tax_amount IS NULL THEN
2859: x_complete_rec.tax_amount := l_claim_rec.tax_amount ;
2857: END IF;
2858: IF p_claim_rec.tax_amount IS NULL THEN
2859: x_complete_rec.tax_amount := l_claim_rec.tax_amount ;
2860: END IF;
2861: IF p_claim_rec.tax_code = FND_API.G_MISS_CHAR THEN
2862: x_complete_rec.tax_code := NULL;
2863: END IF;
2864: IF p_claim_rec.tax_code IS NULL THEN
2865: x_complete_rec.tax_code := l_claim_rec.tax_code ;
2863: END IF;
2864: IF p_claim_rec.tax_code IS NULL THEN
2865: x_complete_rec.tax_code := l_claim_rec.tax_code ;
2866: END IF;
2867: IF p_claim_rec.tax_calculation_flag = FND_API.G_MISS_CHAR THEN
2868: x_complete_rec.tax_calculation_flag := NULL;
2869: END IF;
2870: IF p_claim_rec.tax_calculation_flag IS NULL THEN
2871: x_complete_rec.tax_calculation_flag := l_claim_rec.tax_calculation_flag ;
2869: END IF;
2870: IF p_claim_rec.tax_calculation_flag IS NULL THEN
2871: x_complete_rec.tax_calculation_flag := l_claim_rec.tax_calculation_flag ;
2872: END IF;
2873: IF p_claim_rec.currency_code = FND_API.G_MISS_CHAR THEN
2874: x_complete_rec.currency_code := NULL;
2875: END IF;
2876: IF p_claim_rec.currency_code IS NULL THEN
2877: x_complete_rec.currency_code := l_claim_rec.currency_code;
2875: END IF;
2876: IF p_claim_rec.currency_code IS NULL THEN
2877: x_complete_rec.currency_code := l_claim_rec.currency_code;
2878: END IF;
2879: IF p_claim_rec.exchange_rate_type = FND_API.G_MISS_CHAR THEN
2880: x_complete_rec.exchange_rate_type := NULL;
2881: END IF;
2882: IF p_claim_rec.exchange_rate_type IS NULL THEN
2883: x_complete_rec.exchange_rate_type := l_claim_rec.exchange_rate_type;
2881: END IF;
2882: IF p_claim_rec.exchange_rate_type IS NULL THEN
2883: x_complete_rec.exchange_rate_type := l_claim_rec.exchange_rate_type;
2884: END IF;
2885: IF p_claim_rec.exchange_rate_date = FND_API.G_MISS_DATE THEN
2886: x_complete_rec.exchange_rate_date := NULL;
2887: END IF;
2888: IF p_claim_rec.exchange_rate_date IS NULL THEN
2889: x_complete_rec.exchange_rate_date := l_claim_rec.exchange_rate_date;
2887: END IF;
2888: IF p_claim_rec.exchange_rate_date IS NULL THEN
2889: x_complete_rec.exchange_rate_date := l_claim_rec.exchange_rate_date;
2890: END IF;
2891: IF p_claim_rec.exchange_rate = FND_API.G_MISS_NUM THEN
2892: x_complete_rec.exchange_rate := NULL;
2893: END IF;
2894: IF p_claim_rec.exchange_rate IS NULL THEN
2895: x_complete_rec.exchange_rate := l_claim_rec.exchange_rate;
2893: END IF;
2894: IF p_claim_rec.exchange_rate IS NULL THEN
2895: x_complete_rec.exchange_rate := l_claim_rec.exchange_rate;
2896: END IF;
2897: IF p_claim_rec.set_of_books_id = FND_API.G_MISS_NUM THEN
2898: x_complete_rec.set_of_books_id := NULL;
2899: END IF;
2900: IF p_claim_rec.set_of_books_id IS NULL THEN
2901: x_complete_rec.set_of_books_id := l_claim_rec.set_of_books_id;
2899: END IF;
2900: IF p_claim_rec.set_of_books_id IS NULL THEN
2901: x_complete_rec.set_of_books_id := l_claim_rec.set_of_books_id;
2902: END IF;
2903: IF p_claim_rec.original_claim_date = FND_API.G_MISS_DATE THEN
2904: x_complete_rec.original_claim_date := NULL;
2905: END IF;
2906: IF p_claim_rec.original_claim_date IS NULL THEN
2907: x_complete_rec.original_claim_date := l_claim_rec.original_claim_date;
2905: END IF;
2906: IF p_claim_rec.original_claim_date IS NULL THEN
2907: x_complete_rec.original_claim_date := l_claim_rec.original_claim_date;
2908: END IF;
2909: IF p_claim_rec.source_object_id = FND_API.G_MISS_NUM THEN
2910: x_complete_rec.source_object_id := NULL;
2911: END IF;
2912: IF p_claim_rec.source_object_id IS NULL THEN
2913: x_complete_rec.source_object_id := l_claim_rec.source_object_id;
2911: END IF;
2912: IF p_claim_rec.source_object_id IS NULL THEN
2913: x_complete_rec.source_object_id := l_claim_rec.source_object_id;
2914: END IF;
2915: IF p_claim_rec.source_object_class = FND_API.G_MISS_CHAR THEN
2916: x_complete_rec.source_object_class := NULL;
2917: END IF;
2918: IF p_claim_rec.source_object_class IS NULL THEN
2919: x_complete_rec.source_object_class := l_claim_rec.source_object_class;
2917: END IF;
2918: IF p_claim_rec.source_object_class IS NULL THEN
2919: x_complete_rec.source_object_class := l_claim_rec.source_object_class;
2920: END IF;
2921: IF p_claim_rec.source_object_type_id = FND_API.G_MISS_NUM THEN
2922: x_complete_rec.source_object_type_id := NULL;
2923: END IF;
2924: IF p_claim_rec.source_object_type_id IS NULL THEN
2925: x_complete_rec.source_object_type_id := l_claim_rec.source_object_type_id;
2923: END IF;
2924: IF p_claim_rec.source_object_type_id IS NULL THEN
2925: x_complete_rec.source_object_type_id := l_claim_rec.source_object_type_id;
2926: END IF;
2927: IF p_claim_rec.source_object_number = FND_API.G_MISS_CHAR THEN
2928: x_complete_rec.source_object_number := NULL;
2929: END IF;
2930: IF p_claim_rec.source_object_number IS NULL THEN
2931: x_complete_rec.source_object_number := l_claim_rec.source_object_number;
2929: END IF;
2930: IF p_claim_rec.source_object_number IS NULL THEN
2931: x_complete_rec.source_object_number := l_claim_rec.source_object_number;
2932: END IF;
2933: IF p_claim_rec.cust_account_id = FND_API.G_MISS_NUM THEN
2934: x_complete_rec.cust_account_id := NULL;
2935: END IF;
2936: IF p_claim_rec.cust_account_id IS NULL THEN
2937: x_complete_rec.cust_account_id := l_claim_rec.cust_account_id;
2935: END IF;
2936: IF p_claim_rec.cust_account_id IS NULL THEN
2937: x_complete_rec.cust_account_id := l_claim_rec.cust_account_id;
2938: END IF;
2939: IF p_claim_rec.cust_billto_acct_site_id = FND_API.G_MISS_NUM THEN
2940: x_complete_rec.cust_billto_acct_site_id := NULL;
2941: END IF;
2942: IF p_claim_rec.cust_billto_acct_site_id IS NULL THEN
2943: x_complete_rec.cust_billto_acct_site_id := l_claim_rec.cust_billto_acct_site_id;
2941: END IF;
2942: IF p_claim_rec.cust_billto_acct_site_id IS NULL THEN
2943: x_complete_rec.cust_billto_acct_site_id := l_claim_rec.cust_billto_acct_site_id;
2944: END IF;
2945: IF p_claim_rec.cust_shipto_acct_site_id = FND_API.G_MISS_NUM THEN
2946: x_complete_rec.cust_shipto_acct_site_id := NULL;
2947: END IF;
2948: IF p_claim_rec.cust_shipto_acct_site_id IS NULL THEN
2949: x_complete_rec.cust_shipto_acct_site_id := l_claim_rec.cust_shipto_acct_site_id;
2947: END IF;
2948: IF p_claim_rec.cust_shipto_acct_site_id IS NULL THEN
2949: x_complete_rec.cust_shipto_acct_site_id := l_claim_rec.cust_shipto_acct_site_id;
2950: END IF;
2951: IF p_claim_rec.location_id = FND_API.G_MISS_NUM THEN
2952: x_complete_rec.location_id := NULL;
2953: END IF;
2954: IF p_claim_rec.location_id IS NULL THEN
2955: x_complete_rec.location_id := l_claim_rec.location_id;
2953: END IF;
2954: IF p_claim_rec.location_id IS NULL THEN
2955: x_complete_rec.location_id := l_claim_rec.location_id;
2956: END IF;
2957: IF p_claim_rec.pay_related_account_flag = FND_API.G_MISS_CHAR THEN
2958: x_complete_rec.pay_related_account_flag := NULL;
2959: END IF;
2960: IF p_claim_rec.pay_related_account_flag IS NULL THEN
2961: x_complete_rec.pay_related_account_flag := l_claim_rec.pay_related_account_flag;
2959: END IF;
2960: IF p_claim_rec.pay_related_account_flag IS NULL THEN
2961: x_complete_rec.pay_related_account_flag := l_claim_rec.pay_related_account_flag;
2962: END IF;
2963: IF p_claim_rec.related_cust_account_id = FND_API.G_MISS_NUM THEN
2964: x_complete_rec.related_cust_account_id := NULL;
2965: END IF;
2966: IF p_claim_rec.related_cust_account_id IS NULL THEN
2967: x_complete_rec.related_cust_account_id := l_claim_rec.related_cust_account_id;
2965: END IF;
2966: IF p_claim_rec.related_cust_account_id IS NULL THEN
2967: x_complete_rec.related_cust_account_id := l_claim_rec.related_cust_account_id;
2968: END IF;
2969: IF p_claim_rec.related_site_use_id = FND_API.G_MISS_NUM THEN
2970: x_complete_rec.related_site_use_id := NULL;
2971: END IF;
2972: IF p_claim_rec.related_site_use_id IS NULL THEN
2973: x_complete_rec.related_site_use_id := l_claim_rec.related_site_use_id;
2971: END IF;
2972: IF p_claim_rec.related_site_use_id IS NULL THEN
2973: x_complete_rec.related_site_use_id := l_claim_rec.related_site_use_id;
2974: END IF;
2975: IF p_claim_rec.relationship_type = FND_API.G_MISS_CHAR THEN
2976: x_complete_rec.relationship_type := NULL;
2977: END IF;
2978: IF p_claim_rec.relationship_type IS NULL THEN
2979: x_complete_rec.relationship_type := l_claim_rec.relationship_type;
2977: END IF;
2978: IF p_claim_rec.relationship_type IS NULL THEN
2979: x_complete_rec.relationship_type := l_claim_rec.relationship_type;
2980: END IF;
2981: IF p_claim_rec.vendor_id = FND_API.G_MISS_NUM THEN
2982: x_complete_rec.vendor_id := NULL;
2983: END IF;
2984: IF p_claim_rec.vendor_id IS NULL THEN
2985: x_complete_rec.vendor_id := l_claim_rec.vendor_id;
2983: END IF;
2984: IF p_claim_rec.vendor_id IS NULL THEN
2985: x_complete_rec.vendor_id := l_claim_rec.vendor_id;
2986: END IF;
2987: IF p_claim_rec.vendor_site_id = FND_API.G_MISS_NUM THEN
2988: x_complete_rec.vendor_site_id := NULL;
2989: END IF;
2990: IF p_claim_rec.vendor_site_id IS NULL THEN
2991: x_complete_rec.vendor_site_id := l_claim_rec.vendor_site_id;
2989: END IF;
2990: IF p_claim_rec.vendor_site_id IS NULL THEN
2991: x_complete_rec.vendor_site_id := l_claim_rec.vendor_site_id;
2992: END IF;
2993: IF p_claim_rec.reason_type = FND_API.G_MISS_CHAR THEN
2994: x_complete_rec.reason_type := NULL;
2995: END IF;
2996: IF p_claim_rec.reason_type IS NULL THEN
2997: x_complete_rec.reason_type := l_claim_rec.reason_type;
2995: END IF;
2996: IF p_claim_rec.reason_type IS NULL THEN
2997: x_complete_rec.reason_type := l_claim_rec.reason_type;
2998: END IF;
2999: IF p_claim_rec.reason_code_id = FND_API.G_MISS_NUM THEN
3000: x_complete_rec.reason_code_id := NULL;
3001: END IF;
3002: IF p_claim_rec.reason_code_id IS NULL THEN
3003: x_complete_rec.reason_code_id := l_claim_rec.reason_code_id;
3001: END IF;
3002: IF p_claim_rec.reason_code_id IS NULL THEN
3003: x_complete_rec.reason_code_id := l_claim_rec.reason_code_id;
3004: END IF;
3005: IF p_claim_rec.task_template_group_id = FND_API.G_MISS_NUM THEN
3006: x_complete_rec.task_template_group_id := NULL;
3007: END IF;
3008: IF p_claim_rec.task_template_group_id IS NULL THEN
3009: x_complete_rec.task_template_group_id := l_claim_rec.task_template_group_id;
3007: END IF;
3008: IF p_claim_rec.task_template_group_id IS NULL THEN
3009: x_complete_rec.task_template_group_id := l_claim_rec.task_template_group_id;
3010: END IF;
3011: IF p_claim_rec.status_code = FND_API.G_MISS_CHAR THEN
3012: x_complete_rec.status_code := NULL;
3013: END IF;
3014: IF p_claim_rec.status_code IS NULL THEN
3015: x_complete_rec.status_code := l_claim_rec.status_code;
3013: END IF;
3014: IF p_claim_rec.status_code IS NULL THEN
3015: x_complete_rec.status_code := l_claim_rec.status_code;
3016: END IF;
3017: IF p_claim_rec.user_status_id = FND_API.G_MISS_NUM THEN
3018: x_complete_rec.user_status_id := NULL;
3019: END IF;
3020: IF p_claim_rec.user_status_id IS NULL THEN
3021: x_complete_rec.user_status_id := l_claim_rec.user_status_id;
3019: END IF;
3020: IF p_claim_rec.user_status_id IS NULL THEN
3021: x_complete_rec.user_status_id := l_claim_rec.user_status_id;
3022: END IF;
3023: IF p_claim_rec.sales_rep_id = FND_API.G_MISS_NUM THEN
3024: x_complete_rec.sales_rep_id := NULL;
3025: END IF;
3026: IF p_claim_rec.close_status_id = FND_API.G_MISS_NUM THEN
3027: x_complete_rec.close_status_id := NULL;
3022: END IF;
3023: IF p_claim_rec.sales_rep_id = FND_API.G_MISS_NUM THEN
3024: x_complete_rec.sales_rep_id := NULL;
3025: END IF;
3026: IF p_claim_rec.close_status_id = FND_API.G_MISS_NUM THEN
3027: x_complete_rec.close_status_id := NULL;
3028: END IF;
3029: IF p_claim_rec.close_status_id IS NULL THEN
3030: x_complete_rec.close_status_id := l_claim_rec.close_status_id;
3028: END IF;
3029: IF p_claim_rec.close_status_id IS NULL THEN
3030: x_complete_rec.close_status_id := l_claim_rec.close_status_id;
3031: END IF;
3032: IF p_claim_rec.open_status_id = FND_API.G_MISS_NUM THEN
3033: x_complete_rec.open_status_id := NULL;
3034: END IF;
3035: IF p_claim_rec.open_status_id IS NULL THEN
3036: x_complete_rec.open_status_id := l_claim_rec.open_status_id;
3037: END IF;
3038: IF p_claim_rec.sales_rep_id IS NULL THEN
3039: x_complete_rec.sales_rep_id := l_claim_rec.sales_rep_id;
3040: END IF;
3041: IF p_claim_rec.collector_id = FND_API.G_MISS_NUM THEN
3042: x_complete_rec.collector_id := NULL;
3043: END IF;
3044: IF p_claim_rec.collector_id IS NULL THEN
3045: x_complete_rec.collector_id := l_claim_rec.collector_id;
3043: END IF;
3044: IF p_claim_rec.collector_id IS NULL THEN
3045: x_complete_rec.collector_id := l_claim_rec.collector_id;
3046: END IF;
3047: IF p_claim_rec.contact_id = FND_API.G_MISS_NUM THEN
3048: x_complete_rec.contact_id := NULL;
3049: END IF;
3050: IF p_claim_rec.contact_id IS NULL THEN
3051: x_complete_rec.contact_id := l_claim_rec.contact_id;
3049: END IF;
3050: IF p_claim_rec.contact_id IS NULL THEN
3051: x_complete_rec.contact_id := l_claim_rec.contact_id;
3052: END IF;
3053: IF p_claim_rec.broker_id = FND_API.G_MISS_NUM THEN
3054: x_complete_rec.broker_id := NULL;
3055: END IF;
3056: IF p_claim_rec.broker_id IS NULL THEN
3057: x_complete_rec.broker_id := l_claim_rec.broker_id;
3055: END IF;
3056: IF p_claim_rec.broker_id IS NULL THEN
3057: x_complete_rec.broker_id := l_claim_rec.broker_id;
3058: END IF;
3059: IF p_claim_rec.territory_id = FND_API.G_MISS_NUM THEN
3060: x_complete_rec.territory_id := NULL;
3061: END IF;
3062: IF p_claim_rec.territory_id IS NULL THEN
3063: x_complete_rec.territory_id := l_claim_rec.territory_id;
3061: END IF;
3062: IF p_claim_rec.territory_id IS NULL THEN
3063: x_complete_rec.territory_id := l_claim_rec.territory_id;
3064: END IF;
3065: IF p_claim_rec.customer_ref_date = FND_API.G_MISS_DATE THEN
3066: x_complete_rec.customer_ref_date := NULL;
3067: END IF;
3068: IF p_claim_rec.customer_ref_date IS NULL THEN
3069: x_complete_rec.customer_ref_date := l_claim_rec.customer_ref_date;
3067: END IF;
3068: IF p_claim_rec.customer_ref_date IS NULL THEN
3069: x_complete_rec.customer_ref_date := l_claim_rec.customer_ref_date;
3070: END IF;
3071: IF p_claim_rec.customer_ref_number = FND_API.G_MISS_CHAR THEN
3072: x_complete_rec.customer_ref_number := NULL;
3073: END IF;
3074: IF p_claim_rec.customer_ref_number IS NULL THEN
3075: x_complete_rec.customer_ref_number := l_claim_rec.customer_ref_number;
3073: END IF;
3074: IF p_claim_rec.customer_ref_number IS NULL THEN
3075: x_complete_rec.customer_ref_number := l_claim_rec.customer_ref_number;
3076: END IF;
3077: IF p_claim_rec.receipt_id = FND_API.G_MISS_NUM THEN
3078: x_complete_rec.receipt_id := NULL;
3079: END IF;
3080: IF p_claim_rec.receipt_id IS NULL THEN
3081: x_complete_rec.receipt_id := l_claim_rec.receipt_id;
3079: END IF;
3080: IF p_claim_rec.receipt_id IS NULL THEN
3081: x_complete_rec.receipt_id := l_claim_rec.receipt_id;
3082: END IF;
3083: IF p_claim_rec.receipt_number = FND_API.G_MISS_CHAR THEN
3084: x_complete_rec.receipt_number := NULL;
3085: END IF;
3086: IF p_claim_rec.receipt_number IS NULL THEN
3087: x_complete_rec.receipt_number := l_claim_rec.receipt_number;
3085: END IF;
3086: IF p_claim_rec.receipt_number IS NULL THEN
3087: x_complete_rec.receipt_number := l_claim_rec.receipt_number;
3088: END IF;
3089: IF p_claim_rec.doc_sequence_id = FND_API.G_MISS_NUM THEN
3090: x_complete_rec.doc_sequence_id := NULL;
3091: END IF;
3092: IF p_claim_rec.doc_sequence_id IS NULL THEN
3093: x_complete_rec.doc_sequence_id := l_claim_rec.doc_sequence_id;
3091: END IF;
3092: IF p_claim_rec.doc_sequence_id IS NULL THEN
3093: x_complete_rec.doc_sequence_id := l_claim_rec.doc_sequence_id;
3094: END IF;
3095: IF p_claim_rec.doc_sequence_value = FND_API.G_MISS_NUM THEN
3096: x_complete_rec.doc_sequence_value := NULL;
3097: END IF;
3098: IF p_claim_rec.doc_sequence_value IS NULL THEN
3099: x_complete_rec.doc_sequence_value := l_claim_rec.doc_sequence_value;
3097: END IF;
3098: IF p_claim_rec.doc_sequence_value IS NULL THEN
3099: x_complete_rec.doc_sequence_value := l_claim_rec.doc_sequence_value;
3100: END IF;
3101: IF p_claim_rec.gl_date = FND_API.G_MISS_DATE THEN
3102: x_complete_rec.gl_date := NULL;
3103: END IF;
3104: IF p_claim_rec.gl_date IS NULL THEN
3105: x_complete_rec.gl_date := l_claim_rec.gl_date;
3103: END IF;
3104: IF p_claim_rec.gl_date IS NULL THEN
3105: x_complete_rec.gl_date := l_claim_rec.gl_date;
3106: END IF;
3107: IF p_claim_rec.payment_method = FND_API.G_MISS_CHAR THEN
3108: x_complete_rec.payment_method := NULL;
3109: END IF;
3110: IF p_claim_rec.payment_method IS NULL THEN
3111: x_complete_rec.payment_method := l_claim_rec.payment_method;
3109: END IF;
3110: IF p_claim_rec.payment_method IS NULL THEN
3111: x_complete_rec.payment_method := l_claim_rec.payment_method;
3112: END IF;
3113: IF p_claim_rec.voucher_id = FND_API.G_MISS_NUM THEN
3114: x_complete_rec.voucher_id := NULL;
3115: END IF;
3116: IF p_claim_rec.voucher_id IS NULL THEN
3117: x_complete_rec.voucher_id := l_claim_rec.voucher_id;
3115: END IF;
3116: IF p_claim_rec.voucher_id IS NULL THEN
3117: x_complete_rec.voucher_id := l_claim_rec.voucher_id;
3118: END IF;
3119: IF p_claim_rec.voucher_number = FND_API.G_MISS_CHAR THEN
3120: x_complete_rec.voucher_number := NULL;
3121: END IF;
3122: IF p_claim_rec.voucher_number IS NULL THEN
3123: x_complete_rec.voucher_number := l_claim_rec.voucher_number;
3121: END IF;
3122: IF p_claim_rec.voucher_number IS NULL THEN
3123: x_complete_rec.voucher_number := l_claim_rec.voucher_number;
3124: END IF;
3125: IF p_claim_rec.payment_reference_id = FND_API.G_MISS_NUM THEN
3126: x_complete_rec.payment_reference_id := NULL;
3127: END IF;
3128: IF p_claim_rec.payment_reference_id IS NULL THEN
3129: x_complete_rec.payment_reference_id := l_claim_rec.payment_reference_id;
3127: END IF;
3128: IF p_claim_rec.payment_reference_id IS NULL THEN
3129: x_complete_rec.payment_reference_id := l_claim_rec.payment_reference_id;
3130: END IF;
3131: IF p_claim_rec.payment_reference_number = FND_API.G_MISS_CHAR THEN
3132: x_complete_rec.payment_reference_number := NULL;
3133: END IF;
3134: IF p_claim_rec.payment_reference_number IS NULL THEN
3135: x_complete_rec.payment_reference_number := l_claim_rec.payment_reference_number;
3133: END IF;
3134: IF p_claim_rec.payment_reference_number IS NULL THEN
3135: x_complete_rec.payment_reference_number := l_claim_rec.payment_reference_number;
3136: END IF;
3137: IF p_claim_rec.payment_reference_date = FND_API.G_MISS_DATE THEN
3138: x_complete_rec.payment_reference_date := NULL;
3139: END IF;
3140: IF p_claim_rec.payment_reference_date IS NULL THEN
3141: x_complete_rec.payment_reference_date := l_claim_rec.payment_reference_date;
3139: END IF;
3140: IF p_claim_rec.payment_reference_date IS NULL THEN
3141: x_complete_rec.payment_reference_date := l_claim_rec.payment_reference_date;
3142: END IF;
3143: IF p_claim_rec.payment_status = FND_API.G_MISS_CHAR THEN
3144: x_complete_rec.payment_status := NULL;
3145: END IF;
3146: IF p_claim_rec.payment_status IS NULL THEN
3147: x_complete_rec.payment_status := l_claim_rec.payment_status;
3145: END IF;
3146: IF p_claim_rec.payment_status IS NULL THEN
3147: x_complete_rec.payment_status := l_claim_rec.payment_status;
3148: END IF;
3149: IF p_claim_rec.approved_flag = FND_API.G_MISS_CHAR THEN
3150: x_complete_rec.approved_flag := NULL;
3151: END IF;
3152: IF p_claim_rec.approved_flag IS NULL THEN
3153: x_complete_rec.approved_flag := l_claim_rec.approved_flag;
3151: END IF;
3152: IF p_claim_rec.approved_flag IS NULL THEN
3153: x_complete_rec.approved_flag := l_claim_rec.approved_flag;
3154: END IF;
3155: IF p_claim_rec.approved_date = FND_API.G_MISS_DATE THEN
3156: x_complete_rec.approved_date := NULL;
3157: END IF;
3158: IF p_claim_rec.approved_date IS NULL THEN
3159: x_complete_rec.approved_date := l_claim_rec.approved_date;
3157: END IF;
3158: IF p_claim_rec.approved_date IS NULL THEN
3159: x_complete_rec.approved_date := l_claim_rec.approved_date;
3160: END IF;
3161: IF p_claim_rec.approved_by = FND_API.G_MISS_NUM THEN
3162: x_complete_rec.approved_by := NULL;
3163: END IF;
3164: IF p_claim_rec.approved_by IS NULL THEN
3165: x_complete_rec.approved_by := l_claim_rec.approved_by;
3163: END IF;
3164: IF p_claim_rec.approved_by IS NULL THEN
3165: x_complete_rec.approved_by := l_claim_rec.approved_by;
3166: END IF;
3167: IF p_claim_rec.settled_date = FND_API.G_MISS_DATE THEN
3168: x_complete_rec.settled_date := NULL;
3169: END IF;
3170: IF p_claim_rec.settled_date IS NULL THEN
3171: x_complete_rec.settled_date := l_claim_rec.settled_date;
3169: END IF;
3170: IF p_claim_rec.settled_date IS NULL THEN
3171: x_complete_rec.settled_date := l_claim_rec.settled_date;
3172: END IF;
3173: IF p_claim_rec.settled_by = FND_API.G_MISS_NUM THEN
3174: x_complete_rec.settled_by := NULL;
3175: END IF;
3176: IF p_claim_rec.settled_by IS NULL THEN
3177: x_complete_rec.settled_by := l_claim_rec.settled_by;
3175: END IF;
3176: IF p_claim_rec.settled_by IS NULL THEN
3177: x_complete_rec.settled_by := l_claim_rec.settled_by;
3178: END IF;
3179: IF p_claim_rec.effective_date = FND_API.G_MISS_DATE THEN
3180: x_complete_rec.effective_date := NULL;
3181: END IF;
3182: IF p_claim_rec.effective_date IS NULL THEN
3183: x_complete_rec.effective_date := l_claim_rec.effective_date;
3181: END IF;
3182: IF p_claim_rec.effective_date IS NULL THEN
3183: x_complete_rec.effective_date := l_claim_rec.effective_date;
3184: END IF;
3185: IF p_claim_rec.custom_setup_id = FND_API.G_MISS_NUM THEN
3186: x_complete_rec.custom_setup_id := NULL;
3187: END IF;
3188: IF p_claim_rec.custom_setup_id IS NULL THEN
3189: x_complete_rec.custom_setup_id := l_claim_rec.custom_setup_id;
3187: END IF;
3188: IF p_claim_rec.custom_setup_id IS NULL THEN
3189: x_complete_rec.custom_setup_id := l_claim_rec.custom_setup_id;
3190: END IF;
3191: IF p_claim_rec.task_id = FND_API.G_MISS_NUM THEN
3192: x_complete_rec.task_id := NULL;
3193: END IF;
3194: IF p_claim_rec.task_id IS NULL THEN
3195: x_complete_rec.task_id := l_claim_rec.task_id;
3193: END IF;
3194: IF p_claim_rec.task_id IS NULL THEN
3195: x_complete_rec.task_id := l_claim_rec.task_id;
3196: END IF;
3197: IF p_claim_rec.country_id = FND_API.G_MISS_NUM THEN
3198: x_complete_rec.country_id := NULL;
3199: END IF;
3200: IF p_claim_rec.country_id IS NULL THEN
3201: x_complete_rec.country_id := l_claim_rec.country_id;
3199: END IF;
3200: IF p_claim_rec.country_id IS NULL THEN
3201: x_complete_rec.country_id := l_claim_rec.country_id;
3202: END IF;
3203: IF p_claim_rec.order_type_id = FND_API.G_MISS_NUM THEN
3204: x_complete_rec.order_type_id := NULL;
3205: END IF;
3206: IF p_claim_rec.order_type_id IS NULL THEN
3207: x_complete_rec.order_type_id := l_claim_rec.order_type_id;
3205: END IF;
3206: IF p_claim_rec.order_type_id IS NULL THEN
3207: x_complete_rec.order_type_id := l_claim_rec.order_type_id;
3208: END IF;
3209: IF p_claim_rec.comments = FND_API.G_MISS_CHAR THEN
3210: x_complete_rec.comments := NULL;
3211: END IF;
3212: IF p_claim_rec.comments IS NULL THEN
3213: x_complete_rec.comments := l_claim_rec.comments;
3211: END IF;
3212: IF p_claim_rec.comments IS NULL THEN
3213: x_complete_rec.comments := l_claim_rec.comments;
3214: END IF;
3215: IF p_claim_rec.attribute_category = FND_API.G_MISS_CHAR THEN
3216: x_complete_rec.attribute_category := NULL;
3217: END IF;
3218: IF p_claim_rec.attribute_category IS NULL THEN
3219: x_complete_rec.attribute_category := l_claim_rec.attribute_category;
3217: END IF;
3218: IF p_claim_rec.attribute_category IS NULL THEN
3219: x_complete_rec.attribute_category := l_claim_rec.attribute_category;
3220: END IF;
3221: IF p_claim_rec.attribute1 = FND_API.G_MISS_CHAR THEN
3222: x_complete_rec.attribute1 := NULL;
3223: END IF;
3224: IF p_claim_rec.attribute1 IS NULL THEN
3225: x_complete_rec.attribute1 := l_claim_rec.attribute1;
3223: END IF;
3224: IF p_claim_rec.attribute1 IS NULL THEN
3225: x_complete_rec.attribute1 := l_claim_rec.attribute1;
3226: END IF;
3227: IF p_claim_rec.attribute2 = FND_API.G_MISS_CHAR THEN
3228: x_complete_rec.attribute2 := NULL;
3229: END IF;
3230: IF p_claim_rec.attribute2 IS NULL THEN
3231: x_complete_rec.attribute2 := l_claim_rec.attribute2;
3229: END IF;
3230: IF p_claim_rec.attribute2 IS NULL THEN
3231: x_complete_rec.attribute2 := l_claim_rec.attribute2;
3232: END IF;
3233: IF p_claim_rec.attribute3 = FND_API.G_MISS_CHAR THEN
3234: x_complete_rec.attribute3 := NULL;
3235: END IF;
3236: IF p_claim_rec.attribute3 IS NULL THEN
3237: x_complete_rec.attribute3 := l_claim_rec.attribute3;
3235: END IF;
3236: IF p_claim_rec.attribute3 IS NULL THEN
3237: x_complete_rec.attribute3 := l_claim_rec.attribute3;
3238: END IF;
3239: IF p_claim_rec.attribute4 = FND_API.G_MISS_CHAR THEN
3240: x_complete_rec.attribute4 := NULL;
3241: END IF;
3242: IF p_claim_rec.attribute4 IS NULL THEN
3243: x_complete_rec.attribute4 := l_claim_rec.attribute4;
3241: END IF;
3242: IF p_claim_rec.attribute4 IS NULL THEN
3243: x_complete_rec.attribute4 := l_claim_rec.attribute4;
3244: END IF;
3245: IF p_claim_rec.attribute5 = FND_API.G_MISS_CHAR THEN
3246: x_complete_rec.attribute5 := NULL;
3247: END IF;
3248: IF p_claim_rec.attribute5 IS NULL THEN
3249: x_complete_rec.attribute5 := l_claim_rec.attribute5;
3247: END IF;
3248: IF p_claim_rec.attribute5 IS NULL THEN
3249: x_complete_rec.attribute5 := l_claim_rec.attribute5;
3250: END IF;
3251: IF p_claim_rec.attribute6 = FND_API.G_MISS_CHAR THEN
3252: x_complete_rec.attribute6 := NULL;
3253: END IF;
3254: IF p_claim_rec.attribute6 IS NULL THEN
3255: x_complete_rec.attribute6 := l_claim_rec.attribute6;
3253: END IF;
3254: IF p_claim_rec.attribute6 IS NULL THEN
3255: x_complete_rec.attribute6 := l_claim_rec.attribute6;
3256: END IF;
3257: IF p_claim_rec.attribute7 = FND_API.G_MISS_CHAR THEN
3258: x_complete_rec.attribute7 := NULL;
3259: END IF;
3260: IF p_claim_rec.attribute7 IS NULL THEN
3261: x_complete_rec.attribute7 := l_claim_rec.attribute7;
3259: END IF;
3260: IF p_claim_rec.attribute7 IS NULL THEN
3261: x_complete_rec.attribute7 := l_claim_rec.attribute7;
3262: END IF;
3263: IF p_claim_rec.attribute8 = FND_API.G_MISS_CHAR THEN
3264: x_complete_rec.attribute8 := NULL;
3265: END IF;
3266: IF p_claim_rec.attribute8 IS NULL THEN
3267: x_complete_rec.attribute8 := l_claim_rec.attribute8;
3265: END IF;
3266: IF p_claim_rec.attribute8 IS NULL THEN
3267: x_complete_rec.attribute8 := l_claim_rec.attribute8;
3268: END IF;
3269: IF p_claim_rec.attribute9 = FND_API.G_MISS_CHAR THEN
3270: x_complete_rec.attribute9 := NULL;
3271: END IF;
3272: IF p_claim_rec.attribute9 IS NULL THEN
3273: x_complete_rec.attribute9 := l_claim_rec.attribute9;
3271: END IF;
3272: IF p_claim_rec.attribute9 IS NULL THEN
3273: x_complete_rec.attribute9 := l_claim_rec.attribute9;
3274: END IF;
3275: IF p_claim_rec.attribute10 = FND_API.G_MISS_CHAR THEN
3276: x_complete_rec.attribute10 := NULL;
3277: END IF;
3278: IF p_claim_rec.attribute10 IS NULL THEN
3279: x_complete_rec.attribute10 := l_claim_rec.attribute10;
3277: END IF;
3278: IF p_claim_rec.attribute10 IS NULL THEN
3279: x_complete_rec.attribute10 := l_claim_rec.attribute10;
3280: END IF;
3281: IF p_claim_rec.attribute11 = FND_API.G_MISS_CHAR THEN
3282: x_complete_rec.attribute11 := NULL;
3283: END IF;
3284: IF p_claim_rec.attribute11 IS NULL THEN
3285: x_complete_rec.attribute11 := l_claim_rec.attribute11;
3283: END IF;
3284: IF p_claim_rec.attribute11 IS NULL THEN
3285: x_complete_rec.attribute11 := l_claim_rec.attribute11;
3286: END IF;
3287: IF p_claim_rec.attribute12 = FND_API.G_MISS_CHAR THEN
3288: x_complete_rec.attribute12 := NULL;
3289: END IF;
3290: IF p_claim_rec.attribute12 IS NULL THEN
3291: x_complete_rec.attribute12 := l_claim_rec.attribute12;
3289: END IF;
3290: IF p_claim_rec.attribute12 IS NULL THEN
3291: x_complete_rec.attribute12 := l_claim_rec.attribute12;
3292: END IF;
3293: IF p_claim_rec.attribute13 = FND_API.G_MISS_CHAR THEN
3294: x_complete_rec.attribute13 := NULL;
3295: END IF;
3296: IF p_claim_rec.attribute13 IS NULL THEN
3297: x_complete_rec.attribute13 := l_claim_rec.attribute13;
3295: END IF;
3296: IF p_claim_rec.attribute13 IS NULL THEN
3297: x_complete_rec.attribute13 := l_claim_rec.attribute13;
3298: END IF;
3299: IF p_claim_rec.attribute14 = FND_API.G_MISS_CHAR THEN
3300: x_complete_rec.attribute14 := NULL;
3301: END IF;
3302: IF p_claim_rec.attribute14 IS NULL THEN
3303: x_complete_rec.attribute14 := l_claim_rec.attribute14;
3301: END IF;
3302: IF p_claim_rec.attribute14 IS NULL THEN
3303: x_complete_rec.attribute14 := l_claim_rec.attribute14;
3304: END IF;
3305: IF p_claim_rec.attribute15 = FND_API.G_MISS_CHAR THEN
3306: x_complete_rec.attribute15 := NULL;
3307: END IF;
3308: IF p_claim_rec.attribute15 IS NULL THEN
3309: x_complete_rec.attribute15 := l_claim_rec.attribute15;
3307: END IF;
3308: IF p_claim_rec.attribute15 IS NULL THEN
3309: x_complete_rec.attribute15 := l_claim_rec.attribute15;
3310: END IF;
3311: IF p_claim_rec.deduction_attribute_category = FND_API.G_MISS_CHAR THEN
3312: x_complete_rec.deduction_attribute_category := NULL;
3313: END IF;
3314: IF p_claim_rec.deduction_attribute_category IS NULL THEN
3315: x_complete_rec.deduction_attribute_category := l_claim_rec.deduction_attribute_category;
3313: END IF;
3314: IF p_claim_rec.deduction_attribute_category IS NULL THEN
3315: x_complete_rec.deduction_attribute_category := l_claim_rec.deduction_attribute_category;
3316: END IF;
3317: IF p_claim_rec.deduction_attribute1 = FND_API.G_MISS_CHAR THEN
3318: x_complete_rec.deduction_attribute1 := NULL;
3319: END IF;
3320: IF p_claim_rec.deduction_attribute1 IS NULL THEN
3321: x_complete_rec.deduction_attribute1 := l_claim_rec.deduction_attribute1;
3319: END IF;
3320: IF p_claim_rec.deduction_attribute1 IS NULL THEN
3321: x_complete_rec.deduction_attribute1 := l_claim_rec.deduction_attribute1;
3322: END IF;
3323: IF p_claim_rec.deduction_attribute2 = FND_API.G_MISS_CHAR THEN
3324: x_complete_rec.deduction_attribute2 := NULL;
3325: END IF;
3326: IF p_claim_rec.deduction_attribute2 IS NULL THEN
3327: x_complete_rec.deduction_attribute2 := l_claim_rec.deduction_attribute2;
3325: END IF;
3326: IF p_claim_rec.deduction_attribute2 IS NULL THEN
3327: x_complete_rec.deduction_attribute2 := l_claim_rec.deduction_attribute2;
3328: END IF;
3329: IF p_claim_rec.deduction_attribute3 = FND_API.G_MISS_CHAR THEN
3330: x_complete_rec.deduction_attribute3 := NULL;
3331: END IF;
3332: IF p_claim_rec.deduction_attribute3 IS NULL THEN
3333: x_complete_rec.deduction_attribute3 := l_claim_rec.deduction_attribute3;
3331: END IF;
3332: IF p_claim_rec.deduction_attribute3 IS NULL THEN
3333: x_complete_rec.deduction_attribute3 := l_claim_rec.deduction_attribute3;
3334: END IF;
3335: IF p_claim_rec.deduction_attribute4 = FND_API.G_MISS_CHAR THEN
3336: x_complete_rec.deduction_attribute4 := NULL;
3337: END IF;
3338: IF p_claim_rec.deduction_attribute4 IS NULL THEN
3339: x_complete_rec.deduction_attribute4 := l_claim_rec.deduction_attribute4;
3337: END IF;
3338: IF p_claim_rec.deduction_attribute4 IS NULL THEN
3339: x_complete_rec.deduction_attribute4 := l_claim_rec.deduction_attribute4;
3340: END IF;
3341: IF p_claim_rec.deduction_attribute5 = FND_API.G_MISS_CHAR THEN
3342: x_complete_rec.deduction_attribute5 := NULL;
3343: END IF;
3344: IF p_claim_rec.deduction_attribute5 IS NULL THEN
3345: x_complete_rec.deduction_attribute5 := l_claim_rec.deduction_attribute5;
3343: END IF;
3344: IF p_claim_rec.deduction_attribute5 IS NULL THEN
3345: x_complete_rec.deduction_attribute5 := l_claim_rec.deduction_attribute5;
3346: END IF;
3347: IF p_claim_rec.attribute6 = FND_API.G_MISS_CHAR THEN
3348: x_complete_rec.deduction_attribute6 := NULL;
3349: END IF;
3350: IF p_claim_rec.attribute6 IS NULL THEN
3351: x_complete_rec.deduction_attribute6 := l_claim_rec.deduction_attribute6;
3349: END IF;
3350: IF p_claim_rec.attribute6 IS NULL THEN
3351: x_complete_rec.deduction_attribute6 := l_claim_rec.deduction_attribute6;
3352: END IF;
3353: IF p_claim_rec.deduction_attribute7 = FND_API.G_MISS_CHAR THEN
3354: x_complete_rec.deduction_attribute7 := NULL;
3355: END IF;
3356: IF p_claim_rec.deduction_attribute7 IS NULL THEN
3357: x_complete_rec.deduction_attribute7 := l_claim_rec.deduction_attribute7;
3355: END IF;
3356: IF p_claim_rec.deduction_attribute7 IS NULL THEN
3357: x_complete_rec.deduction_attribute7 := l_claim_rec.deduction_attribute7;
3358: END IF;
3359: IF p_claim_rec.deduction_attribute8 = FND_API.G_MISS_CHAR THEN
3360: x_complete_rec.deduction_attribute8 := NULL;
3361: END IF;
3362: IF p_claim_rec.deduction_attribute8 IS NULL THEN
3363: x_complete_rec.deduction_attribute8 := l_claim_rec.deduction_attribute8;
3361: END IF;
3362: IF p_claim_rec.deduction_attribute8 IS NULL THEN
3363: x_complete_rec.deduction_attribute8 := l_claim_rec.deduction_attribute8;
3364: END IF;
3365: IF p_claim_rec.deduction_attribute9 = FND_API.G_MISS_CHAR THEN
3366: x_complete_rec.deduction_attribute9 := NULL;
3367: END IF;
3368: IF p_claim_rec.deduction_attribute9 IS NULL THEN
3369: x_complete_rec.deduction_attribute9 := l_claim_rec.deduction_attribute9;
3367: END IF;
3368: IF p_claim_rec.deduction_attribute9 IS NULL THEN
3369: x_complete_rec.deduction_attribute9 := l_claim_rec.deduction_attribute9;
3370: END IF;
3371: IF p_claim_rec.deduction_attribute10 = FND_API.G_MISS_CHAR THEN
3372: x_complete_rec.deduction_attribute10 := NULL;
3373: END IF;
3374: IF p_claim_rec.deduction_attribute10 IS NULL THEN
3375: x_complete_rec.deduction_attribute10 := l_claim_rec.deduction_attribute10;
3373: END IF;
3374: IF p_claim_rec.deduction_attribute10 IS NULL THEN
3375: x_complete_rec.deduction_attribute10 := l_claim_rec.deduction_attribute10;
3376: END IF;
3377: IF p_claim_rec.deduction_attribute11 = FND_API.G_MISS_CHAR THEN
3378: x_complete_rec.deduction_attribute11 := NULL;
3379: END IF;
3380: IF p_claim_rec.deduction_attribute11 IS NULL THEN
3381: x_complete_rec.deduction_attribute11 := l_claim_rec.deduction_attribute11;
3379: END IF;
3380: IF p_claim_rec.deduction_attribute11 IS NULL THEN
3381: x_complete_rec.deduction_attribute11 := l_claim_rec.deduction_attribute11;
3382: END IF;
3383: IF p_claim_rec.deduction_attribute12 = FND_API.G_MISS_CHAR THEN
3384: x_complete_rec.deduction_attribute12 := NULL;
3385: END IF;
3386: IF p_claim_rec.deduction_attribute12 IS NULL THEN
3387: x_complete_rec.deduction_attribute12 := l_claim_rec.deduction_attribute12;
3385: END IF;
3386: IF p_claim_rec.deduction_attribute12 IS NULL THEN
3387: x_complete_rec.deduction_attribute12 := l_claim_rec.deduction_attribute12;
3388: END IF;
3389: IF p_claim_rec.deduction_attribute13 = FND_API.G_MISS_CHAR THEN
3390: x_complete_rec.deduction_attribute13 := NULL;
3391: END IF;
3392: IF p_claim_rec.deduction_attribute13 IS NULL THEN
3393: x_complete_rec.deduction_attribute13 := l_claim_rec.deduction_attribute13;
3391: END IF;
3392: IF p_claim_rec.deduction_attribute13 IS NULL THEN
3393: x_complete_rec.deduction_attribute13 := l_claim_rec.deduction_attribute13;
3394: END IF;
3395: IF p_claim_rec.deduction_attribute14 = FND_API.G_MISS_CHAR THEN
3396: x_complete_rec.deduction_attribute14 := NULL;
3397: END IF;
3398: IF p_claim_rec.deduction_attribute14 IS NULL THEN
3399: x_complete_rec.deduction_attribute14 := l_claim_rec.deduction_attribute14;
3397: END IF;
3398: IF p_claim_rec.deduction_attribute14 IS NULL THEN
3399: x_complete_rec.deduction_attribute14 := l_claim_rec.deduction_attribute14;
3400: END IF;
3401: IF p_claim_rec.deduction_attribute15 = FND_API.G_MISS_CHAR THEN
3402: x_complete_rec.deduction_attribute15 := NULL;
3403: END IF;
3404: IF p_claim_rec.deduction_attribute15 IS NULL THEN
3405: x_complete_rec.deduction_attribute15 := l_claim_rec.deduction_attribute15;
3403: END IF;
3404: IF p_claim_rec.deduction_attribute15 IS NULL THEN
3405: x_complete_rec.deduction_attribute15 := l_claim_rec.deduction_attribute15;
3406: END IF;
3407: IF p_claim_rec.org_id = FND_API.G_MISS_NUM THEN
3408: x_complete_rec.org_id := NULL;
3409: END IF;
3410: IF p_claim_rec.org_id IS NULL THEN
3411: x_complete_rec.org_id := l_claim_rec.org_id;
3410: IF p_claim_rec.org_id IS NULL THEN
3411: x_complete_rec.org_id := l_claim_rec.org_id;
3412: END IF;
3413: -- Added by Kishore
3414: IF p_claim_rec.legal_entity_id = FND_API.G_MISS_NUM THEN
3415: x_complete_rec.legal_entity_id := NULL;
3416: END IF;
3417: IF p_claim_rec.legal_entity_id IS NULL THEN
3418: x_complete_rec.legal_entity_id := l_claim_rec.legal_entity_id;
3417: IF p_claim_rec.legal_entity_id IS NULL THEN
3418: x_complete_rec.legal_entity_id := l_claim_rec.legal_entity_id;
3419: END IF;
3420: --Auto Write-off changes (Added by Uday Poluri)
3421: IF p_claim_rec.write_off_flag = FND_API.G_MISS_CHAR THEN
3422: x_complete_rec.write_off_flag := NULL;
3423: END IF;
3424: IF p_claim_rec.write_off_flag IS NULL THEN
3425: x_complete_rec.write_off_flag := l_claim_rec.write_off_flag;
3424: IF p_claim_rec.write_off_flag IS NULL THEN
3425: x_complete_rec.write_off_flag := l_claim_rec.write_off_flag;
3426: END IF;
3427:
3428: IF p_claim_rec.write_off_threshold_amount = FND_API.G_MISS_NUM THEN
3429: x_complete_rec.write_off_threshold_amount := NULL;
3430: END IF;
3431: IF p_claim_rec.write_off_threshold_amount IS NULL THEN
3432: x_complete_rec.write_off_threshold_amount := l_claim_rec.write_off_threshold_amount;
3431: IF p_claim_rec.write_off_threshold_amount IS NULL THEN
3432: x_complete_rec.write_off_threshold_amount := l_claim_rec.write_off_threshold_amount;
3433: END IF;
3434:
3435: IF p_claim_rec.under_write_off_threshold = FND_API.G_MISS_CHAR THEN
3436: x_complete_rec.under_write_off_threshold := NULL;
3437: END IF;
3438: IF p_claim_rec.under_write_off_threshold IS NULL THEN
3439: x_complete_rec.under_write_off_threshold := l_claim_rec.under_write_off_threshold;
3438: IF p_claim_rec.under_write_off_threshold IS NULL THEN
3439: x_complete_rec.under_write_off_threshold := l_claim_rec.under_write_off_threshold;
3440: END IF;
3441:
3442: IF p_claim_rec.customer_reason = FND_API.G_MISS_CHAR THEN
3443: x_complete_rec.customer_reason := NULL;
3444: END IF;
3445: IF p_claim_rec.customer_reason IS NULL THEN
3446: x_complete_rec.customer_reason := l_claim_rec.customer_reason;
3445: IF p_claim_rec.customer_reason IS NULL THEN
3446: x_complete_rec.customer_reason := l_claim_rec.customer_reason;
3447: END IF;
3448:
3449: IF p_claim_rec.ship_to_cust_account_id = FND_API.G_MISS_NUM THEN
3450: x_complete_rec.ship_to_cust_account_id := NULL;
3451: END IF;
3452: IF p_claim_rec.ship_to_cust_account_id IS NULL THEN
3453: x_complete_rec.ship_to_cust_account_id := l_claim_rec.ship_to_cust_account_id;
3454: END IF;
3455: --End of Auto Write-off changes (Added by Uday Poluri)
3456:
3457: -- Start Bug:2781186 (Subsequent Receipt Application changes)
3458: IF p_claim_rec.amount_applied = FND_API.G_MISS_NUM THEN
3459: x_complete_rec.amount_applied := NULL;
3460: END IF;
3461: IF p_claim_rec.amount_applied IS NULL THEN
3462: x_complete_rec.amount_applied := l_claim_rec.amount_applied;
3461: IF p_claim_rec.amount_applied IS NULL THEN
3462: x_complete_rec.amount_applied := l_claim_rec.amount_applied;
3463: END IF;
3464:
3465: IF p_claim_rec.applied_receipt_id = FND_API.G_MISS_NUM THEN
3466: x_complete_rec.applied_receipt_id := NULL;
3467: END IF;
3468: IF p_claim_rec.applied_receipt_id IS NULL THEN
3469: x_complete_rec.applied_receipt_id := l_claim_rec.applied_receipt_id;
3468: IF p_claim_rec.applied_receipt_id IS NULL THEN
3469: x_complete_rec.applied_receipt_id := l_claim_rec.applied_receipt_id;
3470: END IF;
3471:
3472: IF p_claim_rec.applied_receipt_number = FND_API.G_MISS_CHAR THEN
3473: x_complete_rec.applied_receipt_number := NULL;
3474: END IF;
3475: IF p_claim_rec.applied_receipt_number IS NULL THEN
3476: x_complete_rec.applied_receipt_number := l_claim_rec.applied_receipt_number;
3475: IF p_claim_rec.applied_receipt_number IS NULL THEN
3476: x_complete_rec.applied_receipt_number := l_claim_rec.applied_receipt_number;
3477: END IF;
3478: -- End Bug:2781186
3479: IF p_claim_rec.wo_rec_trx_id = FND_API.G_MISS_NUM THEN
3480: x_complete_rec.wo_rec_trx_id := NULL;
3481: END IF;
3482: IF p_claim_rec.wo_rec_trx_id IS NULL THEN
3483: x_complete_rec.wo_rec_trx_id := l_claim_rec.wo_rec_trx_id;
3483: x_complete_rec.wo_rec_trx_id := l_claim_rec.wo_rec_trx_id;
3484: END IF;
3485:
3486:
3487: IF p_claim_rec.group_claim_id = FND_API.G_MISS_NUM THEN
3488: x_complete_rec.group_claim_id := NULL;
3489: END IF;
3490: IF p_claim_rec.group_claim_id IS NULL THEN
3491: x_complete_rec.group_claim_id := l_claim_rec.group_claim_id;
3489: END IF;
3490: IF p_claim_rec.group_claim_id IS NULL THEN
3491: x_complete_rec.group_claim_id := l_claim_rec.group_claim_id;
3492: END IF;
3493: IF p_claim_rec.appr_wf_item_key = FND_API.G_MISS_CHAR THEN
3494: x_complete_rec.appr_wf_item_key := NULL;
3495: END IF;
3496: IF p_claim_rec.appr_wf_item_key IS NULL THEN
3497: x_complete_rec.appr_wf_item_key := l_claim_rec.appr_wf_item_key;
3495: END IF;
3496: IF p_claim_rec.appr_wf_item_key IS NULL THEN
3497: x_complete_rec.appr_wf_item_key := l_claim_rec.appr_wf_item_key;
3498: END IF;
3499: IF p_claim_rec.cstl_wf_item_key = FND_API.G_MISS_CHAR THEN
3500: x_complete_rec.cstl_wf_item_key := NULL;
3501: END IF;
3502: IF p_claim_rec.cstl_wf_item_key IS NULL THEN
3503: x_complete_rec.cstl_wf_item_key := l_claim_rec.cstl_wf_item_key;
3501: END IF;
3502: IF p_claim_rec.cstl_wf_item_key IS NULL THEN
3503: x_complete_rec.cstl_wf_item_key := l_claim_rec.cstl_wf_item_key;
3504: END IF;
3505: IF p_claim_rec.batch_type = FND_API.G_MISS_CHAR THEN
3506: x_complete_rec.batch_type := NULL;
3507: END IF;
3508: IF p_claim_rec.batch_type IS NULL THEN
3509: x_complete_rec.batch_type := l_claim_rec.batch_type;
3508: IF p_claim_rec.batch_type IS NULL THEN
3509: x_complete_rec.batch_type := l_claim_rec.batch_type;
3510: END IF;
3511:
3512: IF p_claim_rec.created_from = FND_API.G_MISS_CHAR THEN
3513: x_complete_rec.created_from := NULL;
3514: END IF;
3515: IF p_claim_rec.created_from IS NULL THEN
3516: x_complete_rec.created_from := l_claim_rec.created_from;
3515: IF p_claim_rec.created_from IS NULL THEN
3516: x_complete_rec.created_from := l_claim_rec.created_from;
3517: END IF;
3518:
3519: IF p_claim_rec.program_id = FND_API.G_MISS_NUM THEN
3520: x_complete_rec.program_id := NULL;
3521: END IF;
3522: IF p_claim_rec.program_id IS NULL THEN
3523: x_complete_rec.program_id := l_claim_rec.program_id;
3522: IF p_claim_rec.program_id IS NULL THEN
3523: x_complete_rec.program_id := l_claim_rec.program_id;
3524: END IF;
3525:
3526: IF p_claim_rec.program_update_date = FND_API.G_MISS_DATE THEN
3527: x_complete_rec.program_update_date := NULL;
3528: END IF;
3529: IF p_claim_rec.program_update_date IS NULL THEN
3530: x_complete_rec.program_update_date := l_claim_rec.program_update_date;
3529: IF p_claim_rec.program_update_date IS NULL THEN
3530: x_complete_rec.program_update_date := l_claim_rec.program_update_date;
3531: END IF;
3532:
3533: IF p_claim_rec.program_application_id = FND_API.G_MISS_NUM THEN
3534: x_complete_rec.program_application_id := NULL;
3535: END IF;
3536: IF p_claim_rec.program_application_id IS NULL THEN
3537: x_complete_rec.program_application_id := l_claim_rec.program_application_id;
3536: IF p_claim_rec.program_application_id IS NULL THEN
3537: x_complete_rec.program_application_id := l_claim_rec.program_application_id;
3538: END IF;
3539:
3540: IF p_claim_rec.request_id = FND_API.G_MISS_NUM THEN
3541: x_complete_rec.request_id := NULL;
3542: END IF;
3543: IF p_claim_rec.request_id IS NULL THEN
3544: x_complete_rec.request_id := l_claim_rec.request_id;
3543: IF p_claim_rec.request_id IS NULL THEN
3544: x_complete_rec.request_id := l_claim_rec.request_id;
3545: END IF;
3546: -- For Rule Based Settlement
3547: IF p_claim_rec.pre_auth_deduction_number = FND_API.G_MISS_CHAR THEN
3548: x_complete_rec.pre_auth_deduction_number := NULL;
3549: END IF;
3550: IF p_claim_rec.pre_auth_deduction_number IS NULL THEN
3551: x_complete_rec.pre_auth_deduction_number := l_claim_rec.pre_auth_deduction_number;
3550: IF p_claim_rec.pre_auth_deduction_number IS NULL THEN
3551: x_complete_rec.pre_auth_deduction_number := l_claim_rec.pre_auth_deduction_number;
3552: END IF;
3553:
3554: IF p_claim_rec.pre_auth_deduction_normalized = FND_API.G_MISS_CHAR THEN
3555: x_complete_rec.pre_auth_deduction_normalized := NULL;
3556: END IF;
3557: IF p_claim_rec.pre_auth_deduction_normalized IS NULL THEN
3558: x_complete_rec.pre_auth_deduction_normalized := l_claim_rec.pre_auth_deduction_normalized;
3557: IF p_claim_rec.pre_auth_deduction_normalized IS NULL THEN
3558: x_complete_rec.pre_auth_deduction_normalized := l_claim_rec.pre_auth_deduction_normalized;
3559: END IF;
3560:
3561: IF p_claim_rec.offer_id = FND_API.G_MISS_NUM THEN
3562: x_complete_rec.offer_id := NULL;
3563: END IF;
3564: IF p_claim_rec.offer_id IS NULL THEN
3565: x_complete_rec.offer_id := l_claim_rec.offer_id;
3564: IF p_claim_rec.offer_id IS NULL THEN
3565: x_complete_rec.offer_id := l_claim_rec.offer_id;
3566: END IF;
3567:
3568: IF p_claim_rec.settled_from = FND_API.G_MISS_CHAR THEN
3569: x_complete_rec.settled_from := NULL;
3570: END IF;
3571: IF p_claim_rec.settled_from IS NULL THEN
3572: x_complete_rec.settled_from := l_claim_rec.settled_from;
3571: IF p_claim_rec.settled_from IS NULL THEN
3572: x_complete_rec.settled_from := l_claim_rec.settled_from;
3573: END IF;
3574:
3575: IF p_claim_rec.approval_in_prog = FND_API.G_MISS_CHAR THEN
3576: x_complete_rec.approval_in_prog := NULL;
3577: END IF;
3578: IF p_claim_rec.approval_in_prog IS NULL THEN
3579: x_complete_rec.approval_in_prog := l_claim_rec.approval_in_prog;
3579: x_complete_rec.approval_in_prog := l_claim_rec.approval_in_prog;
3580: END IF;
3581:
3582: EXCEPTION
3583: WHEN FND_API.G_EXC_ERROR THEN
3584: x_return_status := FND_API.G_RET_STS_ERROR;
3585: WHEN OTHERS THEN
3586: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
3587: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_COMPLETE_ERROR');
3580: END IF;
3581:
3582: EXCEPTION
3583: WHEN FND_API.G_EXC_ERROR THEN
3584: x_return_status := FND_API.G_RET_STS_ERROR;
3585: WHEN OTHERS THEN
3586: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
3587: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_COMPLETE_ERROR');
3588: FND_MSG_PUB.add;
3586: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
3587: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_COMPLETE_ERROR');
3588: FND_MSG_PUB.add;
3589: END IF;
3590: x_return_status := FND_API.g_ret_sts_unexp_error;
3591: END Complete_Claim_Rec;
3592:
3593: ---------------------------------------------------------------------
3594: -- PROCEDURE
3609: -- the sequence.
3610: -- 4. If a flag column is passed in, check if it is 'Y' or 'N'.
3611: -- Raise exception for invalid flag.
3612: -- 5. If a flag column is not passed in, default it to 'Y'.
3613: -- 6. Please don't pass in any FND_API.g_mess_char/num/date.
3614: -- 7. The program assumes that the cust_account_id and
3615: -- cust_billto_acct_site_id that passed in the program are valid
3616: --
3617: -- HISTORY
3620: -- if Chargeback Budget is set in different currency.
3621: -----------------------------------------------------------------------------------------
3622: PROCEDURE Create_Claim (
3623: p_api_version IN NUMBER
3624: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
3625: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
3626: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
3627:
3628: ,x_return_status OUT NOCOPY VARCHAR2
3621: -----------------------------------------------------------------------------------------
3622: PROCEDURE Create_Claim (
3623: p_api_version IN NUMBER
3624: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
3625: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
3626: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
3627:
3628: ,x_return_status OUT NOCOPY VARCHAR2
3629: ,x_msg_data OUT NOCOPY VARCHAR2
3622: PROCEDURE Create_Claim (
3623: p_api_version IN NUMBER
3624: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
3625: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
3626: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
3627:
3628: ,x_return_status OUT NOCOPY VARCHAR2
3629: ,x_msg_data OUT NOCOPY VARCHAR2
3630: ,x_msg_count OUT NOCOPY NUMBER
3859:
3860: -- Standard begin of API savepoint
3861: SAVEPOINT Create_Claim_PVT;
3862: -- Standard call to check for call compatibility.
3863: IF NOT FND_API.Compatible_API_Call (
3864: l_api_version,
3865: p_api_version,
3866: l_api_name,
3867: G_PKG_NAME)
3865: p_api_version,
3866: l_api_name,
3867: G_PKG_NAME)
3868: THEN
3869: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3870: END IF;
3871: -- Debug Message
3872: IF OZF_DEBUG_LOW_ON THEN
3873: FND_MESSAGE.Set_Name('OZF','OZF_API_DEBUG_MESSAGE');
3874: FND_MESSAGE.Set_Token('TEXT',l_full_name||': Start');
3875: FND_MSG_PUB.Add;
3876: END IF;
3877: --Initialize message list if p_init_msg_list is TRUE.
3878: IF FND_API.To_Boolean (p_init_msg_list) THEN
3879: FND_MSG_PUB.initialize;
3880: END IF;
3881:
3882: -- Initialize API return status to sucess
3879: FND_MSG_PUB.initialize;
3880: END IF;
3881:
3882: -- Initialize API return status to sucess
3883: x_return_status := FND_API.G_RET_STS_SUCCESS;
3884:
3885: -- Bug#9670818(+)
3886: OPEN csr_batch_type (l_claim.batch_id);
3887: FETCH csr_batch_type INTO l_batch_type, l_report_date;
3889: -- Bug#9670818(-)
3890:
3891: -- Default claim_class
3892: IF (l_claim.claim_class is null OR
3893: l_claim.claim_class = FND_API.G_MISS_CHAR) THEN
3894: if l_claim.amount >0 then
3895: l_claim.claim_class := G_CLAIM_CLASS;
3896: else
3897: l_claim.claim_class := G_CHARGE_CLASS;
3909: THEN
3910: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_CLAIM_CLASS_WRG');
3911: FND_MSG_PUB.add;
3912: END IF;
3913: RAISE FND_API.G_EXC_ERROR;
3914: END IF;
3915: END IF;
3916:
3917: IF l_claim.cust_account_id is NULL OR
3914: END IF;
3915: END IF;
3916:
3917: IF l_claim.cust_account_id is NULL OR
3918: l_claim.cust_account_id = FND_API.G_MISS_NUM
3919: THEN
3920: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3921: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_CUST_ID_MISSING');
3922: FND_MSG_PUB.Add;
3920: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
3921: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_CUST_ID_MISSING');
3922: FND_MSG_PUB.Add;
3923: END IF;
3924: RAISE FND_API.G_EXC_ERROR;
3925: END IF;
3926:
3927: --Call Get Customer Reason to get the reason code
3928: --if the customer reason is not null.
3926:
3927: --Call Get Customer Reason to get the reason code
3928: --if the customer reason is not null.
3929: IF (l_claim.reason_code_id is NULL
3930: OR l_claim.reason_code_id = FND_API.G_MISS_NUM)
3931: AND (l_claim.customer_reason is NOT NULL
3932: AND l_claim.customer_reason <> FND_API.G_MISS_CHAR)
3933: THEN
3934: Get_Customer_Reason(p_cust_account_id => l_claim.cust_account_id,
3928: --if the customer reason is not null.
3929: IF (l_claim.reason_code_id is NULL
3930: OR l_claim.reason_code_id = FND_API.G_MISS_NUM)
3931: AND (l_claim.customer_reason is NOT NULL
3932: AND l_claim.customer_reason <> FND_API.G_MISS_CHAR)
3933: THEN
3934: Get_Customer_Reason(p_cust_account_id => l_claim.cust_account_id,
3935: px_reason_code_id => l_claim.reason_code_id,
3936: p_customer_reason => l_claim.customer_reason,
3940: --retrieve the reason code. Instead default it from the Claim Defaults.
3941: IF l_claim.claim_class <> G_DEDUCTION_CLASS AND
3942: l_claim.claim_class <> G_OVERPAYMENT_CLASS
3943: THEN
3944: IF l_return_status = FND_API.g_ret_sts_error
3945: THEN
3946: RAISE FND_API.g_exc_error;
3947: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
3948: RAISE FND_API.g_exc_unexpected_error;
3942: l_claim.claim_class <> G_OVERPAYMENT_CLASS
3943: THEN
3944: IF l_return_status = FND_API.g_ret_sts_error
3945: THEN
3946: RAISE FND_API.g_exc_error;
3947: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
3948: RAISE FND_API.g_exc_unexpected_error;
3949: END IF;
3950: END IF;
3943: THEN
3944: IF l_return_status = FND_API.g_ret_sts_error
3945: THEN
3946: RAISE FND_API.g_exc_error;
3947: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
3948: RAISE FND_API.g_exc_unexpected_error;
3949: END IF;
3950: END IF;
3951: END IF;
3944: IF l_return_status = FND_API.g_ret_sts_error
3945: THEN
3946: RAISE FND_API.g_exc_error;
3947: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
3948: RAISE FND_API.g_exc_unexpected_error;
3949: END IF;
3950: END IF;
3951: END IF;
3952: --end of get_customer_reason if block.
3960: x_return_status => l_return_status,
3961: x_msg_count => l_msg_count,
3962: x_msg_data => l_msg_data);
3963:
3964: IF l_return_status = FND_API.g_ret_sts_error THEN
3965: RAISE FND_API.G_EXC_ERROR;
3966: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
3967: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3968: END IF;
3961: x_msg_count => l_msg_count,
3962: x_msg_data => l_msg_data);
3963:
3964: IF l_return_status = FND_API.g_ret_sts_error THEN
3965: RAISE FND_API.G_EXC_ERROR;
3966: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
3967: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3968: END IF;
3969:
3962: x_msg_data => l_msg_data);
3963:
3964: IF l_return_status = FND_API.g_ret_sts_error THEN
3965: RAISE FND_API.G_EXC_ERROR;
3966: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
3967: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3968: END IF;
3969:
3970: --Default custom setup Id
3963:
3964: IF l_return_status = FND_API.g_ret_sts_error THEN
3965: RAISE FND_API.G_EXC_ERROR;
3966: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
3967: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3968: END IF;
3969:
3970: --Default custom setup Id
3971: IF l_claim.custom_setup_id IS NULL
3968: END IF;
3969:
3970: --Default custom setup Id
3971: IF l_claim.custom_setup_id IS NULL
3972: OR l_claim.custom_setup_id = FND_API.G_MISS_NUM
3973: THEN
3974: l_claim.custom_setup_id := l_clam_def_rec_type.custom_setup_id;
3975: END IF;
3976:
3974: l_claim.custom_setup_id := l_clam_def_rec_type.custom_setup_id;
3975: END IF;
3976:
3977: IF l_claim.custom_setup_id is NULL OR
3978: l_claim.custom_setup_id = FND_API.G_MISS_NUM
3979: THEN
3980: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error)
3981: THEN
3982: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_CUST_SETUP_MISSING');
3981: THEN
3982: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_CUST_SETUP_MISSING');
3983: FND_MSG_PUB.add;
3984: END IF;
3985: RAISE FND_API.G_EXC_ERROR;
3986: END IF;
3987:
3988:
3989: --Default Claim type Id.
3987:
3988:
3989: --Default Claim type Id.
3990: IF l_claim.claim_type_id IS NULL
3991: OR l_claim.claim_type_id = FND_API.G_MISS_NUM
3992: THEN
3993: l_claim.claim_type_id := l_clam_def_rec_type.claim_type_id;
3994: END IF;
3995:
3993: l_claim.claim_type_id := l_clam_def_rec_type.claim_type_id;
3994: END IF;
3995:
3996: IF l_claim.claim_type_id is NULL OR
3997: l_claim.claim_type_id = FND_API.G_MISS_NUM
3998: THEN
3999: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
4000: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_CLAIM_TYPE_MISSING');
4001: FND_MSG_PUB.Add;
3999: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
4000: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_CLAIM_TYPE_MISSING');
4001: FND_MSG_PUB.Add;
4002: END IF;
4003: RAISE FND_API.G_EXC_ERROR;
4004: END IF;
4005:
4006:
4007: --Default reason code
4005:
4006:
4007: --Default reason code
4008: IF (l_claim.reason_code_id IS NULL
4009: OR l_claim.reason_code_id = FND_API.G_MISS_NUM)
4010: THEN
4011: l_claim.reason_code_id := l_clam_def_rec_type.reason_code_id;
4012: END IF;
4013:
4018: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
4019: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_REASON_CD_MISSING');
4020: FND_MSG_PUB.Add;
4021: END IF;
4022: RAISE FND_API.G_EXC_ERROR;
4023: END IF;
4024: --End of defalting values from Claim defaults.
4025:
4026:
4024: --End of defalting values from Claim defaults.
4025:
4026:
4027: IF (l_claim.amount is NULL OR
4028: l_claim.amount = FND_API.G_MISS_NUM OR
4029: l_claim.amount = 0) AND
4030: l_claim.claim_class <>'GROUP' THEN
4031:
4032: IF OZF_DEBUG_LOW_ON THEN
4038: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
4039: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_AMOUNT_MISSING');
4040: FND_MSG_PUB.Add;
4041: END IF;
4042: RAISE FND_API.G_EXC_ERROR;
4043: END IF;
4044:
4045: -- Now we will default some values for this claim record
4046: --
4052: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
4053: fnd_message.set_name('OZF', 'OZF_CLAIM_ORG_ID_MISSING');
4054: fnd_msg_pub.add;
4055: END IF;
4056: RAISE fnd_api.g_exc_error;
4057: END IF;
4058: CLOSE org_id_csr;
4059: l_claim.org_id := l_org_id; */
4060:
4076: END IF;
4077:
4078: -- BUG 4600325 is fixed.
4079: IF l_claim.legal_entity_id is NULL OR
4080: l_claim.legal_entity_id = FND_API.G_MISS_NUM
4081: THEN
4082: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
4083: FND_MESSAGE.Set_Name('OZF','OZF_LE_FOR_CLAIM_MISSING');
4084: FND_MSG_PUB.Add;
4082: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
4083: FND_MESSAGE.Set_Name('OZF','OZF_LE_FOR_CLAIM_MISSING');
4084: FND_MSG_PUB.Add;
4085: END IF;
4086: RAISE FND_API.G_EXC_ERROR;
4087: END IF;
4088:
4089: -- get sob
4090: OPEN sob_csr;
4095:
4096:
4097: -- Default claim_number if it's null
4098: IF ((l_claim.claim_number is null) OR
4099: (l_claim.claim_number = FND_API.G_MISS_CHAR))THEN
4100:
4101: Get_Claim_Number(
4102: p_split_from_claim_id => l_claim.split_from_claim_id,
4103: p_custom_setup_id => l_claim.custom_setup_id,
4105: x_msg_data => l_msg_data,
4106: x_msg_count => l_msg_count,
4107: x_return_status=> l_return_status
4108: );
4109: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4110: RAISE FND_API.G_EXC_ERROR;
4111: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4112: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4113: END IF;
4106: x_msg_count => l_msg_count,
4107: x_return_status=> l_return_status
4108: );
4109: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4110: RAISE FND_API.G_EXC_ERROR;
4111: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4112: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4113: END IF;
4114:
4107: x_return_status=> l_return_status
4108: );
4109: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4110: RAISE FND_API.G_EXC_ERROR;
4111: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4112: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4113: END IF;
4114:
4115: l_claim.claim_number := l_claim_number;
4108: );
4109: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4110: RAISE FND_API.G_EXC_ERROR;
4111: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4112: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4113: END IF;
4114:
4115: l_claim.claim_number := l_claim_number;
4116: ELSE
4123: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
4124: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_DUP_CLAIM_NUM');
4125: FND_MSG_PUB.add;
4126: END IF;
4127: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4128: END IF;
4129: END IF;
4130:
4131: -- Default CLAIM_DATE if it's null
4129: END IF;
4130:
4131: -- Default CLAIM_DATE if it's null
4132: IF (l_claim.claim_date is null OR
4133: l_claim.claim_date = FND_API.G_MISS_DATE)THEN
4134: l_claim.claim_date := TRUNC(sysdate);
4135: END IF;
4136:
4137: -- get customer info from trade profile
4146: END IF;
4147:
4148: -- Default vendor info
4149: IF l_claim.vendor_id is null OR
4150: l_claim.vendor_id = FND_API.G_MISS_NUM THEN
4151: --Bug 16301629 not defaulting vendor information, if vendor or vendor site is inactive.
4152: IF l_trade_profile.vendor_id is not null AND
4153: l_trade_profile.vendor_site_id is not null THEN
4154: OPEN csr_active_vendor(l_trade_profile.vendor_id, l_trade_profile.vendor_site_id);
4159: l_claim.vendor_site_id := null;
4160: ELSE
4161: l_claim.vendor_id := l_trade_profile.vendor_id;
4162: IF l_claim.vendor_site_id is null OR
4163: l_claim.vendor_site_id = FND_API.G_MISS_NUM THEN
4164: l_claim.vendor_site_id := l_trade_profile.vendor_site_id;
4165: END IF;
4166: END IF; --l_active_vendor_num is null
4167: END IF;--l_trade_profile.vendor_id is not null ..
4168: END IF;--l_claim.vndor_id is null
4169:
4170: -- Default DUE_DATE if it's null
4171: /*IF (l_claim.DUE_DATE is null OR
4172: l_claim.due_date = FND_API.G_MISS_DATE) THEN
4173:
4174: get_days_due (p_cust_accout_id => l_claim.cust_account_id,
4175: x_days_due => l_days_due,
4176: x_return_status => l_return_status);
4173:
4174: get_days_due (p_cust_accout_id => l_claim.cust_account_id,
4175: x_days_due => l_days_due,
4176: x_return_status => l_return_status);
4177: IF l_return_status = FND_API.g_ret_sts_error THEN
4178: RAISE FND_API.g_exc_error;
4179: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4180: RAISE FND_API.g_exc_unexpected_error;
4181: END IF;
4174: get_days_due (p_cust_accout_id => l_claim.cust_account_id,
4175: x_days_due => l_days_due,
4176: x_return_status => l_return_status);
4177: IF l_return_status = FND_API.g_ret_sts_error THEN
4178: RAISE FND_API.g_exc_error;
4179: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4180: RAISE FND_API.g_exc_unexpected_error;
4181: END IF;
4182: l_claim.DUE_DATE := TRUNC(l_claim.claim_date + l_days_due);
4175: x_days_due => l_days_due,
4176: x_return_status => l_return_status);
4177: IF l_return_status = FND_API.g_ret_sts_error THEN
4178: RAISE FND_API.g_exc_error;
4179: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4180: RAISE FND_API.g_exc_unexpected_error;
4181: END IF;
4182: l_claim.DUE_DATE := TRUNC(l_claim.claim_date + l_days_due);
4183: END IF;
4176: x_return_status => l_return_status);
4177: IF l_return_status = FND_API.g_ret_sts_error THEN
4178: RAISE FND_API.g_exc_error;
4179: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4180: RAISE FND_API.g_exc_unexpected_error;
4181: END IF;
4182: l_claim.DUE_DATE := TRUNC(l_claim.claim_date + l_days_due);
4183: END IF;
4184: */
4187: l_claim.DUE_DATE := l_claim.claim_date;
4188:
4189: -- Default user_status_id if it's null
4190: IF (l_claim.user_status_id is null OR
4191: l_claim.user_status_id = FND_API.G_MISS_NUM) THEN
4192:
4193: -- Commented for Rule Based Settlement
4194: /*IF (l_claim.offer_id IS NOT NULL AND l_claim.claim_class = 'CLAIM') THEN
4195: l_claim.user_status_id := to_number( ozf_utility_pvt.GET_DEFAULT_USER_STATUS(
4212: l_claim.TASK_TEMPLATE_GROUP_ID := get_action_id(l_claim.reason_code_id);
4213:
4214: -- Default status_code according to user_status_id if it's null
4215: IF (l_claim.status_code is null OR
4216: l_claim.status_code = FND_API.G_MISS_CHAR) THEN
4217: Get_System_Status( p_user_status_id => l_claim.user_status_id,
4218: p_status_type => G_CLAIM_STATUS,
4219: x_system_status => l_status_code,
4220: x_msg_data => l_msg_data,
4230: -----------------* Deal with customer information *---------------------------
4231: get_customer_info (p_claim => l_claim,
4232: x_claim => l_complete_claim,
4233: x_return_status => l_return_status);
4234: IF l_return_status = FND_API.g_ret_sts_error THEN
4235: RAISE FND_API.g_exc_error;
4236: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4237: RAISE FND_API.g_exc_unexpected_error;
4238: END IF;
4231: get_customer_info (p_claim => l_claim,
4232: x_claim => l_complete_claim,
4233: x_return_status => l_return_status);
4234: IF l_return_status = FND_API.g_ret_sts_error THEN
4235: RAISE FND_API.g_exc_error;
4236: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4237: RAISE FND_API.g_exc_unexpected_error;
4238: END IF;
4239:
4232: x_claim => l_complete_claim,
4233: x_return_status => l_return_status);
4234: IF l_return_status = FND_API.g_ret_sts_error THEN
4235: RAISE FND_API.g_exc_error;
4236: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4237: RAISE FND_API.g_exc_unexpected_error;
4238: END IF;
4239:
4240: l_claim := l_complete_claim;
4233: x_return_status => l_return_status);
4234: IF l_return_status = FND_API.g_ret_sts_error THEN
4235: RAISE FND_API.g_exc_error;
4236: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4237: RAISE FND_API.g_exc_unexpected_error;
4238: END IF;
4239:
4240: l_claim := l_complete_claim;
4241:
4240: l_claim := l_complete_claim;
4241:
4242: -- Default broker if it's null
4243: -- IF (l_claim.BROKER_ID is null OR
4244: -- l_claim.broker_id = FND_API.G_MISS_NUM)THEN
4245: -- OPEN broker_id_csr(l_claim.cust_account_id);
4246: -- FETCH broker_id_csr INTO l_broker_id;
4247: -- CLOSE broker_id_csr;
4248: -- l_claim.broker_id := l_broker_id;
4254: -- If it is then call the get owner routine.
4255: -- If there is still no owner after this. get the owner from sys parameter and add it to access list
4256:
4257: IF (l_claim.owner_id is not null AND
4258: l_claim.owner_id <> FND_API.G_MISS_NUM) THEN
4259:
4260: l_access_list(1).arc_act_access_to_object := G_CLAIM_OBJECT_TYPE;
4261: l_access_list(1).user_or_role_id := l_claim.owner_id;
4262: l_access_list(1).arc_user_or_role_type := 'USER';
4284: p_claim_class => l_claim.claim_class,
4285: x_owner_id => l_default_owner, --l_claim.owner_id, [BUG 3835800 Fixing]
4286: x_access_list => l_access_list,
4287: x_return_status => l_return_status);
4288: IF l_return_status = FND_API.g_ret_sts_error THEN
4289: RAISE FND_API.g_exc_error;
4290: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4291: RAISE FND_API.g_exc_unexpected_error;
4292: END IF;
4285: x_owner_id => l_default_owner, --l_claim.owner_id, [BUG 3835800 Fixing]
4286: x_access_list => l_access_list,
4287: x_return_status => l_return_status);
4288: IF l_return_status = FND_API.g_ret_sts_error THEN
4289: RAISE FND_API.g_exc_error;
4290: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4291: RAISE FND_API.g_exc_unexpected_error;
4292: END IF;
4293: l_claim.owner_id := l_default_owner; -- [BUG 3835800 Fixing]
4286: x_access_list => l_access_list,
4287: x_return_status => l_return_status);
4288: IF l_return_status = FND_API.g_ret_sts_error THEN
4289: RAISE FND_API.g_exc_error;
4290: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4291: RAISE FND_API.g_exc_unexpected_error;
4292: END IF;
4293: l_claim.owner_id := l_default_owner; -- [BUG 3835800 Fixing]
4294: END IF;
4287: x_return_status => l_return_status);
4288: IF l_return_status = FND_API.g_ret_sts_error THEN
4289: RAISE FND_API.g_exc_error;
4290: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4291: RAISE FND_API.g_exc_unexpected_error;
4292: END IF;
4293: l_claim.owner_id := l_default_owner; -- [BUG 3835800 Fixing]
4294: END IF;
4295: IF (l_claim.owner_id is null OR
4292: END IF;
4293: l_claim.owner_id := l_default_owner; -- [BUG 3835800 Fixing]
4294: END IF;
4295: IF (l_claim.owner_id is null OR
4296: l_claim.owner_id = FND_API.G_MISS_NUM) THEN
4297: OPEN default_owner_id_csr;
4298: FETCH default_owner_id_csr into l_claim.owner_id;
4299: CLOSE default_owner_id_csr;
4300:
4338: l_claim.acctd_amount_adjusted := 0;
4339: l_claim.acctd_amount_settled := 0;
4340:
4341: IF (l_claim.amount is NULL OR
4342: l_claim.amount = FND_API.G_MISS_NUM) THEN
4343: l_claim.amount := 0;
4344: END IF;
4345: l_claim.amount_remaining := l_claim.amount;
4346:
4351:
4352: -- Default the transaction currency code to functional currency code
4353: -- if it's null.
4354: IF (l_claim.currency_code is NULL OR
4355: l_claim.currency_code = FND_API.G_MISS_CHAR)THEN
4356: l_claim.currency_code := l_functional_currency_code;
4357: END IF;
4358:
4359:
4373: l_claim.exchange_rate :=1;
4374: END IF;
4375:
4376: IF l_claim.exchange_rate_type is null OR
4377: l_claim.exchange_rate_type = FND_API.G_MISS_CHAR THEN
4378: OPEN exchange_rate_type_csr;
4379: FETCH exchange_rate_type_csr into l_claim.exchange_rate_type;
4380: CLOSE exchange_rate_type_csr;
4381:
4379: FETCH exchange_rate_type_csr into l_claim.exchange_rate_type;
4380: CLOSE exchange_rate_type_csr;
4381:
4382: IF l_claim.exchange_rate_type is null OR
4383: l_claim.exchange_rate_type = FND_API.G_MISS_CHAR THEN
4384: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
4385: fnd_message.set_name('OZF', 'OZF_CLAIM_CONTYPE_MISSING');
4386: fnd_msg_pub.add;
4387: END IF;
4384: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
4385: fnd_message.set_name('OZF', 'OZF_CLAIM_CONTYPE_MISSING');
4386: fnd_msg_pub.add;
4387: END IF;
4388: RAISE fnd_api.g_exc_error;
4389: END IF;
4390: END IF;
4391:
4392:
4390: END IF;
4391:
4392:
4393: IF l_claim.exchange_rate_date is null OR
4394: l_claim.exchange_rate_date = FND_API.G_MISS_DATE THEN
4395:
4396: -- Default exchange_rate_date to sysdate
4397: l_claim.exchange_rate_date := SYSDATE;
4398: END IF;
4413: l_claim.acctd_amount_remaining := l_claim.acctd_amount;
4414:
4415: --This API call is introduced only to populate the exchange rate.
4416: IF l_claim.exchange_rate IS NULL OR
4417: l_claim.exchange_rate = FND_API.G_MISS_NUM THEN
4418: OZF_UTILITY_PVT.Convert_Currency(
4419: P_SET_OF_BOOKS_ID => l_claim.set_of_books_id,
4420: P_FROM_CURRENCY => l_claim.currency_code,
4421: P_CONVERSION_DATE => l_claim.exchange_rate_date,
4424: P_AMOUNT => l_claim.amount,
4425: X_RETURN_STATUS => l_return_status,
4426: X_ACC_AMOUNT => l_acc_amount,
4427: X_RATE => l_claim.exchange_rate);
4428: IF l_return_status = FND_API.g_ret_sts_error THEN
4429: RAISE FND_API.g_exc_error;
4430: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4431: RAISE FND_API.g_exc_unexpected_error;
4432: END IF;
4425: X_RETURN_STATUS => l_return_status,
4426: X_ACC_AMOUNT => l_acc_amount,
4427: X_RATE => l_claim.exchange_rate);
4428: IF l_return_status = FND_API.g_ret_sts_error THEN
4429: RAISE FND_API.g_exc_error;
4430: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4431: RAISE FND_API.g_exc_unexpected_error;
4432: END IF;
4433: l_acc_amount := NULL;
4426: X_ACC_AMOUNT => l_acc_amount,
4427: X_RATE => l_claim.exchange_rate);
4428: IF l_return_status = FND_API.g_ret_sts_error THEN
4429: RAISE FND_API.g_exc_error;
4430: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4431: RAISE FND_API.g_exc_unexpected_error;
4432: END IF;
4433: l_acc_amount := NULL;
4434: END IF;
4427: X_RATE => l_claim.exchange_rate);
4428: IF l_return_status = FND_API.g_ret_sts_error THEN
4429: RAISE FND_API.g_exc_error;
4430: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4431: RAISE FND_API.g_exc_unexpected_error;
4432: END IF;
4433: l_acc_amount := NULL;
4434: END IF;
4435: END IF;
4459: P_AMOUNT => l_claim.amount,
4460: X_RETURN_STATUS => l_return_status,
4461: X_ACC_AMOUNT => l_acc_amount,
4462: X_RATE => l_rate);
4463: IF l_return_status = FND_API.g_ret_sts_error THEN
4464: RAISE FND_API.g_exc_error;
4465: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4466: RAISE FND_API.g_exc_unexpected_error;
4467: END IF;
4460: X_RETURN_STATUS => l_return_status,
4461: X_ACC_AMOUNT => l_acc_amount,
4462: X_RATE => l_rate);
4463: IF l_return_status = FND_API.g_ret_sts_error THEN
4464: RAISE FND_API.g_exc_error;
4465: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4466: RAISE FND_API.g_exc_unexpected_error;
4467: END IF;
4468: l_claim.exchange_rate := l_rate;
4461: X_ACC_AMOUNT => l_acc_amount,
4462: X_RATE => l_rate);
4463: IF l_return_status = FND_API.g_ret_sts_error THEN
4464: RAISE FND_API.g_exc_error;
4465: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4466: RAISE FND_API.g_exc_unexpected_error;
4467: END IF;
4468: l_claim.exchange_rate := l_rate;
4469: l_claim.ACCTD_AMOUNT := l_acc_amount;
4462: X_RATE => l_rate);
4463: IF l_return_status = FND_API.g_ret_sts_error THEN
4464: RAISE FND_API.g_exc_error;
4465: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4466: RAISE FND_API.g_exc_unexpected_error;
4467: END IF;
4468: l_claim.exchange_rate := l_rate;
4469: l_claim.ACCTD_AMOUNT := l_acc_amount;
4470: l_claim.ACCTD_AMOUNT_REMAINING := l_acc_amount;
4486: --Bug# 7319828 fixed by ateotia(-)
4487:
4488: --Default the Claim_id only if the in coming claim_id is null.
4489: IF l_claim.claim_id is NULL
4490: OR l_claim.claim_id = FND_API.G_MISS_NUM
4491: THEN
4492: --fetch claim_id
4493: OPEN claim_id_csr;
4494: FETCH claim_id_csr INTO l_claim_id;
4515: l_claim_id := l_claim.claim_id;
4516:
4517: -- default root_claim_id
4518: IF l_claim.root_claim_id is NULL OR
4519: l_claim.root_claim_id = FND_API.G_MISS_NUM THEN
4520: l_claim.root_claim_id := l_claim_id;
4521: END IF;
4522:
4523: -- END of default
4523: -- END of default
4524:
4525: -- normalize customer reference number if it isn't null
4526: IF l_claim.customer_ref_number is not NULL AND
4527: l_claim.customer_ref_number <> FND_API.G_MISS_CHAR THEN
4528: OZF_Claim_Utility_PVT.Normalize_Customer_Reference(
4529: p_customer_reference => l_claim.customer_ref_number,
4530: x_normalized_reference => l_customer_ref_norm
4531: );
4579:
4580:
4581: -- Added for Rule Based Settlement
4582: IF l_claim.pre_auth_deduction_number is not NULL AND
4583: l_claim.pre_auth_deduction_number <> FND_API.G_MISS_CHAR THEN
4584: -- Removed the Normalization logic for PAD - Bug 8924230
4585: /*OZF_Claim_Utility_PVT.Normalize_Customer_Reference(
4586: p_customer_reference => l_claim.pre_auth_deduction_number,
4587: x_normalized_reference => l_pad_ref_norm
4633: x_msg_data => l_msg_data,
4634: p_claim => l_claim
4635: );
4636:
4637: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4638: RAISE FND_API.G_EXC_ERROR;
4639: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4640: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4641: END IF;
4634: p_claim => l_claim
4635: );
4636:
4637: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4638: RAISE FND_API.G_EXC_ERROR;
4639: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4640: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4641: END IF;
4642:
4635: );
4636:
4637: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4638: RAISE FND_API.G_EXC_ERROR;
4639: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4640: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4641: END IF;
4642:
4643: -- -------------------------------------------------------------------------------------------
4636:
4637: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4638: RAISE FND_API.G_EXC_ERROR;
4639: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
4640: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4641: END IF;
4642:
4643: -- -------------------------------------------------------------------------------------------
4644: -- Bug : 2781186
4811: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
4812: FND_MESSAGE.set_name('OZF', 'OZF_TABLE_HANDLER_ERROR');
4813: FND_MSG_PUB.add;
4814: END IF;
4815: RAISE FND_API.g_exc_error;
4816: END;
4817:
4818: -- Create Tasks for the claim created if task_template_group_id is not null
4819: IF (l_claim.task_template_group_id is not NULL AND
4816: END;
4817:
4818: -- Create Tasks for the claim created if task_template_group_id is not null
4819: IF (l_claim.task_template_group_id is not NULL AND
4820: l_claim.task_template_group_id <> FND_API.G_MISS_NUM ) THEN
4821:
4822: generate_tasks(
4823: p_task_template_group_id => l_claim.task_template_group_id
4824: ,p_owner_id => l_claim.owner_id
4833: FND_MSG_PUB.Add;
4834: END IF;
4835: END IF;
4836:
4837: IF l_return_status = FND_API.g_ret_sts_error THEN
4838: RAISE FND_API.g_exc_error;
4839: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4840: RAISE FND_API.g_exc_unexpected_error;
4841: END IF;
4834: END IF;
4835: END IF;
4836:
4837: IF l_return_status = FND_API.g_ret_sts_error THEN
4838: RAISE FND_API.g_exc_error;
4839: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4840: RAISE FND_API.g_exc_unexpected_error;
4841: END IF;
4842:
4835: END IF;
4836:
4837: IF l_return_status = FND_API.g_ret_sts_error THEN
4838: RAISE FND_API.g_exc_error;
4839: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4840: RAISE FND_API.g_exc_unexpected_error;
4841: END IF;
4842:
4843: -- This loop should always run
4836:
4837: IF l_return_status = FND_API.g_ret_sts_error THEN
4838: RAISE FND_API.g_exc_error;
4839: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4840: RAISE FND_API.g_exc_unexpected_error;
4841: END IF;
4842:
4843: -- This loop should always run
4844: IF l_access_list.count > 0 THEN
4857: -- [END OF BUG 3835800 Fiing]
4858: l_access_list(i).act_access_to_object_id := l_claim_id;
4859: ams_access_pvt.create_access(
4860: p_api_version => l_api_version
4861: ,p_init_msg_list => fnd_api.g_false
4862: ,p_validation_level => p_validation_level
4863: ,x_return_status => l_return_status
4864: ,x_msg_count => x_msg_count
4865: ,x_msg_data => x_msg_data
4862: ,p_validation_level => p_validation_level
4863: ,x_return_status => l_return_status
4864: ,x_msg_count => x_msg_count
4865: ,x_msg_data => x_msg_data
4866: ,p_commit => fnd_api.g_false
4867: ,p_access_rec => l_access_list(i)
4868: ,x_access_id => l_access_id);
4869: IF l_return_status = fnd_api.g_ret_sts_error THEN
4870: RAISE fnd_api.g_exc_error;
4865: ,x_msg_data => x_msg_data
4866: ,p_commit => fnd_api.g_false
4867: ,p_access_rec => l_access_list(i)
4868: ,x_access_id => l_access_id);
4869: IF l_return_status = fnd_api.g_ret_sts_error THEN
4870: RAISE fnd_api.g_exc_error;
4871: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
4872: RAISE fnd_api.g_exc_unexpected_error;
4873: END IF;
4866: ,p_commit => fnd_api.g_false
4867: ,p_access_rec => l_access_list(i)
4868: ,x_access_id => l_access_id);
4869: IF l_return_status = fnd_api.g_ret_sts_error THEN
4870: RAISE fnd_api.g_exc_error;
4871: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
4872: RAISE fnd_api.g_exc_unexpected_error;
4873: END IF;
4874: END IF; -- end of l_dup_resource checking BUG 3835800 Fixing
4867: ,p_access_rec => l_access_list(i)
4868: ,x_access_id => l_access_id);
4869: IF l_return_status = fnd_api.g_ret_sts_error THEN
4870: RAISE fnd_api.g_exc_error;
4871: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
4872: RAISE fnd_api.g_exc_unexpected_error;
4873: END IF;
4874: END IF; -- end of l_dup_resource checking BUG 3835800 Fixing
4875: END LOOP;
4868: ,x_access_id => l_access_id);
4869: IF l_return_status = fnd_api.g_ret_sts_error THEN
4870: RAISE fnd_api.g_exc_error;
4871: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
4872: RAISE fnd_api.g_exc_unexpected_error;
4873: END IF;
4874: END IF; -- end of l_dup_resource checking BUG 3835800 Fixing
4875: END LOOP;
4876: END IF;
4880:
4881: --create history call (uday)
4882: Create_Claim_History (
4883: p_api_version => l_api_version
4884: ,p_init_msg_list => FND_API.G_FALSE
4885: ,p_commit => FND_API.G_FALSE
4886: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
4887: ,x_return_status => l_return_status
4888: ,x_msg_data => l_msg_data
4881: --create history call (uday)
4882: Create_Claim_History (
4883: p_api_version => l_api_version
4884: ,p_init_msg_list => FND_API.G_FALSE
4885: ,p_commit => FND_API.G_FALSE
4886: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
4887: ,x_return_status => l_return_status
4888: ,x_msg_data => l_msg_data
4889: ,x_msg_count => l_msg_count
4882: Create_Claim_History (
4883: p_api_version => l_api_version
4884: ,p_init_msg_list => FND_API.G_FALSE
4885: ,p_commit => FND_API.G_FALSE
4886: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
4887: ,x_return_status => l_return_status
4888: ,x_msg_data => l_msg_data
4889: ,x_msg_count => l_msg_count
4890: ,p_claim => l_claim
4891: ,p_event => G_NEW_EVENT
4892: ,x_need_to_create => l_need_to_create
4893: ,x_claim_history_id => l_claim_history_id
4894: );
4895: IF l_return_status = FND_API.g_ret_sts_error THEN
4896: RAISE FND_API.g_exc_error;
4897: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4898: RAISE FND_API.g_exc_unexpected_error;
4899: END IF;
4892: ,x_need_to_create => l_need_to_create
4893: ,x_claim_history_id => l_claim_history_id
4894: );
4895: IF l_return_status = FND_API.g_ret_sts_error THEN
4896: RAISE FND_API.g_exc_error;
4897: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4898: RAISE FND_API.g_exc_unexpected_error;
4899: END IF;
4900: --end of history call (uday)
4893: ,x_claim_history_id => l_claim_history_id
4894: );
4895: IF l_return_status = FND_API.g_ret_sts_error THEN
4896: RAISE FND_API.g_exc_error;
4897: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4898: RAISE FND_API.g_exc_unexpected_error;
4899: END IF;
4900: --end of history call (uday)
4901:
4894: );
4895: IF l_return_status = FND_API.g_ret_sts_error THEN
4896: RAISE FND_API.g_exc_error;
4897: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4898: RAISE FND_API.g_exc_unexpected_error;
4899: END IF;
4900: --end of history call (uday)
4901:
4902: --------------------------
4903: -- Raise Business Event --
4904: --------------------------
4905: OZF_CLAIM_SETTLEMENT_PVT.Raise_Business_Event(
4906: p_api_version => l_api_version
4907: ,p_init_msg_list => FND_API.g_false
4908: ,p_commit => FND_API.g_false
4909: ,p_validation_level => FND_API.g_valid_level_full
4910: ,x_return_status => l_return_status
4911: ,x_msg_data => x_msg_data
4904: --------------------------
4905: OZF_CLAIM_SETTLEMENT_PVT.Raise_Business_Event(
4906: p_api_version => l_api_version
4907: ,p_init_msg_list => FND_API.g_false
4908: ,p_commit => FND_API.g_false
4909: ,p_validation_level => FND_API.g_valid_level_full
4910: ,x_return_status => l_return_status
4911: ,x_msg_data => x_msg_data
4912: ,x_msg_count => x_msg_count
4905: OZF_CLAIM_SETTLEMENT_PVT.Raise_Business_Event(
4906: p_api_version => l_api_version
4907: ,p_init_msg_list => FND_API.g_false
4908: ,p_commit => FND_API.g_false
4909: ,p_validation_level => FND_API.g_valid_level_full
4910: ,x_return_status => l_return_status
4911: ,x_msg_data => x_msg_data
4912: ,x_msg_count => x_msg_count
4913:
4915: ,p_old_status => NULL
4916: ,p_new_status => l_claim.status_code
4917: ,p_event_name => 'oracle.apps.ozf.claim.create'
4918: );
4919: IF l_return_status = FND_API.g_ret_sts_error THEN
4920: RAISE FND_API.g_exc_error;
4921: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4922: RAISE FND_API.g_exc_unexpected_error;
4923: END IF;
4916: ,p_new_status => l_claim.status_code
4917: ,p_event_name => 'oracle.apps.ozf.claim.create'
4918: );
4919: IF l_return_status = FND_API.g_ret_sts_error THEN
4920: RAISE FND_API.g_exc_error;
4921: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4922: RAISE FND_API.g_exc_unexpected_error;
4923: END IF;
4924:
4917: ,p_event_name => 'oracle.apps.ozf.claim.create'
4918: );
4919: IF l_return_status = FND_API.g_ret_sts_error THEN
4920: RAISE FND_API.g_exc_error;
4921: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4922: RAISE FND_API.g_exc_unexpected_error;
4923: END IF;
4924:
4925: --===============================================================================================================================
4918: );
4919: IF l_return_status = FND_API.g_ret_sts_error THEN
4920: RAISE FND_API.g_exc_error;
4921: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
4922: RAISE FND_API.g_exc_unexpected_error;
4923: END IF;
4924:
4925: --===============================================================================================================================
4926: --// 12970850 TPM Integration ER
5037: END IF;
5038: -- API to create claim line and Association
5039: Create_Claim_Association(
5040: p_api_version => 1.0
5041: ,p_init_msg_list => FND_API.g_false
5042: ,p_commit => FND_API.g_false
5043: ,p_validation_level => FND_API.g_valid_level_full
5044: ,p_claim_id => l_claim.claim_id
5045: ,p_offer_id => l_claim.offer_id
5038: -- API to create claim line and Association
5039: Create_Claim_Association(
5040: p_api_version => 1.0
5041: ,p_init_msg_list => FND_API.g_false
5042: ,p_commit => FND_API.g_false
5043: ,p_validation_level => FND_API.g_valid_level_full
5044: ,p_claim_id => l_claim.claim_id
5045: ,p_offer_id => l_claim.offer_id
5046: ,p_claim_amt => l_claim.amount
5039: Create_Claim_Association(
5040: p_api_version => 1.0
5041: ,p_init_msg_list => FND_API.g_false
5042: ,p_commit => FND_API.g_false
5043: ,p_validation_level => FND_API.g_valid_level_full
5044: ,p_claim_id => l_claim.claim_id
5045: ,p_offer_id => l_claim.offer_id
5046: ,p_claim_amt => l_claim.amount
5047: ,p_claim_acc_amt => l_claim.acctd_amount
5048: ,x_msg_data => l_msg_data
5049: ,x_msg_count => l_msg_count
5050: ,x_return_status => l_return_status
5051: );
5052: IF l_return_status = FND_API.g_ret_sts_error THEN
5053: RAISE FND_API.g_exc_unexpected_error;
5054: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5055: RAISE FND_API.g_exc_unexpected_error;
5056: END IF;
5049: ,x_msg_count => l_msg_count
5050: ,x_return_status => l_return_status
5051: );
5052: IF l_return_status = FND_API.g_ret_sts_error THEN
5053: RAISE FND_API.g_exc_unexpected_error;
5054: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5055: RAISE FND_API.g_exc_unexpected_error;
5056: END IF;
5057:
5050: ,x_return_status => l_return_status
5051: );
5052: IF l_return_status = FND_API.g_ret_sts_error THEN
5053: RAISE FND_API.g_exc_unexpected_error;
5054: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5055: RAISE FND_API.g_exc_unexpected_error;
5056: END IF;
5057:
5058: -- Initiate the Settlement for Claim
5051: );
5052: IF l_return_status = FND_API.g_ret_sts_error THEN
5053: RAISE FND_API.g_exc_unexpected_error;
5054: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5055: RAISE FND_API.g_exc_unexpected_error;
5056: END IF;
5057:
5058: -- Initiate the Settlement for Claim
5059:
5074: x_vendor_site_id => l_vendor_site_id,
5075: x_return_status => l_return_status
5076: );
5077:
5078: IF(l_return_status = FND_API.G_RET_STS_SUCCESS ) THEN
5079: l_claim.payment_method := l_payment_method;
5080: END IF;
5081:
5082: IF (l_claim.payment_method IN ('CHECK', 'EFT','WIRE','AP_DEBIT','AP_DEFAULT')) THEN
5093: OZF_Utility_PVT.debug_message('Vendor ID =' || l_claim.vendor_id );
5094: OZF_Utility_PVT.debug_message('Vendor Site ID =' || l_claim.vendor_site_id );
5095: END IF;
5096:
5097: IF (l_claim.payment_method IS NOT NULL AND l_claim.payment_method <> FND_API.G_MISS_CHAR) THEN
5098:
5099: -- Added for Bug 16301542
5100: /*l_claim.USER_STATUS_ID := to_number(
5101: ozf_utility_pvt.GET_DEFAULT_USER_STATUS(
5105: */
5106:
5107: OZF_claim_PVT.Update_claim(
5108: P_Api_Version => l_api_version,
5109: P_Init_Msg_List => FND_API.g_false,
5110: P_Commit => FND_API.g_false,
5111: P_Validation_Level => FND_API.g_valid_level_full,
5112: X_Return_Status => l_return_status,
5113: X_Msg_Count => x_msg_count,
5106:
5107: OZF_claim_PVT.Update_claim(
5108: P_Api_Version => l_api_version,
5109: P_Init_Msg_List => FND_API.g_false,
5110: P_Commit => FND_API.g_false,
5111: P_Validation_Level => FND_API.g_valid_level_full,
5112: X_Return_Status => l_return_status,
5113: X_Msg_Count => x_msg_count,
5114: X_Msg_Data => x_msg_data,
5107: OZF_claim_PVT.Update_claim(
5108: P_Api_Version => l_api_version,
5109: P_Init_Msg_List => FND_API.g_false,
5110: P_Commit => FND_API.g_false,
5111: P_Validation_Level => FND_API.g_valid_level_full,
5112: X_Return_Status => l_return_status,
5113: X_Msg_Count => x_msg_count,
5114: X_Msg_Data => x_msg_data,
5115: P_claim => l_claim,
5116: p_event => 'UPDATE',
5117: p_mode => OZF_claim_Utility_pvt.G_AUTO_MODE,
5118: X_Object_Version_Number => l_object_version_number
5119: );
5120: IF l_return_status = FND_API.g_ret_sts_error THEN
5121: RAISE FND_API.g_exc_error;
5122: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5123: RAISE FND_API.g_exc_unexpected_error;
5124: END IF;
5117: p_mode => OZF_claim_Utility_pvt.G_AUTO_MODE,
5118: X_Object_Version_Number => l_object_version_number
5119: );
5120: IF l_return_status = FND_API.g_ret_sts_error THEN
5121: RAISE FND_API.g_exc_error;
5122: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5123: RAISE FND_API.g_exc_unexpected_error;
5124: END IF;
5125: END IF; --IF (l_claim.payment_method IS NOT NULL AND l_claim.payment_method <> FND_API.G_MISS_CHAR)
5118: X_Object_Version_Number => l_object_version_number
5119: );
5120: IF l_return_status = FND_API.g_ret_sts_error THEN
5121: RAISE FND_API.g_exc_error;
5122: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5123: RAISE FND_API.g_exc_unexpected_error;
5124: END IF;
5125: END IF; --IF (l_claim.payment_method IS NOT NULL AND l_claim.payment_method <> FND_API.G_MISS_CHAR)
5126:
5119: );
5120: IF l_return_status = FND_API.g_ret_sts_error THEN
5121: RAISE FND_API.g_exc_error;
5122: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5123: RAISE FND_API.g_exc_unexpected_error;
5124: END IF;
5125: END IF; --IF (l_claim.payment_method IS NOT NULL AND l_claim.payment_method <> FND_API.G_MISS_CHAR)
5126:
5127: END IF; --IF (l_claim.offer_id IS NOT NULL AND l_claim.claim_class = 'CLAIM') THEN
5121: RAISE FND_API.g_exc_error;
5122: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5123: RAISE FND_API.g_exc_unexpected_error;
5124: END IF;
5125: END IF; --IF (l_claim.payment_method IS NOT NULL AND l_claim.payment_method <> FND_API.G_MISS_CHAR)
5126:
5127: END IF; --IF (l_claim.offer_id IS NOT NULL AND l_claim.claim_class = 'CLAIM') THEN
5128: -- Enf of Rule Based Enhancement
5129:
5127: END IF; --IF (l_claim.offer_id IS NOT NULL AND l_claim.claim_class = 'CLAIM') THEN
5128: -- Enf of Rule Based Enhancement
5129:
5130: --Standard check of commit
5131: IF FND_API.To_Boolean ( p_commit ) THEN
5132: COMMIT WORK;
5133: END IF;
5134: -- Debug Message
5135: IF OZF_DEBUG_LOW_ON THEN
5139: END IF;
5140:
5141: --Standard call to get message count AND if count=1, get the message
5142: FND_MSG_PUB.Count_And_Get (
5143: p_encoded => FND_API.G_FALSE,
5144: p_count => x_msg_count,
5145: p_data => x_msg_data
5146: );
5147: EXCEPTION
5144: p_count => x_msg_count,
5145: p_data => x_msg_data
5146: );
5147: EXCEPTION
5148: WHEN FND_API.G_EXC_ERROR THEN
5149: ROLLBACK TO Create_Claim_PVT;
5150: x_return_status := FND_API.G_RET_STS_ERROR;
5151: -- Standard call to get message count AND if count=1, get the message
5152: FND_MSG_PUB.Count_And_Get (
5146: );
5147: EXCEPTION
5148: WHEN FND_API.G_EXC_ERROR THEN
5149: ROLLBACK TO Create_Claim_PVT;
5150: x_return_status := FND_API.G_RET_STS_ERROR;
5151: -- Standard call to get message count AND if count=1, get the message
5152: FND_MSG_PUB.Count_And_Get (
5153: p_encoded => FND_API.G_FALSE,
5154: p_count => x_msg_count,
5149: ROLLBACK TO Create_Claim_PVT;
5150: x_return_status := FND_API.G_RET_STS_ERROR;
5151: -- Standard call to get message count AND if count=1, get the message
5152: FND_MSG_PUB.Count_And_Get (
5153: p_encoded => FND_API.G_FALSE,
5154: p_count => x_msg_count,
5155: p_data => x_msg_data
5156: );
5157: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5153: p_encoded => FND_API.G_FALSE,
5154: p_count => x_msg_count,
5155: p_data => x_msg_data
5156: );
5157: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5158: ROLLBACK TO Create_Claim_PVT;
5159: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5160: -- Standard call to get message count AND if count=1, get the message
5161: FND_MSG_PUB.Count_And_Get (
5155: p_data => x_msg_data
5156: );
5157: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5158: ROLLBACK TO Create_Claim_PVT;
5159: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5160: -- Standard call to get message count AND if count=1, get the message
5161: FND_MSG_PUB.Count_And_Get (
5162: p_encoded => FND_API.G_FALSE,
5163: p_count => x_msg_count,
5158: ROLLBACK TO Create_Claim_PVT;
5159: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5160: -- Standard call to get message count AND if count=1, get the message
5161: FND_MSG_PUB.Count_And_Get (
5162: p_encoded => FND_API.G_FALSE,
5163: p_count => x_msg_count,
5164: p_data => x_msg_data
5165: );
5166: WHEN OTHERS THEN
5164: p_data => x_msg_data
5165: );
5166: WHEN OTHERS THEN
5167: ROLLBACK TO Create_Claim_PVT;
5168: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5169: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
5170: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
5171: END IF;
5172: -- Standard call to get message count AND if count=1, get the message
5170: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
5171: END IF;
5172: -- Standard call to get message count AND if count=1, get the message
5173: FND_MSG_PUB.Count_And_Get (
5174: p_encoded => FND_API.G_FALSE,
5175: p_count => x_msg_count,
5176: p_data => x_msg_data
5177: );
5178: END Create_Claim;
5207:
5208: ---------------------------------------------------------------------
5209: PROCEDURE Validate_Delete_Claim (
5210: p_api_version_number IN NUMBER,
5211: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
5212: p_commit IN VARCHAR2 := FND_API.G_FALSE,
5213: p_object_id IN NUMBER,
5214: p_object_version_number IN NUMBER,
5215: x_dependent_object_tbl OUT NOCOPY ams_utility_pvt.dependent_objects_tbl_type,
5208: ---------------------------------------------------------------------
5209: PROCEDURE Validate_Delete_Claim (
5210: p_api_version_number IN NUMBER,
5211: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
5212: p_commit IN VARCHAR2 := FND_API.G_FALSE,
5213: p_object_id IN NUMBER,
5214: p_object_version_number IN NUMBER,
5215: x_dependent_object_tbl OUT NOCOPY ams_utility_pvt.dependent_objects_tbl_type,
5216: x_return_status OUT NOCOPY VARCHAR2,
5301: BEGIN
5302: -- Standard begin of API savepoint
5303: SAVEPOINT Val_Delete_Claim_PVT;
5304: -- Standard call to check for call compatibility.
5305: IF NOT FND_API.Compatible_API_Call (
5306: l_api_version,
5307: p_api_version_number,
5308: l_api_name,
5309: G_PKG_NAME)
5307: p_api_version_number,
5308: l_api_name,
5309: G_PKG_NAME)
5310: THEN
5311: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5312: END IF;
5313: -- Debug Message
5314: IF OZF_DEBUG_LOW_ON THEN
5315: FND_MESSAGE.Set_Name('OZF','OZF_API_DEBUG_MESSAGE');
5316: FND_MESSAGE.Set_Token('TEXT',l_full_name||': Start');
5317: FND_MSG_PUB.Add;
5318: END IF;
5319: --Initialize message list if p_init_msg_list is TRUE.
5320: IF FND_API.To_Boolean (p_init_msg_list) THEN
5321: FND_MSG_PUB.initialize;
5322: END IF;
5323: -- Initialize API return status to sucess
5324: x_return_status := FND_API.G_RET_STS_SUCCESS;
5320: IF FND_API.To_Boolean (p_init_msg_list) THEN
5321: FND_MSG_PUB.initialize;
5322: END IF;
5323: -- Initialize API return status to sucess
5324: x_return_status := FND_API.G_RET_STS_SUCCESS;
5325:
5326: OPEN claim_info_csr(p_object_id);
5327: FETCH claim_info_csr INTO l_object_version_number, l_owner_id, l_status_code;
5328: CLOSE claim_info_csr;
5395: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
5396: FND_MESSAGE.set_name('OZF', 'OZF_REC_VERSION_CHANGED');
5397: FND_MSG_PUB.add;
5398: END IF;
5399: RAISE FND_API.g_exc_error;
5400: END IF;
5401:
5402: --Standard check of commit
5403: IF FND_API.To_Boolean ( p_commit ) THEN
5399: RAISE FND_API.g_exc_error;
5400: END IF;
5401:
5402: --Standard check of commit
5403: IF FND_API.To_Boolean ( p_commit ) THEN
5404: COMMIT WORK;
5405: END IF;
5406: -- Debug Message
5407: IF OZF_DEBUG_LOW_ON THEN
5411: END IF;
5412:
5413: --Standard call to get message count AND if count=1, get the message
5414: FND_MSG_PUB.Count_And_Get (
5415: p_encoded => FND_API.G_FALSE,
5416: p_count => x_msg_count,
5417: p_data => x_msg_data
5418: );
5419: EXCEPTION
5416: p_count => x_msg_count,
5417: p_data => x_msg_data
5418: );
5419: EXCEPTION
5420: WHEN FND_API.G_EXC_ERROR THEN
5421: ROLLBACK TO Val_Delete_Claim_PVT;
5422: x_return_status := FND_API.G_RET_STS_ERROR;
5423: -- Standard call to get message count AND if count=1, get the message
5424: FND_MSG_PUB.Count_And_Get (
5418: );
5419: EXCEPTION
5420: WHEN FND_API.G_EXC_ERROR THEN
5421: ROLLBACK TO Val_Delete_Claim_PVT;
5422: x_return_status := FND_API.G_RET_STS_ERROR;
5423: -- Standard call to get message count AND if count=1, get the message
5424: FND_MSG_PUB.Count_And_Get (
5425: p_encoded => FND_API.G_FALSE,
5426: p_count => x_msg_count,
5421: ROLLBACK TO Val_Delete_Claim_PVT;
5422: x_return_status := FND_API.G_RET_STS_ERROR;
5423: -- Standard call to get message count AND if count=1, get the message
5424: FND_MSG_PUB.Count_And_Get (
5425: p_encoded => FND_API.G_FALSE,
5426: p_count => x_msg_count,
5427: p_data => x_msg_data
5428: );
5429: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5425: p_encoded => FND_API.G_FALSE,
5426: p_count => x_msg_count,
5427: p_data => x_msg_data
5428: );
5429: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5430: ROLLBACK TO Val_Delete_Claim_PVT;
5431: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5432: -- Standard call to get message count AND if count=1, get the message
5433: FND_MSG_PUB.Count_And_Get (
5427: p_data => x_msg_data
5428: );
5429: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5430: ROLLBACK TO Val_Delete_Claim_PVT;
5431: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5432: -- Standard call to get message count AND if count=1, get the message
5433: FND_MSG_PUB.Count_And_Get (
5434: p_encoded => FND_API.G_FALSE,
5435: p_count => x_msg_count,
5430: ROLLBACK TO Val_Delete_Claim_PVT;
5431: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5432: -- Standard call to get message count AND if count=1, get the message
5433: FND_MSG_PUB.Count_And_Get (
5434: p_encoded => FND_API.G_FALSE,
5435: p_count => x_msg_count,
5436: p_data => x_msg_data
5437: );
5438: WHEN OTHERS THEN
5436: p_data => x_msg_data
5437: );
5438: WHEN OTHERS THEN
5439: ROLLBACK TO Val_Delete_Claim_PVT;
5440: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5441: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
5442: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
5443: END IF;
5444: -- Standard call to get message count AND if count=1, get the message
5442: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
5443: END IF;
5444: -- Standard call to get message count AND if count=1, get the message
5445: FND_MSG_PUB.Count_And_Get (
5446: p_encoded => FND_API.G_FALSE,
5447: p_count => x_msg_count,
5448: p_data => x_msg_data
5449: );
5450: End Validate_Delete_Claim;
5466: -- any API to delete these two objects. Checks on these will have to be added later.
5467: ----------------------------------------------------------------------
5468: PROCEDURE Delete_Claim (
5469: p_api_version_number IN NUMBER
5470: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
5471: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
5472: ,p_object_id IN NUMBER
5473: ,p_object_version_number IN NUMBER
5474: ,x_return_status OUT NOCOPY VARCHAR2
5467: ----------------------------------------------------------------------
5468: PROCEDURE Delete_Claim (
5469: p_api_version_number IN NUMBER
5470: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
5471: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
5472: ,p_object_id IN NUMBER
5473: ,p_object_version_number IN NUMBER
5474: ,x_return_status OUT NOCOPY VARCHAR2
5475: ,x_msg_count OUT NOCOPY NUMBER
5548: BEGIN
5549: -- Standard begin of API savepoint
5550: SAVEPOINT Delete_Claim_PVT;
5551: -- Standard call to check for call compatibility.
5552: IF NOT FND_API.Compatible_API_Call (
5553: l_api_version,
5554: p_api_version_number,
5555: l_api_name,
5556: G_PKG_NAME)
5554: p_api_version_number,
5555: l_api_name,
5556: G_PKG_NAME)
5557: THEN
5558: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5559: END IF;
5560: -- Debug Message
5561: IF OZF_DEBUG_LOW_ON THEN
5562: FND_MESSAGE.Set_Name('OZF','OZF_API_DEBUG_MESSAGE');
5563: FND_MESSAGE.Set_Token('TEXT',l_full_name||': Start');
5564: FND_MSG_PUB.Add;
5565: END IF;
5566: --Initialize message list if p_init_msg_list is TRUE.
5567: IF FND_API.To_Boolean (p_init_msg_list) THEN
5568: FND_MSG_PUB.initialize;
5569: END IF;
5570: -- Initialize API return status to sucess
5571: x_return_status := FND_API.G_RET_STS_SUCCESS;
5567: IF FND_API.To_Boolean (p_init_msg_list) THEN
5568: FND_MSG_PUB.initialize;
5569: END IF;
5570: -- Initialize API return status to sucess
5571: x_return_status := FND_API.G_RET_STS_SUCCESS;
5572:
5573: OPEN claim_info_csr(p_object_id);
5574: FETCH claim_info_csr INTO l_object_version_number, l_status_code;
5575: CLOSE claim_info_csr;
5592: JTF_TASKS_PUB.delete_task(
5593: p_api_version => l_api_version
5594: ,p_object_version_number => l_tasks_id_tbl(i).object_version_number
5595: ,p_task_id => l_tasks_id_tbl(i).task_id
5596: ,p_delete_future_recurrences => FND_API.G_TRUE
5597: ,x_return_status => l_return_status
5598: ,x_msg_count => l_msg_count
5599: ,x_msg_data => l_msg_data
5600: );
5597: ,x_return_status => l_return_status
5598: ,x_msg_count => l_msg_count
5599: ,x_msg_data => l_msg_data
5600: );
5601: IF l_return_status = FND_API.g_ret_sts_error THEN
5602: RAISE FND_API.g_exc_error;
5603: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5604: RAISE FND_API.g_exc_unexpected_error;
5605: END IF;
5598: ,x_msg_count => l_msg_count
5599: ,x_msg_data => l_msg_data
5600: );
5601: IF l_return_status = FND_API.g_ret_sts_error THEN
5602: RAISE FND_API.g_exc_error;
5603: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5604: RAISE FND_API.g_exc_unexpected_error;
5605: END IF;
5606: END LOOP;
5599: ,x_msg_data => l_msg_data
5600: );
5601: IF l_return_status = FND_API.g_ret_sts_error THEN
5602: RAISE FND_API.g_exc_error;
5603: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5604: RAISE FND_API.g_exc_unexpected_error;
5605: END IF;
5606: END LOOP;
5607:
5600: );
5601: IF l_return_status = FND_API.g_ret_sts_error THEN
5602: RAISE FND_API.g_exc_error;
5603: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5604: RAISE FND_API.g_exc_unexpected_error;
5605: END IF;
5606: END LOOP;
5607:
5608: -- Fix for 5048675
5613: EXIT When claim_history_id_csr%NOTFOUND;
5614:
5615: OZF_claims_history_PVT.Delete_claims_history(
5616: P_Api_Version_Number => l_api_version
5617: ,P_Init_Msg_List => FND_API.g_false
5618: ,P_Commit => FND_API.g_false
5619: ,p_validation_level => FND_API.g_valid_level_full
5620: ,X_Return_Status => l_return_status
5621: ,X_Msg_Count => l_msg_count
5614:
5615: OZF_claims_history_PVT.Delete_claims_history(
5616: P_Api_Version_Number => l_api_version
5617: ,P_Init_Msg_List => FND_API.g_false
5618: ,P_Commit => FND_API.g_false
5619: ,p_validation_level => FND_API.g_valid_level_full
5620: ,X_Return_Status => l_return_status
5621: ,X_Msg_Count => l_msg_count
5622: ,X_Msg_Data => l_msg_data
5615: OZF_claims_history_PVT.Delete_claims_history(
5616: P_Api_Version_Number => l_api_version
5617: ,P_Init_Msg_List => FND_API.g_false
5618: ,P_Commit => FND_API.g_false
5619: ,p_validation_level => FND_API.g_valid_level_full
5620: ,X_Return_Status => l_return_status
5621: ,X_Msg_Count => l_msg_count
5622: ,X_Msg_Data => l_msg_data
5623: ,P_CLAIM_HISTORY_ID => l_claim_history_id
5623: ,P_CLAIM_HISTORY_ID => l_claim_history_id
5624: ,P_Object_Version_Number => l_object_version_number
5625: );
5626:
5627: IF l_return_status = FND_API.g_ret_sts_error THEN
5628: RAISE FND_API.g_exc_unexpected_error;
5629: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5630: RAISE FND_API.g_exc_unexpected_error;
5631: END IF;
5624: ,P_Object_Version_Number => l_object_version_number
5625: );
5626:
5627: IF l_return_status = FND_API.g_ret_sts_error THEN
5628: RAISE FND_API.g_exc_unexpected_error;
5629: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5630: RAISE FND_API.g_exc_unexpected_error;
5631: END IF;
5632: END LOOP;
5625: );
5626:
5627: IF l_return_status = FND_API.g_ret_sts_error THEN
5628: RAISE FND_API.g_exc_unexpected_error;
5629: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5630: RAISE FND_API.g_exc_unexpected_error;
5631: END IF;
5632: END LOOP;
5633: CLOSE claim_history_id_csr;
5626:
5627: IF l_return_status = FND_API.g_ret_sts_error THEN
5628: RAISE FND_API.g_exc_unexpected_error;
5629: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5630: RAISE FND_API.g_exc_unexpected_error;
5631: END IF;
5632: END LOOP;
5633: CLOSE claim_history_id_csr;
5634:
5639: EXIT When claim_line_his_id_csr%NOTFOUND;
5640:
5641: OZF_Claim_Line_Hist_PVT.Delete_Claim_Line_Hist(
5642: p_api_version_number => l_api_version
5643: ,p_init_msg_list => FND_API.g_false
5644: ,p_commit => FND_API.g_false
5645: ,p_validation_level => FND_API.g_valid_level_full
5646: ,x_return_status => l_return_status
5647: ,x_msg_count => l_msg_count
5640:
5641: OZF_Claim_Line_Hist_PVT.Delete_Claim_Line_Hist(
5642: p_api_version_number => l_api_version
5643: ,p_init_msg_list => FND_API.g_false
5644: ,p_commit => FND_API.g_false
5645: ,p_validation_level => FND_API.g_valid_level_full
5646: ,x_return_status => l_return_status
5647: ,x_msg_count => l_msg_count
5648: ,x_msg_data => l_msg_data
5641: OZF_Claim_Line_Hist_PVT.Delete_Claim_Line_Hist(
5642: p_api_version_number => l_api_version
5643: ,p_init_msg_list => FND_API.g_false
5644: ,p_commit => FND_API.g_false
5645: ,p_validation_level => FND_API.g_valid_level_full
5646: ,x_return_status => l_return_status
5647: ,x_msg_count => l_msg_count
5648: ,x_msg_data => l_msg_data
5649: ,p_claim_line_history_id => l_claim_line_hist_id
5649: ,p_claim_line_history_id => l_claim_line_hist_id
5650: ,p_object_version_number => l_object_version_number
5651: );
5652:
5653: IF l_return_status = FND_API.g_ret_sts_error THEN
5654: RAISE FND_API.g_exc_unexpected_error;
5655: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5656: RAISE FND_API.g_exc_unexpected_error;
5657: END IF;
5650: ,p_object_version_number => l_object_version_number
5651: );
5652:
5653: IF l_return_status = FND_API.g_ret_sts_error THEN
5654: RAISE FND_API.g_exc_unexpected_error;
5655: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5656: RAISE FND_API.g_exc_unexpected_error;
5657: END IF;
5658: END LOOP;
5651: );
5652:
5653: IF l_return_status = FND_API.g_ret_sts_error THEN
5654: RAISE FND_API.g_exc_unexpected_error;
5655: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5656: RAISE FND_API.g_exc_unexpected_error;
5657: END IF;
5658: END LOOP;
5659: CLOSE claim_line_his_id_csr;
5652:
5653: IF l_return_status = FND_API.g_ret_sts_error THEN
5654: RAISE FND_API.g_exc_unexpected_error;
5655: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5656: RAISE FND_API.g_exc_unexpected_error;
5657: END IF;
5658: END LOOP;
5659: CLOSE claim_line_his_id_csr;
5660:
5671: CLOSE claim_line_id_csr;
5672:
5673: OZF_Claim_Line_PVT.Delete_Claim_Line_Tbl(
5674: p_api_version => l_api_version
5675: ,p_init_msg_list => FND_API.g_false
5676: ,p_commit => FND_API.g_false
5677: ,p_validation_level => FND_API.g_valid_level_full
5678: ,x_return_status => l_return_status
5679: ,x_msg_count => l_msg_count
5672:
5673: OZF_Claim_Line_PVT.Delete_Claim_Line_Tbl(
5674: p_api_version => l_api_version
5675: ,p_init_msg_list => FND_API.g_false
5676: ,p_commit => FND_API.g_false
5677: ,p_validation_level => FND_API.g_valid_level_full
5678: ,x_return_status => l_return_status
5679: ,x_msg_count => l_msg_count
5680: ,x_msg_data => l_msg_data
5673: OZF_Claim_Line_PVT.Delete_Claim_Line_Tbl(
5674: p_api_version => l_api_version
5675: ,p_init_msg_list => FND_API.g_false
5676: ,p_commit => FND_API.g_false
5677: ,p_validation_level => FND_API.g_valid_level_full
5678: ,x_return_status => l_return_status
5679: ,x_msg_count => l_msg_count
5680: ,x_msg_data => l_msg_data
5681: ,p_claim_line_tbl => l_claim_line_tbl
5678: ,x_return_status => l_return_status
5679: ,x_msg_count => l_msg_count
5680: ,x_msg_data => l_msg_data
5681: ,p_claim_line_tbl => l_claim_line_tbl
5682: ,p_change_object_version => FND_API.g_false
5683: ,x_error_index => l_error_index
5684: );
5685: IF l_return_status = FND_API.g_ret_sts_error THEN
5686: RAISE FND_API.g_exc_unexpected_error;
5681: ,p_claim_line_tbl => l_claim_line_tbl
5682: ,p_change_object_version => FND_API.g_false
5683: ,x_error_index => l_error_index
5684: );
5685: IF l_return_status = FND_API.g_ret_sts_error THEN
5686: RAISE FND_API.g_exc_unexpected_error;
5687: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5688: RAISE FND_API.g_exc_unexpected_error;
5689: END IF;
5682: ,p_change_object_version => FND_API.g_false
5683: ,x_error_index => l_error_index
5684: );
5685: IF l_return_status = FND_API.g_ret_sts_error THEN
5686: RAISE FND_API.g_exc_unexpected_error;
5687: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5688: RAISE FND_API.g_exc_unexpected_error;
5689: END IF;
5690:
5683: ,x_error_index => l_error_index
5684: );
5685: IF l_return_status = FND_API.g_ret_sts_error THEN
5686: RAISE FND_API.g_exc_unexpected_error;
5687: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5688: RAISE FND_API.g_exc_unexpected_error;
5689: END IF;
5690:
5691: OZF_claims_PKG.Delete_Row(p_object_id);
5684: );
5685: IF l_return_status = FND_API.g_ret_sts_error THEN
5686: RAISE FND_API.g_exc_unexpected_error;
5687: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5688: RAISE FND_API.g_exc_unexpected_error;
5689: END IF;
5690:
5691: OZF_claims_PKG.Delete_Row(p_object_id);
5692: ELSE
5700: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
5701: FND_MESSAGE.set_name('OZF', 'OZF_REC_VERSION_CHANGED');
5702: FND_MSG_PUB.add;
5703: END IF;
5704: RAISE FND_API.g_exc_error;
5705: END IF;
5706:
5707: --Standard check of commit
5708: IF FND_API.To_Boolean ( p_commit ) THEN
5704: RAISE FND_API.g_exc_error;
5705: END IF;
5706:
5707: --Standard check of commit
5708: IF FND_API.To_Boolean ( p_commit ) THEN
5709: COMMIT WORK;
5710: END IF;
5711:
5712: -- Debug Message
5717: END IF;
5718:
5719: --Standard call to get message count and if count=1, get the message
5720: FND_MSG_PUB.Count_And_Get (
5721: p_encoded => FND_API.G_FALSE,
5722: p_count => x_msg_count,
5723: p_data => x_msg_data
5724: );
5725: EXCEPTION
5722: p_count => x_msg_count,
5723: p_data => x_msg_data
5724: );
5725: EXCEPTION
5726: WHEN FND_API.G_EXC_ERROR THEN
5727: ROLLBACK TO Delete_Claim_PVT;
5728: x_return_status := FND_API.G_RET_STS_ERROR;
5729: -- Standard call to get message count and if count=1, get the message
5730: FND_MSG_PUB.Count_And_Get (
5724: );
5725: EXCEPTION
5726: WHEN FND_API.G_EXC_ERROR THEN
5727: ROLLBACK TO Delete_Claim_PVT;
5728: x_return_status := FND_API.G_RET_STS_ERROR;
5729: -- Standard call to get message count and if count=1, get the message
5730: FND_MSG_PUB.Count_And_Get (
5731: p_encoded => FND_API.G_FALSE,
5732: p_count => x_msg_count,
5727: ROLLBACK TO Delete_Claim_PVT;
5728: x_return_status := FND_API.G_RET_STS_ERROR;
5729: -- Standard call to get message count and if count=1, get the message
5730: FND_MSG_PUB.Count_And_Get (
5731: p_encoded => FND_API.G_FALSE,
5732: p_count => x_msg_count,
5733: p_data => x_msg_data
5734: );
5735: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5731: p_encoded => FND_API.G_FALSE,
5732: p_count => x_msg_count,
5733: p_data => x_msg_data
5734: );
5735: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5736: ROLLBACK TO Delete_Claim_PVT;
5737: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5738: -- Standard call to get message count and if count=1, get the message
5739: FND_MSG_PUB.Count_And_Get (
5733: p_data => x_msg_data
5734: );
5735: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5736: ROLLBACK TO Delete_Claim_PVT;
5737: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5738: -- Standard call to get message count and if count=1, get the message
5739: FND_MSG_PUB.Count_And_Get (
5740: p_encoded => FND_API.G_FALSE,
5741: p_count => x_msg_count,
5736: ROLLBACK TO Delete_Claim_PVT;
5737: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5738: -- Standard call to get message count and if count=1, get the message
5739: FND_MSG_PUB.Count_And_Get (
5740: p_encoded => FND_API.G_FALSE,
5741: p_count => x_msg_count,
5742: p_data => x_msg_data
5743: );
5744: WHEN OTHERS THEN
5742: p_data => x_msg_data
5743: );
5744: WHEN OTHERS THEN
5745: ROLLBACK TO Delete_Claim_PVT;
5746: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5747: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
5748: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
5749: END IF;
5750: -- Standard call to get message count and if count=1, get the message
5748: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
5749: END IF;
5750: -- Standard call to get message count and if count=1, get the message
5751: FND_MSG_PUB.Count_And_Get (
5752: p_encoded => FND_API.G_FALSE,
5753: p_count => x_msg_count,
5754: p_data => x_msg_data
5755: );
5756: END Delete_Claim;
5788: WHERE claim_id = p_id;
5789:
5790: BEGIN
5791: -- Initialize API return status to sucess
5792: x_return_status := FND_API.G_RET_STS_SUCCESS;
5793:
5794: OPEN reason_csr(p_claim_id);
5795: FETCH reason_csr into l_reason_code_id, l_task_template_group_id;
5796: CLOSE reason_csr;
5818: END IF;
5819: END IF;
5820:
5821: /* -- Here I will generate task if there is no task generated.
5822: IF (l_task_template_group_id is null AND (p_task_template_group_id is not null AND p_task_template_group_id <> FND_API.G_MISS_NUM)) THEN
5823: generate_tasks(
5824: p_task_template_group_id => p_task_template_group_id
5825: ,p_owner_id => p_owner_id
5826: ,p_claim_number => p_claim_number
5826: ,p_claim_number => p_claim_number
5827: ,p_claim_id => p_claim_id
5828: ,x_return_status => l_return_status
5829: );
5830: IF l_return_status = FND_API.g_ret_sts_error THEN
5831: RAISE FND_API.g_exc_unexpected_error;
5832: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5833: RAISE FND_API.g_exc_unexpected_error;
5834: END IF;
5827: ,p_claim_id => p_claim_id
5828: ,x_return_status => l_return_status
5829: );
5830: IF l_return_status = FND_API.g_ret_sts_error THEN
5831: RAISE FND_API.g_exc_unexpected_error;
5832: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5833: RAISE FND_API.g_exc_unexpected_error;
5834: END IF;
5835: END IF;
5828: ,x_return_status => l_return_status
5829: );
5830: IF l_return_status = FND_API.g_ret_sts_error THEN
5831: RAISE FND_API.g_exc_unexpected_error;
5832: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5833: RAISE FND_API.g_exc_unexpected_error;
5834: END IF;
5835: END IF;
5836: */
5829: );
5830: IF l_return_status = FND_API.g_ret_sts_error THEN
5831: RAISE FND_API.g_exc_unexpected_error;
5832: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5833: RAISE FND_API.g_exc_unexpected_error;
5834: END IF;
5835: END IF;
5836: */
5837: EXCEPTION
5834: END IF;
5835: END IF;
5836: */
5837: EXCEPTION
5838: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5839: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5840: WHEN OTHERS THEN
5841: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5842: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
5835: END IF;
5836: */
5837: EXCEPTION
5838: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5839: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5840: WHEN OTHERS THEN
5841: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5842: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
5843: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_REASON_CHANGE_ERR');
5837: EXCEPTION
5838: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5839: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5840: WHEN OTHERS THEN
5841: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
5842: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
5843: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_REASON_CHANGE_ERR');
5844: FND_MSG_PUB.add;
5845: END IF;
5894: -- Standard begin of API savepoint
5895: SAVEPOINT Create_Claim_Hist_PVT;
5896:
5897: -- Standard call to check for call compatibility.
5898: IF NOT FND_API.Compatible_API_Call (
5899: l_api_version,
5900: p_api_version,
5901: l_api_name,
5902: G_PKG_NAME)
5900: p_api_version,
5901: l_api_name,
5902: G_PKG_NAME)
5903: THEN
5904: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5905: END IF;
5906: -- Debug Message
5907: IF OZF_DEBUG_LOW_ON THEN
5908: FND_MESSAGE.Set_Name('OZF','OZF_API_DEBUG_MESSAGE');
5909: FND_MESSAGE.Set_Token('TEXT',l_full_name||': Start');
5910: FND_MSG_PUB.Add;
5911: END IF;
5912: --Initialize message list if p_init_msg_list is TRUE.
5913: IF FND_API.To_Boolean (p_init_msg_list) THEN
5914: FND_MSG_PUB.initialize;
5915: END IF;
5916: -- Initialize API return status to sucess
5917: x_return_status := FND_API.G_RET_STS_SUCCESS;
5913: IF FND_API.To_Boolean (p_init_msg_list) THEN
5914: FND_MSG_PUB.initialize;
5915: END IF;
5916: -- Initialize API return status to sucess
5917: x_return_status := FND_API.G_RET_STS_SUCCESS;
5918:
5919: OPEN user_status_id_csr (p_claim.claim_id);
5920: FETCH user_status_id_csr into l_user_status_id;
5921: CLOSe user_status_id_csr;
5927: x_msg_count => l_msg_count,
5928: x_return_status => l_return_status
5929: );
5930:
5931: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5932: RAISE FND_API.G_EXC_ERROR;
5933: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
5934: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5935: END IF;
5928: x_return_status => l_return_status
5929: );
5930:
5931: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5932: RAISE FND_API.G_EXC_ERROR;
5933: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
5934: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5935: END IF;
5936:
5929: );
5930:
5931: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5932: RAISE FND_API.G_EXC_ERROR;
5933: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
5934: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5935: END IF;
5936:
5937: -- If the status_code is not new, then I will to create_claim_history
5930:
5931: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5932: RAISE FND_API.G_EXC_ERROR;
5933: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
5934: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5935: END IF;
5936:
5937: -- If the status_code is not new, then I will to create_claim_history
5938: --Comment out the below line (uday) since we will be creating the history
5945: x_history_event_description => l_history_event_description,
5946: x_needed_to_create => l_needed_to_create,
5947: x_return_status => l_return_status
5948: );
5949: IF l_return_status = FND_API.g_ret_sts_error THEN
5950: RAISE FND_API.g_exc_error;
5951: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5952: RAISE FND_API.g_exc_unexpected_error;
5953: END IF;
5946: x_needed_to_create => l_needed_to_create,
5947: x_return_status => l_return_status
5948: );
5949: IF l_return_status = FND_API.g_ret_sts_error THEN
5950: RAISE FND_API.g_exc_error;
5951: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5952: RAISE FND_API.g_exc_unexpected_error;
5953: END IF;
5954:
5947: x_return_status => l_return_status
5948: );
5949: IF l_return_status = FND_API.g_ret_sts_error THEN
5950: RAISE FND_API.g_exc_error;
5951: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5952: RAISE FND_API.g_exc_unexpected_error;
5953: END IF;
5954:
5955: IF (l_needed_to_create = 'Y') THEN
5948: );
5949: IF l_return_status = FND_API.g_ret_sts_error THEN
5950: RAISE FND_API.g_exc_error;
5951: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5952: RAISE FND_API.g_exc_unexpected_error;
5953: END IF;
5954:
5955: IF (l_needed_to_create = 'Y') THEN
5956: -- CREATE history
5960: p_history_event_description => l_history_event_description,
5961: x_claim_history_id => l_claim_history_id,
5962: x_return_status => l_return_status
5963: );
5964: IF l_return_status = FND_API.g_ret_sts_error THEN
5965: RAISE FND_API.g_exc_error;
5966: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5967: RAISE FND_API.g_exc_unexpected_error;
5968: END IF;
5961: x_claim_history_id => l_claim_history_id,
5962: x_return_status => l_return_status
5963: );
5964: IF l_return_status = FND_API.g_ret_sts_error THEN
5965: RAISE FND_API.g_exc_error;
5966: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5967: RAISE FND_API.g_exc_unexpected_error;
5968: END IF;
5969: END IF;
5962: x_return_status => l_return_status
5963: );
5964: IF l_return_status = FND_API.g_ret_sts_error THEN
5965: RAISE FND_API.g_exc_error;
5966: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5967: RAISE FND_API.g_exc_unexpected_error;
5968: END IF;
5969: END IF;
5970: --END IF; (uday)
5963: );
5964: IF l_return_status = FND_API.g_ret_sts_error THEN
5965: RAISE FND_API.g_exc_error;
5966: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
5967: RAISE FND_API.g_exc_unexpected_error;
5968: END IF;
5969: END IF;
5970: --END IF; (uday)
5971: x_need_to_create := l_needed_to_create;
5970: --END IF; (uday)
5971: x_need_to_create := l_needed_to_create;
5972: x_claim_history_id := l_claim_history_id;
5973: --Standard check of commit
5974: IF FND_API.To_Boolean ( p_commit ) THEN
5975: COMMIT WORK;
5976: END IF;
5977: -- Debug Message
5978: IF OZF_DEBUG_LOW_ON THEN
5981: FND_MSG_PUB.Add;
5982: END IF;
5983: --Standard call to get message count and if count=1, get the message
5984: FND_MSG_PUB.Count_And_Get (
5985: p_encoded => FND_API.G_FALSE,
5986: p_count => x_msg_count,
5987: p_data => x_msg_data
5988: );
5989: EXCEPTION
5986: p_count => x_msg_count,
5987: p_data => x_msg_data
5988: );
5989: EXCEPTION
5990: WHEN FND_API.G_EXC_ERROR THEN
5991: ROLLBACK TO Create_Claim_Hist_PVT;
5992: x_return_status := FND_API.G_RET_STS_ERROR;
5993: -- Standard call to get message count and if count=1, get the message
5994: FND_MSG_PUB.Count_And_Get (
5988: );
5989: EXCEPTION
5990: WHEN FND_API.G_EXC_ERROR THEN
5991: ROLLBACK TO Create_Claim_Hist_PVT;
5992: x_return_status := FND_API.G_RET_STS_ERROR;
5993: -- Standard call to get message count and if count=1, get the message
5994: FND_MSG_PUB.Count_And_Get (
5995: p_encoded => FND_API.G_FALSE,
5996: p_count => x_msg_count,
5991: ROLLBACK TO Create_Claim_Hist_PVT;
5992: x_return_status := FND_API.G_RET_STS_ERROR;
5993: -- Standard call to get message count and if count=1, get the message
5994: FND_MSG_PUB.Count_And_Get (
5995: p_encoded => FND_API.G_FALSE,
5996: p_count => x_msg_count,
5997: p_data => x_msg_data
5998: );
5999: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
5995: p_encoded => FND_API.G_FALSE,
5996: p_count => x_msg_count,
5997: p_data => x_msg_data
5998: );
5999: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
6000: ROLLBACK TO Create_Claim_Hist_PVT;
6001: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
6002: -- Standard call to get message count and if count=1, get the message
6003: FND_MSG_PUB.Count_And_Get (
5997: p_data => x_msg_data
5998: );
5999: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
6000: ROLLBACK TO Create_Claim_Hist_PVT;
6001: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
6002: -- Standard call to get message count and if count=1, get the message
6003: FND_MSG_PUB.Count_And_Get (
6004: p_encoded => FND_API.G_FALSE,
6005: p_count => x_msg_count,
6000: ROLLBACK TO Create_Claim_Hist_PVT;
6001: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
6002: -- Standard call to get message count and if count=1, get the message
6003: FND_MSG_PUB.Count_And_Get (
6004: p_encoded => FND_API.G_FALSE,
6005: p_count => x_msg_count,
6006: p_data => x_msg_data
6007: );
6008: WHEN OTHERS THEN
6006: p_data => x_msg_data
6007: );
6008: WHEN OTHERS THEN
6009: ROLLBACK TO Create_Claim_Hist_PVT;
6010: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
6011: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
6012: THEN
6013: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
6014: END IF;
6013: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
6014: END IF;
6015: -- Standard call to get message count and if count=1, get the message
6016: FND_MSG_PUB.Count_And_Get (
6017: p_encoded => FND_API.G_FALSE,
6018: p_count => x_msg_count,
6019: p_data => x_msg_data
6020: );
6021: --
6032: -- p_claim : the record with new items.
6033: --
6034: -- NOTES
6035: -- 1. Raise exception if the object_version_number doesn't match.
6036: -- 2. If an attribute is passed in as FND_API.g_miss_char/num/date,
6037: -- that column won't be updated.
6038: --
6039: -- HISTORY
6040: --
6040: --
6041: -----------------------------------------------------------------------------------------
6042: PROCEDURE Update_Claim (
6043: p_api_version IN NUMBER
6044: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
6045: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
6046: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
6047:
6048: ,x_return_status OUT NOCOPY VARCHAR2
6041: -----------------------------------------------------------------------------------------
6042: PROCEDURE Update_Claim (
6043: p_api_version IN NUMBER
6044: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
6045: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
6046: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
6047:
6048: ,x_return_status OUT NOCOPY VARCHAR2
6049: ,x_msg_data OUT NOCOPY VARCHAR2
6042: PROCEDURE Update_Claim (
6043: p_api_version IN NUMBER
6044: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
6045: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
6046: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
6047:
6048: ,x_return_status OUT NOCOPY VARCHAR2
6049: ,x_msg_data OUT NOCOPY VARCHAR2
6050: ,x_msg_count OUT NOCOPY NUMBER
6403:
6404:
6405:
6406:
6407: IF NOT FND_API.Compatible_API_Call (
6408: l_api_version,
6409: p_api_version,
6410: l_api_name,
6411: G_PKG_NAME)
6409: p_api_version,
6410: l_api_name,
6411: G_PKG_NAME)
6412: THEN
6413: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6414: END IF;
6415: -- Debug Message
6416: IF OZF_DEBUG_LOW_ON THEN
6417: FND_MESSAGE.Set_Name('OZF','OZF_API_DEBUG_MESSAGE');
6418: FND_MESSAGE.Set_Token('TEXT',l_full_name||': Start');
6419: FND_MSG_PUB.Add;
6420: END IF;
6421: --Initialize message list if p_init_msg_list is TRUE.
6422: IF FND_API.To_Boolean (p_init_msg_list) THEN
6423: FND_MSG_PUB.initialize;
6424: END IF;
6425: -- Initialize API return status to sucess
6426: x_return_status := FND_API.G_RET_STS_SUCCESS;
6422: IF FND_API.To_Boolean (p_init_msg_list) THEN
6423: FND_MSG_PUB.initialize;
6424: END IF;
6425: -- Initialize API return status to sucess
6426: x_return_status := FND_API.G_RET_STS_SUCCESS;
6427:
6428: IF OZF_DEBUG_HIGH_ON THEN
6429: ozf_utility_PVT.debug_message('New1: l_claim.pre_auth_deduction_number:'||l_claim.pre_auth_deduction_number);
6430: ozf_utility_PVT.debug_message('New1: l_claim.customer_ref_number'||l_claim.customer_ref_number);
6432: END IF;
6433:
6434: -- Varify object_version_number
6435: IF (l_claim.object_version_number is NULL or
6436: l_claim.object_version_number = FND_API.G_MISS_NUM ) THEN
6437: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
6438: FND_MESSAGE.Set_Name('OZF', 'OZF_API_NO_OBJ_VER_NUM');
6439: FND_MSG_PUB.ADD;
6440: END IF;
6437: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
6438: FND_MESSAGE.Set_Name('OZF', 'OZF_API_NO_OBJ_VER_NUM');
6439: FND_MSG_PUB.ADD;
6440: END IF;
6441: RAISE FND_API.G_EXC_ERROR;
6442: END IF;
6443:
6444: OPEN object_version_number_csr(l_claim.claim_id);
6445: FETCH object_version_number_csr INTO l_object_version_number;
6449: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
6450: FND_MESSAGE.Set_Name('OZF', 'OZF_API_RESOURCE_LOCKED');
6451: FND_MSG_PUB.ADD;
6452: END IF;
6453: RAISE FND_API.G_EXC_ERROR;
6454: END IF;
6455:
6456: -- Bug: 2732290 -----------------------------------------------------------
6457: IF (l_claim.customer_reason is not NULL
6454: END IF;
6455:
6456: -- Bug: 2732290 -----------------------------------------------------------
6457: IF (l_claim.customer_reason is not NULL
6458: AND l_claim.customer_reason <> FND_API.g_miss_char )
6459: THEN
6460: Get_Customer_Reason(p_cust_account_id => l_claim.cust_account_id,
6461: px_reason_code_id => l_claim.reason_code_id,
6462: p_customer_reason => l_claim.customer_reason,
6460: Get_Customer_Reason(p_cust_account_id => l_claim.cust_account_id,
6461: px_reason_code_id => l_claim.reason_code_id,
6462: p_customer_reason => l_claim.customer_reason,
6463: x_return_status => l_return_status);
6464: IF l_return_status = FND_API.g_ret_sts_error THEN
6465: RAISE FND_API.g_exc_error;
6466: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6467: RAISE FND_API.g_exc_unexpected_error;
6468: END IF;
6461: px_reason_code_id => l_claim.reason_code_id,
6462: p_customer_reason => l_claim.customer_reason,
6463: x_return_status => l_return_status);
6464: IF l_return_status = FND_API.g_ret_sts_error THEN
6465: RAISE FND_API.g_exc_error;
6466: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6467: RAISE FND_API.g_exc_unexpected_error;
6468: END IF;
6469: END IF;
6462: p_customer_reason => l_claim.customer_reason,
6463: x_return_status => l_return_status);
6464: IF l_return_status = FND_API.g_ret_sts_error THEN
6465: RAISE FND_API.g_exc_error;
6466: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6467: RAISE FND_API.g_exc_unexpected_error;
6468: END IF;
6469: END IF;
6470: -- End Bug: 2732290 -----------------------------------------------------------
6463: x_return_status => l_return_status);
6464: IF l_return_status = FND_API.g_ret_sts_error THEN
6465: RAISE FND_API.g_exc_error;
6466: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6467: RAISE FND_API.g_exc_unexpected_error;
6468: END IF;
6469: END IF;
6470: -- End Bug: 2732290 -----------------------------------------------------------
6471:
6480:
6481: IF p_mode = OZF_claim_Utility_pvt.G_MANU_MODE THEN
6482: OZF_CLAIM_UTILITY_PVT.Check_Claim_access(
6483: P_Api_Version_Number => 1.0,
6484: P_Init_Msg_List => FND_API.G_FALSE,
6485: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
6486: P_Commit => FND_API.G_FALSE,
6487: P_object_id => p_claim.claim_id,
6488: P_object_type => G_CLAIM_OBJECT_TYPE,
6481: IF p_mode = OZF_claim_Utility_pvt.G_MANU_MODE THEN
6482: OZF_CLAIM_UTILITY_PVT.Check_Claim_access(
6483: P_Api_Version_Number => 1.0,
6484: P_Init_Msg_List => FND_API.G_FALSE,
6485: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
6486: P_Commit => FND_API.G_FALSE,
6487: P_object_id => p_claim.claim_id,
6488: P_object_type => G_CLAIM_OBJECT_TYPE,
6489: P_user_id => OZF_UTILITY_PVT.get_resource_id(NVL(FND_GLOBAL.user_id,-1)),
6482: OZF_CLAIM_UTILITY_PVT.Check_Claim_access(
6483: P_Api_Version_Number => 1.0,
6484: P_Init_Msg_List => FND_API.G_FALSE,
6485: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
6486: P_Commit => FND_API.G_FALSE,
6487: P_object_id => p_claim.claim_id,
6488: P_object_type => G_CLAIM_OBJECT_TYPE,
6489: P_user_id => OZF_UTILITY_PVT.get_resource_id(NVL(FND_GLOBAL.user_id,-1)),
6490: X_Return_Status => l_return_status,
6496: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
6497: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_NO_ACCESS');
6498: FND_MSG_PUB.Add;
6499: END IF;
6500: RAISE FND_API.G_EXC_ERROR;
6501: END IF;
6502: END IF;
6503:
6504: -- Now the object_version_number matches, we can increase it.
6505: l_object_version_number := l_claim.object_version_number + 1;
6506:
6507: -- Retrieve user_status_id if it is not changed.
6508: IF l_claim.user_status_id is null OR
6509: l_claim.user_status_id = FND_API.G_MISS_NUM THEN
6510: IF l_claim.status_code is null OR
6511: l_claim.status_code = FND_API.G_MISS_CHAR THEN
6512:
6513: OPEN user_status_id_csr(l_claim.claim_id);
6507: -- Retrieve user_status_id if it is not changed.
6508: IF l_claim.user_status_id is null OR
6509: l_claim.user_status_id = FND_API.G_MISS_NUM THEN
6510: IF l_claim.status_code is null OR
6511: l_claim.status_code = FND_API.G_MISS_CHAR THEN
6512:
6513: OPEN user_status_id_csr(l_claim.claim_id);
6514: FETCH user_status_id_csr INTO l_claim.user_status_id;
6515: CLOSE user_status_id_csr;
6532: x_msg_count => l_msg_count,
6533: x_return_status => l_return_status
6534: );
6535:
6536: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
6537: RAISE FND_API.G_EXC_ERROR;
6538: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
6539: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6540: END IF;
6533: x_return_status => l_return_status
6534: );
6535:
6536: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
6537: RAISE FND_API.G_EXC_ERROR;
6538: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
6539: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6540: END IF;
6541:
6534: );
6535:
6536: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
6537: RAISE FND_API.G_EXC_ERROR;
6538: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
6539: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6540: END IF;
6541:
6542: /*
6535:
6536: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
6537: RAISE FND_API.G_EXC_ERROR;
6538: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
6539: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6540: END IF;
6541:
6542: /*
6543: This fix is for bug 13395562
6555: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
6556: FND_MESSAGE.Set_Name('OZF', 'OZF_CLAIM_UPDATE_ERROR');
6557: FND_MSG_PUB.ADD;
6558: END IF;
6559: RAISE FND_API.G_EXC_ERROR;
6560: END IF;
6561:
6562: OPEN csr_user_status_info(l_claim.claim_id);
6563: FETCH csr_user_status_info INTO l_open_status_id, l_close_status_id;
6591: p_claim_rec => l_claim,
6592: x_complete_rec => l_complete_claim,
6593: x_return_status => l_return_status
6594: );
6595: IF l_return_status = FND_API.g_ret_sts_error THEN
6596: RAISE FND_API.g_exc_error;
6597: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6598: RAISE FND_API.g_exc_unexpected_error;
6599: END IF;
6592: x_complete_rec => l_complete_claim,
6593: x_return_status => l_return_status
6594: );
6595: IF l_return_status = FND_API.g_ret_sts_error THEN
6596: RAISE FND_API.g_exc_error;
6597: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6598: RAISE FND_API.g_exc_unexpected_error;
6599: END IF;
6600:
6593: x_return_status => l_return_status
6594: );
6595: IF l_return_status = FND_API.g_ret_sts_error THEN
6596: RAISE FND_API.g_exc_error;
6597: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6598: RAISE FND_API.g_exc_unexpected_error;
6599: END IF;
6600:
6601: l_claim := l_complete_claim;
6594: );
6595: IF l_return_status = FND_API.g_ret_sts_error THEN
6596: RAISE FND_API.g_exc_error;
6597: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6598: RAISE FND_API.g_exc_unexpected_error;
6599: END IF;
6600:
6601: l_claim := l_complete_claim;
6602:
6610: -- l_claim.acctd_amount_remaining := OZF_UTILITY_PVT.CurrRound(l_claim.acctd_amount_remaining, l_claim.currency_code);
6611:
6612: -- Calculate currency conversions if amount is changed
6613: -- Added For ER#9453443
6614: IF(l_claim.offer_id IS NULL or l_claim.offer_id = FND_API.g_miss_num) THEN
6615: check_amount(
6616: p_claim => l_claim,
6617: p_mode => p_mode,
6618: x_amount_changed => l_amount_changed,
6619: x_exchange_changed => l_exchange_changed,
6620: x_pass => l_pass,
6621: x_return_status => l_return_status
6622: );
6623: IF l_return_status = FND_API.g_ret_sts_error THEN
6624: RAISE FND_API.g_exc_error;
6625: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6626: RAISE FND_API.g_exc_unexpected_error;
6627: END IF;
6620: x_pass => l_pass,
6621: x_return_status => l_return_status
6622: );
6623: IF l_return_status = FND_API.g_ret_sts_error THEN
6624: RAISE FND_API.g_exc_error;
6625: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6626: RAISE FND_API.g_exc_unexpected_error;
6627: END IF;
6628: END IF;
6621: x_return_status => l_return_status
6622: );
6623: IF l_return_status = FND_API.g_ret_sts_error THEN
6624: RAISE FND_API.g_exc_error;
6625: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6626: RAISE FND_API.g_exc_unexpected_error;
6627: END IF;
6628: END IF;
6629:
6622: );
6623: IF l_return_status = FND_API.g_ret_sts_error THEN
6624: RAISE FND_API.g_exc_error;
6625: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6626: RAISE FND_API.g_exc_unexpected_error;
6627: END IF;
6628: END IF;
6629:
6630: /*IF OZF_DEBUG_HIGH_ON THEN
6634: */
6635:
6636:
6637: IF l_pass = false THEN
6638: RAISE FND_API.G_EXC_ERROR;
6639: END IF;
6640:
6641: -- Bug: 3359914 -----------------------------------------------------------
6642: -- Reason is a required field when the claim is updated.
6640:
6641: -- Bug: 3359914 -----------------------------------------------------------
6642: -- Reason is a required field when the claim is updated.
6643: IF l_claim.reason_code_id is null
6644: OR l_claim.reason_code_id = FND_API.G_MISS_NUM
6645: THEN
6646: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
6647: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_REASON_CD_MISSING');
6648: FND_MSG_PUB.Add;
6646: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
6647: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_REASON_CD_MISSING');
6648: FND_MSG_PUB.Add;
6649: END IF;
6650: RAISE FND_API.G_EXC_ERROR;
6651: END IF;
6652: -- End Bug: 3359914 -----------------------------------------------------------
6653:
6654:
6661: p_task_template_group_id => l_claim.task_template_group_id,
6662: x_changed => l_reason_code_changed,
6663: x_return_status => l_return_status
6664: );
6665: IF l_return_status = FND_API.g_ret_sts_error THEN
6666: RAISE FND_API.g_exc_error;
6667: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6668: RAISE FND_API.g_exc_unexpected_error;
6669: END IF;
6662: x_changed => l_reason_code_changed,
6663: x_return_status => l_return_status
6664: );
6665: IF l_return_status = FND_API.g_ret_sts_error THEN
6666: RAISE FND_API.g_exc_error;
6667: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6668: RAISE FND_API.g_exc_unexpected_error;
6669: END IF;
6670:
6663: x_return_status => l_return_status
6664: );
6665: IF l_return_status = FND_API.g_ret_sts_error THEN
6666: RAISE FND_API.g_exc_error;
6667: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6668: RAISE FND_API.g_exc_unexpected_error;
6669: END IF;
6670:
6671: -- ----------------------------------------------------------------------------
6664: );
6665: IF l_return_status = FND_API.g_ret_sts_error THEN
6666: RAISE FND_API.g_exc_error;
6667: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6668: RAISE FND_API.g_exc_unexpected_error;
6669: END IF;
6670:
6671: -- ----------------------------------------------------------------------------
6672: -- Bug : 2732290
6687: -- Bug#-5954318 : Start
6688: IF (l_old_reason_code_id <> l_claim.reason_code_id AND
6689: (--l_old_task_template_group_id = l_claim.task_template_group_id OR
6690: l_claim.task_template_group_id is null OR
6691: l_claim.task_template_group_id = fnd_api.g_miss_num))THEN
6692: l_claim.task_template_group_id := get_action_id(l_claim.reason_code_id);
6693: END IF;
6694: -- Bug#-5954318 : End
6695:
6711: IF l_old_status_code <> l_claim.status_code THEN
6712: -- if user change status to dupliate, we need to have duplicate_claim_id as inputs
6713: IF l_claim.status_code = G_DUPLICATE_STATUS THEN
6714: IF l_claim.duplicate_claim_id is null OR
6715: l_claim.duplicate_claim_id = FND_API.G_MISS_NUM THEN
6716: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
6717: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_DUP_CLM_ID_MISSING');
6718: FND_MSG_PUB.add;
6719: END IF;
6716: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
6717: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_DUP_CLM_ID_MISSING');
6718: FND_MSG_PUB.add;
6719: END IF;
6720: RAISE FND_API.G_EXC_ERROR;
6721: END IF;
6722:
6723: -- Raise an error
6724: -- if the duplicate_claim_id equal to the current claim_id
6726: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
6727: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_DUP_ID_SAME');
6728: FND_MSG_PUB.Add;
6729: END IF;
6730: RAISE FND_API.G_EXC_ERROR;
6731: END IF;
6732: END IF;
6733:
6734: -- if user change status from duplicate, we need to set duplicate_claim_id as null
6752: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
6753: FND_MESSAGE.Set_Name('OZF', 'OZF_CLAIM_UPDT_OWNER_PERM');
6754: FND_MSG_PUB.ADD;
6755: END IF;
6756: RAISE FND_API.G_EXC_ERROR;
6757: END IF;
6758: -- delete access for the current owner
6759: OPEN owner_access_csr(l_claim.claim_id, l_old_owner_id);
6760: FETCH owner_access_csr into l_access_id, l_access_obj_ver;
6761: CLOSE owner_access_csr;
6762:
6763: AMS_ACCESS_PVT.delete_access(
6764: p_api_version => l_api_version
6765: ,p_init_msg_list => fnd_api.g_false
6766: ,p_validation_level => p_validation_level
6767: ,x_return_status => l_return_status
6768: ,x_msg_count => x_msg_count
6769: ,x_msg_data => x_msg_data
6766: ,p_validation_level => p_validation_level
6767: ,x_return_status => l_return_status
6768: ,x_msg_count => x_msg_count
6769: ,x_msg_data => x_msg_data
6770: ,p_commit => fnd_api.g_false
6771: ,p_access_id =>l_access_id
6772: ,p_object_version =>l_access_obj_ver
6773: );
6774: IF l_return_status = fnd_api.g_ret_sts_error THEN
6770: ,p_commit => fnd_api.g_false
6771: ,p_access_id =>l_access_id
6772: ,p_object_version =>l_access_obj_ver
6773: );
6774: IF l_return_status = fnd_api.g_ret_sts_error THEN
6775: RAISE fnd_api.g_exc_error;
6776: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6777: RAISE fnd_api.g_exc_unexpected_error;
6778: END IF;
6771: ,p_access_id =>l_access_id
6772: ,p_object_version =>l_access_obj_ver
6773: );
6774: IF l_return_status = fnd_api.g_ret_sts_error THEN
6775: RAISE fnd_api.g_exc_error;
6776: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6777: RAISE fnd_api.g_exc_unexpected_error;
6778: END IF;
6779:
6772: ,p_object_version =>l_access_obj_ver
6773: );
6774: IF l_return_status = fnd_api.g_ret_sts_error THEN
6775: RAISE fnd_api.g_exc_error;
6776: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6777: RAISE fnd_api.g_exc_unexpected_error;
6778: END IF;
6779:
6780:
6773: );
6774: IF l_return_status = fnd_api.g_ret_sts_error THEN
6775: RAISE fnd_api.g_exc_error;
6776: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6777: RAISE fnd_api.g_exc_unexpected_error;
6778: END IF;
6779:
6780:
6781: -- Added for bug fix 4247328
6789: CLOSE owner_access_csr;
6790:
6791: AMS_ACCESS_PVT.delete_access(
6792: p_api_version => l_api_version
6793: ,p_init_msg_list => fnd_api.g_false
6794: ,p_validation_level => p_validation_level
6795: ,x_return_status => l_return_status
6796: ,x_msg_count => x_msg_count
6797: ,x_msg_data => x_msg_data
6794: ,p_validation_level => p_validation_level
6795: ,x_return_status => l_return_status
6796: ,x_msg_count => x_msg_count
6797: ,x_msg_data => x_msg_data
6798: ,p_commit => fnd_api.g_false
6799: ,p_access_id =>l_access_id
6800: ,p_object_version =>l_access_obj_ver
6801: );
6802: IF l_return_status = fnd_api.g_ret_sts_error THEN
6798: ,p_commit => fnd_api.g_false
6799: ,p_access_id =>l_access_id
6800: ,p_object_version =>l_access_obj_ver
6801: );
6802: IF l_return_status = fnd_api.g_ret_sts_error THEN
6803: RAISE fnd_api.g_exc_error;
6804: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6805: RAISE fnd_api.g_exc_unexpected_error;
6806: END IF;
6799: ,p_access_id =>l_access_id
6800: ,p_object_version =>l_access_obj_ver
6801: );
6802: IF l_return_status = fnd_api.g_ret_sts_error THEN
6803: RAISE fnd_api.g_exc_error;
6804: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6805: RAISE fnd_api.g_exc_unexpected_error;
6806: END IF;
6807:
6800: ,p_object_version =>l_access_obj_ver
6801: );
6802: IF l_return_status = fnd_api.g_ret_sts_error THEN
6803: RAISE fnd_api.g_exc_error;
6804: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6805: RAISE fnd_api.g_exc_unexpected_error;
6806: END IF;
6807:
6808: END IF;
6801: );
6802: IF l_return_status = fnd_api.g_ret_sts_error THEN
6803: RAISE fnd_api.g_exc_error;
6804: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6805: RAISE fnd_api.g_exc_unexpected_error;
6806: END IF;
6807:
6808: END IF;
6809:
6809:
6810: -- Default owner_id if necessary
6811:
6812: IF (l_claim.owner_id is not null AND
6813: l_claim.owner_id <> FND_API.G_MISS_NUM) THEN
6814:
6815: -- Add the new owner to the access list
6816: l_access_list(1).arc_act_access_to_object := G_CLAIM_OBJECT_TYPE;
6817: l_access_list(1).user_or_role_id := l_claim.owner_id;
6837: p_claim_class => l_claim.claim_class,
6838: x_owner_id => l_claim.owner_id,
6839: x_access_list => l_access_list,
6840: x_return_status => l_return_status);
6841: IF l_return_status = FND_API.g_ret_sts_error THEN
6842: RAISE FND_API.g_exc_error;
6843: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6844: RAISE FND_API.g_exc_unexpected_error;
6845: END IF;
6838: x_owner_id => l_claim.owner_id,
6839: x_access_list => l_access_list,
6840: x_return_status => l_return_status);
6841: IF l_return_status = FND_API.g_ret_sts_error THEN
6842: RAISE FND_API.g_exc_error;
6843: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6844: RAISE FND_API.g_exc_unexpected_error;
6845: END IF;
6846:
6839: x_access_list => l_access_list,
6840: x_return_status => l_return_status);
6841: IF l_return_status = FND_API.g_ret_sts_error THEN
6842: RAISE FND_API.g_exc_error;
6843: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6844: RAISE FND_API.g_exc_unexpected_error;
6845: END IF;
6846:
6847: -- Default to system parameter if can not find an owner_id
6840: x_return_status => l_return_status);
6841: IF l_return_status = FND_API.g_ret_sts_error THEN
6842: RAISE FND_API.g_exc_error;
6843: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6844: RAISE FND_API.g_exc_unexpected_error;
6845: END IF;
6846:
6847: -- Default to system parameter if can not find an owner_id
6848: IF (l_claim.owner_id is null OR
6845: END IF;
6846:
6847: -- Default to system parameter if can not find an owner_id
6848: IF (l_claim.owner_id is null OR
6849: l_claim.owner_id = FND_API.G_MISS_NUM) THEN
6850:
6851: OPEN default_owner_id_csr;
6852: FETCH default_owner_id_csr into l_claim.owner_id;
6853: CLOSE default_owner_id_csr;
6879: IF l_claim_access_list.COUNT <>0 THEN
6880: FOR i in 1..l_claim_access_list.LAST LOOP
6881: AMS_ACCESS_PVT.delete_access(
6882: p_api_version => l_api_version
6883: ,p_init_msg_list => fnd_api.g_false
6884: ,p_validation_level => p_validation_level
6885: ,x_return_status => l_return_status
6886: ,x_msg_count => x_msg_count
6887: ,x_msg_data => x_msg_data
6884: ,p_validation_level => p_validation_level
6885: ,x_return_status => l_return_status
6886: ,x_msg_count => x_msg_count
6887: ,x_msg_data => x_msg_data
6888: ,p_commit => fnd_api.g_false
6889: ,p_access_id =>l_claim_access_list(i).activity_access_id
6890: ,p_object_version =>l_claim_access_list(i).object_version_number
6891: );
6892: IF l_return_status = fnd_api.g_ret_sts_error THEN
6888: ,p_commit => fnd_api.g_false
6889: ,p_access_id =>l_claim_access_list(i).activity_access_id
6890: ,p_object_version =>l_claim_access_list(i).object_version_number
6891: );
6892: IF l_return_status = fnd_api.g_ret_sts_error THEN
6893: RAISE fnd_api.g_exc_error;
6894: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6895: RAISE fnd_api.g_exc_unexpected_error;
6896: END IF;
6889: ,p_access_id =>l_claim_access_list(i).activity_access_id
6890: ,p_object_version =>l_claim_access_list(i).object_version_number
6891: );
6892: IF l_return_status = fnd_api.g_ret_sts_error THEN
6893: RAISE fnd_api.g_exc_error;
6894: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6895: RAISE fnd_api.g_exc_unexpected_error;
6896: END IF;
6897: END LOOP;
6890: ,p_object_version =>l_claim_access_list(i).object_version_number
6891: );
6892: IF l_return_status = fnd_api.g_ret_sts_error THEN
6893: RAISE fnd_api.g_exc_error;
6894: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6895: RAISE fnd_api.g_exc_unexpected_error;
6896: END IF;
6897: END LOOP;
6898: END IF;
6891: );
6892: IF l_return_status = fnd_api.g_ret_sts_error THEN
6893: RAISE fnd_api.g_exc_error;
6894: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
6895: RAISE fnd_api.g_exc_unexpected_error;
6896: END IF;
6897: END LOOP;
6898: END IF;
6899: ELSE
6901: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
6902: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_UPDATE_OWNER_ERR');
6903: FND_MSG_PUB.add;
6904: END IF;
6905: RAISE FND_API.g_exc_error;
6906: END IF;
6907: END IF;
6908:
6909: /*
6915: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
6916: fnd_message.set_name('OZF', 'OZF_CLAIM_GL_FUNCUR_MISSING');
6917: fnd_msg_pub.add;
6918: END IF;
6919: RAISE fnd_api.g_exc_error;
6920: END IF;
6921: CLOSE gp_func_currency_cd_csr;
6922: IF l_claim.currency_code <> l_functional_currency_code THEN
6923: IF l_claim.exchange_rate_type is null OR
6920: END IF;
6921: CLOSE gp_func_currency_cd_csr;
6922: IF l_claim.currency_code <> l_functional_currency_code THEN
6923: IF l_claim.exchange_rate_type is null OR
6924: l_claim.exchange_rate_type = FND_API.G_MISS_CHAR THEN
6925: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
6926: fnd_message.set_name('OZF', 'OZF_CLAIM_CONTYPE_MISSING');
6927: fnd_msg_pub.add;
6928: END IF;
6925: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
6926: fnd_message.set_name('OZF', 'OZF_CLAIM_CONTYPE_MISSING');
6927: fnd_msg_pub.add;
6928: END IF;
6929: RAISE fnd_api.g_exc_error;
6930: END IF;
6931: IF l_claim.acctd_amount IS NOT NULL THEN
6932: OPEN csr_batch_type (l_claim.batch_id);
6933: FETCH csr_batch_type INTO l_batch_type;
6955: P_AMOUNT => l_claim.amount,
6956: X_RETURN_STATUS => l_return_status,
6957: X_ACC_AMOUNT => l_acc_amount,
6958: X_RATE => l_rate);
6959: IF l_return_status = FND_API.g_ret_sts_error THEN
6960: RAISE FND_API.g_exc_error;
6961: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6962: RAISE FND_API.g_exc_unexpected_error;
6963: END IF;
6956: X_RETURN_STATUS => l_return_status,
6957: X_ACC_AMOUNT => l_acc_amount,
6958: X_RATE => l_rate);
6959: IF l_return_status = FND_API.g_ret_sts_error THEN
6960: RAISE FND_API.g_exc_error;
6961: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6962: RAISE FND_API.g_exc_unexpected_error;
6963: END IF;
6964: IF l_claim_old_rec.exchange_rate = l_rate THEN
6957: X_ACC_AMOUNT => l_acc_amount,
6958: X_RATE => l_rate);
6959: IF l_return_status = FND_API.g_ret_sts_error THEN
6960: RAISE FND_API.g_exc_error;
6961: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6962: RAISE FND_API.g_exc_unexpected_error;
6963: END IF;
6964: IF l_claim_old_rec.exchange_rate = l_rate THEN
6965: --New Exchange Rate is still the same as Old Exchange Rate.
6958: X_RATE => l_rate);
6959: IF l_return_status = FND_API.g_ret_sts_error THEN
6960: RAISE FND_API.g_exc_error;
6961: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
6962: RAISE FND_API.g_exc_unexpected_error;
6963: END IF;
6964: IF l_claim_old_rec.exchange_rate = l_rate THEN
6965: --New Exchange Rate is still the same as Old Exchange Rate.
6966: --So there is no need to do currenncy conversion and recalculation.
6986: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
6987: fnd_message.set_name('OZF', 'OZF_CLAIM_GL_FUNCUR_MISSING');
6988: fnd_msg_pub.add;
6989: END IF;
6990: RAISE fnd_api.g_exc_error;
6991: END IF;
6992: CLOSE gp_func_currency_cd_csr;
6993:
6994: --Bug# 7319828 fixed by ateotia(-)
7004: l_claim.exchange_rate :=1;
7005: END IF;
7006: -- Bugfix: 10176541
7007: IF l_claim.exchange_rate_type is null OR
7008: l_claim.exchange_rate_type = FND_API.G_MISS_CHAR THEN
7009: OPEN exchange_rate_type_csr;
7010: FETCH exchange_rate_type_csr into l_claim.exchange_rate_type;
7011: CLOSE exchange_rate_type_csr;
7012:
7010: FETCH exchange_rate_type_csr into l_claim.exchange_rate_type;
7011: CLOSE exchange_rate_type_csr;
7012:
7013: IF l_claim.exchange_rate_type is null OR
7014: l_claim.exchange_rate_type = FND_API.G_MISS_CHAR THEN
7015: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
7016: fnd_message.set_name('OZF', 'OZF_CLAIM_CONTYPE_MISSING');
7017: fnd_msg_pub.add;
7018: END IF;
7015: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_error) THEN
7016: fnd_message.set_name('OZF', 'OZF_CLAIM_CONTYPE_MISSING');
7017: fnd_msg_pub.add;
7018: END IF;
7019: RAISE fnd_api.g_exc_error;
7020: END IF;
7021: END IF;
7022:
7023: IF l_claim.exchange_rate_date is null OR
7020: END IF;
7021: END IF;
7022:
7023: IF l_claim.exchange_rate_date is null OR
7024: l_claim.exchange_rate_date = FND_API.G_MISS_DATE THEN
7025:
7026: -- Default exchange_rate_date to sysdate
7027: l_claim.exchange_rate_date := SYSDATE;
7028: END IF;
7039: X_RETURN_STATUS => l_return_status,
7040: X_ACC_AMOUNT => l_acc_amount,
7041: X_RATE => l_rate
7042: );
7043: IF l_return_status = FND_API.g_ret_sts_error THEN
7044: RAISE FND_API.g_exc_error;
7045: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7046: RAISE FND_API.g_exc_unexpected_error;
7047: END IF;
7040: X_ACC_AMOUNT => l_acc_amount,
7041: X_RATE => l_rate
7042: );
7043: IF l_return_status = FND_API.g_ret_sts_error THEN
7044: RAISE FND_API.g_exc_error;
7045: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7046: RAISE FND_API.g_exc_unexpected_error;
7047: END IF;
7048: l_claim.exchange_rate := l_rate;
7041: X_RATE => l_rate
7042: );
7043: IF l_return_status = FND_API.g_ret_sts_error THEN
7044: RAISE FND_API.g_exc_error;
7045: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7046: RAISE FND_API.g_exc_unexpected_error;
7047: END IF;
7048: l_claim.exchange_rate := l_rate;
7049: l_claim.ACCTD_AMOUNT := l_acc_amount;
7042: );
7043: IF l_return_status = FND_API.g_ret_sts_error THEN
7044: RAISE FND_API.g_exc_error;
7045: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7046: RAISE FND_API.g_exc_unexpected_error;
7047: END IF;
7048: l_claim.exchange_rate := l_rate;
7049: l_claim.ACCTD_AMOUNT := l_acc_amount;
7050:
7115: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
7116: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_AMT_REM_ERR');
7117: FND_MSG_PUB.add;
7118: END IF;
7119: RAISE FND_API.g_exc_error;
7120: END IF;
7121: END IF; --End of relaxation.
7122:
7123: -- convert amount_remaing.
7132: X_RETURN_STATUS => l_return_status,
7133: X_ACC_AMOUNT => l_acc_amount,
7134: X_RATE => l_rate
7135: );
7136: IF l_return_status = FND_API.g_ret_sts_error THEN
7137: RAISE FND_API.g_exc_error;
7138: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7139: RAISE FND_API.g_exc_unexpected_error;
7140: END IF;
7133: X_ACC_AMOUNT => l_acc_amount,
7134: X_RATE => l_rate
7135: );
7136: IF l_return_status = FND_API.g_ret_sts_error THEN
7137: RAISE FND_API.g_exc_error;
7138: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7139: RAISE FND_API.g_exc_unexpected_error;
7140: END IF;
7141: l_claim.ACCTD_AMOUNT_REMAINING := l_acc_amount;
7134: X_RATE => l_rate
7135: );
7136: IF l_return_status = FND_API.g_ret_sts_error THEN
7137: RAISE FND_API.g_exc_error;
7138: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7139: RAISE FND_API.g_exc_unexpected_error;
7140: END IF;
7141: l_claim.ACCTD_AMOUNT_REMAINING := l_acc_amount;
7142:
7135: );
7136: IF l_return_status = FND_API.g_ret_sts_error THEN
7137: RAISE FND_API.g_exc_error;
7138: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7139: RAISE FND_API.g_exc_unexpected_error;
7140: END IF;
7141: l_claim.ACCTD_AMOUNT_REMAINING := l_acc_amount;
7142:
7143: l_claim.amount_remaining := OZF_UTILITY_PVT.CurrRound(l_claim.amount_remaining, l_claim.currency_code);
7159: X_RETURN_STATUS => l_return_status,
7160: X_ACC_AMOUNT => l_acc_amount,
7161: X_RATE => l_rate
7162: );
7163: IF l_return_status = FND_API.g_ret_sts_error THEN
7164: RAISE FND_API.g_exc_error;
7165: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7166: RAISE FND_API.g_exc_unexpected_error;
7167: END IF;
7160: X_ACC_AMOUNT => l_acc_amount,
7161: X_RATE => l_rate
7162: );
7163: IF l_return_status = FND_API.g_ret_sts_error THEN
7164: RAISE FND_API.g_exc_error;
7165: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7166: RAISE FND_API.g_exc_unexpected_error;
7167: END IF;
7168: l_claim.ACCTD_amount_settled := l_acc_amount;
7161: X_RATE => l_rate
7162: );
7163: IF l_return_status = FND_API.g_ret_sts_error THEN
7164: RAISE FND_API.g_exc_error;
7165: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7166: RAISE FND_API.g_exc_unexpected_error;
7167: END IF;
7168: l_claim.ACCTD_amount_settled := l_acc_amount;
7169:
7162: );
7163: IF l_return_status = FND_API.g_ret_sts_error THEN
7164: RAISE FND_API.g_exc_error;
7165: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7166: RAISE FND_API.g_exc_unexpected_error;
7167: END IF;
7168: l_claim.ACCTD_amount_settled := l_acc_amount;
7169:
7170: l_claim.acctd_amount_settled := OZF_UTILITY_PVT.CurrRound(l_claim.acctd_amount_settled,l_functional_currency_code);
7181: X_RETURN_STATUS => l_return_status,
7182: X_ACC_AMOUNT => l_acc_amount,
7183: X_RATE => l_rate
7184: );
7185: IF l_return_status = FND_API.g_ret_sts_error THEN
7186: RAISE FND_API.g_exc_error;
7187: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7188: RAISE FND_API.g_exc_unexpected_error;
7189: END IF;
7182: X_ACC_AMOUNT => l_acc_amount,
7183: X_RATE => l_rate
7184: );
7185: IF l_return_status = FND_API.g_ret_sts_error THEN
7186: RAISE FND_API.g_exc_error;
7187: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7188: RAISE FND_API.g_exc_unexpected_error;
7189: END IF;
7190: l_claim.ACCTD_amount_adjusted := l_acc_amount;
7183: X_RATE => l_rate
7184: );
7185: IF l_return_status = FND_API.g_ret_sts_error THEN
7186: RAISE FND_API.g_exc_error;
7187: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7188: RAISE FND_API.g_exc_unexpected_error;
7189: END IF;
7190: l_claim.ACCTD_amount_adjusted := l_acc_amount;
7191:
7184: );
7185: IF l_return_status = FND_API.g_ret_sts_error THEN
7186: RAISE FND_API.g_exc_error;
7187: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7188: RAISE FND_API.g_exc_unexpected_error;
7189: END IF;
7190: l_claim.ACCTD_amount_adjusted := l_acc_amount;
7191:
7192: l_claim.acctd_amount_adjusted := OZF_UTILITY_PVT.CurrRound(l_claim.acctd_amount_adjusted,l_functional_currency_code);
7197: IF l_old_cust_acct_id <> l_claim.cust_account_id THEN
7198: /*get_days_due (p_cust_accout_id => l_claim.cust_account_id,
7199: x_days_due => l_days_due,
7200: x_return_status => l_return_status);
7201: IF l_return_status = FND_API.g_ret_sts_error THEN
7202: RAISE FND_API.g_exc_error;
7203: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7204: RAISE FND_API.g_exc_unexpected_error;
7205: END IF;
7198: /*get_days_due (p_cust_accout_id => l_claim.cust_account_id,
7199: x_days_due => l_days_due,
7200: x_return_status => l_return_status);
7201: IF l_return_status = FND_API.g_ret_sts_error THEN
7202: RAISE FND_API.g_exc_error;
7203: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7204: RAISE FND_API.g_exc_unexpected_error;
7205: END IF;
7206: */
7199: x_days_due => l_days_due,
7200: x_return_status => l_return_status);
7201: IF l_return_status = FND_API.g_ret_sts_error THEN
7202: RAISE FND_API.g_exc_error;
7203: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7204: RAISE FND_API.g_exc_unexpected_error;
7205: END IF;
7206: */
7207: -- Claim Due Date should be always claim date
7200: x_return_status => l_return_status);
7201: IF l_return_status = FND_API.g_ret_sts_error THEN
7202: RAISE FND_API.g_exc_error;
7203: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7204: RAISE FND_API.g_exc_unexpected_error;
7205: END IF;
7206: */
7207: -- Claim Due Date should be always claim date
7208: -- Fix for Bug 11793070
7210:
7211: get_customer_info(p_claim => l_claim,
7212: x_claim => l_complete_claim,
7213: x_return_status => l_return_status);
7214: IF l_return_status = FND_API.g_ret_sts_error THEN
7215: RAISE FND_API.g_exc_error;
7216: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7217: RAISE FND_API.g_exc_unexpected_error;
7218: END IF;
7211: get_customer_info(p_claim => l_claim,
7212: x_claim => l_complete_claim,
7213: x_return_status => l_return_status);
7214: IF l_return_status = FND_API.g_ret_sts_error THEN
7215: RAISE FND_API.g_exc_error;
7216: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7217: RAISE FND_API.g_exc_unexpected_error;
7218: END IF;
7219:
7212: x_claim => l_complete_claim,
7213: x_return_status => l_return_status);
7214: IF l_return_status = FND_API.g_ret_sts_error THEN
7215: RAISE FND_API.g_exc_error;
7216: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7217: RAISE FND_API.g_exc_unexpected_error;
7218: END IF;
7219:
7220: l_claim := l_complete_claim;
7213: x_return_status => l_return_status);
7214: IF l_return_status = FND_API.g_ret_sts_error THEN
7215: RAISE FND_API.g_exc_error;
7216: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7217: RAISE FND_API.g_exc_unexpected_error;
7218: END IF;
7219:
7220: l_claim := l_complete_claim;
7221: END IF;
7222:
7223: -- Bug4334023: User entered only shipto site then default shipto customer
7224: IF l_claim.ship_to_cust_account_id IS NULL THEN
7225: IF (l_claim.cust_shipto_acct_site_id is not null AND
7226: l_claim.cust_shipto_acct_site_id <> FND_API.G_MISS_NUM) THEN
7227: OPEN shipto_cust_account_id_csr(l_claim.cust_shipto_acct_site_id);
7228: FETCH shipto_cust_account_id_csr INTO l_claim.ship_to_cust_account_id;
7229: CLOSE shipto_cust_account_id_csr;
7230: END IF;
7233: -- normalize the customer reference number if changed
7234: -- normalize the customer reference number if changed
7235: -- Fixed: uday poluri date:03-Jun-2003. following if condition is added to avoid normalize in case of null
7236: -- customer_ref_number.
7237: IF (l_claim.customer_ref_number is not null or l_claim.customer_ref_number <> FND_API.g_miss_char) then
7238: IF (l_old_customer_ref_number IS NULL AND l_claim.customer_ref_number IS NOT NULL) OR
7239: (l_old_customer_ref_number IS NOT NULL AND l_claim.customer_ref_number IS NULL) OR
7240: l_old_customer_ref_number <> l_claim.customer_ref_number THEN
7241:
7276:
7277: IF(l_claim_line_tbl.COUNT > 0 ) THEN
7278: OZF_Claim_Line_PVT.Delete_Claim_Line_Tbl(
7279: p_api_version => l_api_version
7280: ,p_init_msg_list => FND_API.g_false
7281: ,p_commit => FND_API.g_false
7282: ,p_validation_level => FND_API.g_valid_level_full
7283: ,x_return_status => l_return_status
7284: ,x_msg_count => l_msg_count
7277: IF(l_claim_line_tbl.COUNT > 0 ) THEN
7278: OZF_Claim_Line_PVT.Delete_Claim_Line_Tbl(
7279: p_api_version => l_api_version
7280: ,p_init_msg_list => FND_API.g_false
7281: ,p_commit => FND_API.g_false
7282: ,p_validation_level => FND_API.g_valid_level_full
7283: ,x_return_status => l_return_status
7284: ,x_msg_count => l_msg_count
7285: ,x_msg_data => l_msg_data
7278: OZF_Claim_Line_PVT.Delete_Claim_Line_Tbl(
7279: p_api_version => l_api_version
7280: ,p_init_msg_list => FND_API.g_false
7281: ,p_commit => FND_API.g_false
7282: ,p_validation_level => FND_API.g_valid_level_full
7283: ,x_return_status => l_return_status
7284: ,x_msg_count => l_msg_count
7285: ,x_msg_data => l_msg_data
7286: ,p_claim_line_tbl => l_claim_line_tbl
7283: ,x_return_status => l_return_status
7284: ,x_msg_count => l_msg_count
7285: ,x_msg_data => l_msg_data
7286: ,p_claim_line_tbl => l_claim_line_tbl
7287: ,p_change_object_version => FND_API.g_false
7288: ,x_error_index => l_error_index
7289: );
7290: IF l_return_status = FND_API.g_ret_sts_error THEN
7291: RAISE FND_API.g_exc_unexpected_error;
7286: ,p_claim_line_tbl => l_claim_line_tbl
7287: ,p_change_object_version => FND_API.g_false
7288: ,x_error_index => l_error_index
7289: );
7290: IF l_return_status = FND_API.g_ret_sts_error THEN
7291: RAISE FND_API.g_exc_unexpected_error;
7292: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7293: RAISE FND_API.g_exc_unexpected_error;
7294: END IF;
7287: ,p_change_object_version => FND_API.g_false
7288: ,x_error_index => l_error_index
7289: );
7290: IF l_return_status = FND_API.g_ret_sts_error THEN
7291: RAISE FND_API.g_exc_unexpected_error;
7292: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7293: RAISE FND_API.g_exc_unexpected_error;
7294: END IF;
7295: END IF; -- End of delete claim line
7288: ,x_error_index => l_error_index
7289: );
7290: IF l_return_status = FND_API.g_ret_sts_error THEN
7291: RAISE FND_API.g_exc_unexpected_error;
7292: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7293: RAISE FND_API.g_exc_unexpected_error;
7294: END IF;
7295: END IF; -- End of delete claim line
7296:
7289: );
7290: IF l_return_status = FND_API.g_ret_sts_error THEN
7291: RAISE FND_API.g_exc_unexpected_error;
7292: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7293: RAISE FND_API.g_exc_unexpected_error;
7294: END IF;
7295: END IF; -- End of delete claim line
7296:
7297: END IF;
7302: OZF_Utility_PVT.debug_message('l_old_offer_id1 :' || l_old_offer_id);
7303: OZF_Utility_PVT.debug_message('New1: l_claim.settled_from22'||l_claim.settled_from);
7304: END IF;
7305: -- Added the Check for settled_from for bug fix 9814130
7306: IF ((l_claim.offer_id IS NOT NULL AND l_claim.offer_id <> FND_API.G_MISS_NUM)
7307: AND(
7308: (l_old_offer_id IS NULL OR l_old_offer_id = FND_API.G_MISS_NUM)
7309: OR
7310: (l_old_offer_id IS NOT NULL AND l_old_offer_id <> FND_API.G_MISS_NUM AND (l_claim.offer_id <> l_old_offer_id
7304: END IF;
7305: -- Added the Check for settled_from for bug fix 9814130
7306: IF ((l_claim.offer_id IS NOT NULL AND l_claim.offer_id <> FND_API.G_MISS_NUM)
7307: AND(
7308: (l_old_offer_id IS NULL OR l_old_offer_id = FND_API.G_MISS_NUM)
7309: OR
7310: (l_old_offer_id IS NOT NULL AND l_old_offer_id <> FND_API.G_MISS_NUM AND (l_claim.offer_id <> l_old_offer_id
7311: OR l_claim.claim_class = 'DEDUCTION'))
7312: )
7306: IF ((l_claim.offer_id IS NOT NULL AND l_claim.offer_id <> FND_API.G_MISS_NUM)
7307: AND(
7308: (l_old_offer_id IS NULL OR l_old_offer_id = FND_API.G_MISS_NUM)
7309: OR
7310: (l_old_offer_id IS NOT NULL AND l_old_offer_id <> FND_API.G_MISS_NUM AND (l_claim.offer_id <> l_old_offer_id
7311: OR l_claim.claim_class = 'DEDUCTION'))
7312: )
7313: AND (l_claim.settled_from IS NULL OR l_claim.settled_from =FND_API.G_MISS_CHAR )
7314: ) THEN
7309: OR
7310: (l_old_offer_id IS NOT NULL AND l_old_offer_id <> FND_API.G_MISS_NUM AND (l_claim.offer_id <> l_old_offer_id
7311: OR l_claim.claim_class = 'DEDUCTION'))
7312: )
7313: AND (l_claim.settled_from IS NULL OR l_claim.settled_from =FND_API.G_MISS_CHAR )
7314: ) THEN
7315:
7316: IF (l_claim.claim_class IN ('CLAIM', 'DEDUCTION')) THEN
7317: OPEN claim_line_count_csr(l_claim.claim_id);
7325: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
7326: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_LINE_EXISTS');
7327: FND_MSG_PUB.Add;
7328: END IF;
7329: RAISE FND_API.G_EXC_ERROR;
7330: END IF;
7331: END IF;
7332:
7333: IF (l_claim.claim_class = 'DEDUCTION')THEN
7352:
7353: IF(l_claim_line_tbl.COUNT > 0 ) THEN
7354: OZF_Claim_Line_PVT.Delete_Claim_Line_Tbl(
7355: p_api_version => l_api_version
7356: ,p_init_msg_list => FND_API.g_false
7357: ,p_commit => FND_API.g_false
7358: ,p_validation_level => FND_API.g_valid_level_full
7359: ,x_return_status => l_return_status
7360: ,x_msg_count => l_msg_count
7353: IF(l_claim_line_tbl.COUNT > 0 ) THEN
7354: OZF_Claim_Line_PVT.Delete_Claim_Line_Tbl(
7355: p_api_version => l_api_version
7356: ,p_init_msg_list => FND_API.g_false
7357: ,p_commit => FND_API.g_false
7358: ,p_validation_level => FND_API.g_valid_level_full
7359: ,x_return_status => l_return_status
7360: ,x_msg_count => l_msg_count
7361: ,x_msg_data => l_msg_data
7354: OZF_Claim_Line_PVT.Delete_Claim_Line_Tbl(
7355: p_api_version => l_api_version
7356: ,p_init_msg_list => FND_API.g_false
7357: ,p_commit => FND_API.g_false
7358: ,p_validation_level => FND_API.g_valid_level_full
7359: ,x_return_status => l_return_status
7360: ,x_msg_count => l_msg_count
7361: ,x_msg_data => l_msg_data
7362: ,p_claim_line_tbl => l_claim_line_tbl
7359: ,x_return_status => l_return_status
7360: ,x_msg_count => l_msg_count
7361: ,x_msg_data => l_msg_data
7362: ,p_claim_line_tbl => l_claim_line_tbl
7363: ,p_change_object_version => FND_API.g_false
7364: ,x_error_index => l_error_index
7365: );
7366: IF l_return_status = FND_API.g_ret_sts_error THEN
7367: RAISE FND_API.g_exc_unexpected_error;
7362: ,p_claim_line_tbl => l_claim_line_tbl
7363: ,p_change_object_version => FND_API.g_false
7364: ,x_error_index => l_error_index
7365: );
7366: IF l_return_status = FND_API.g_ret_sts_error THEN
7367: RAISE FND_API.g_exc_unexpected_error;
7368: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7369: RAISE FND_API.g_exc_unexpected_error;
7370: END IF;
7363: ,p_change_object_version => FND_API.g_false
7364: ,x_error_index => l_error_index
7365: );
7366: IF l_return_status = FND_API.g_ret_sts_error THEN
7367: RAISE FND_API.g_exc_unexpected_error;
7368: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7369: RAISE FND_API.g_exc_unexpected_error;
7370: END IF;
7371: END IF; -- End of delete claim line
7364: ,x_error_index => l_error_index
7365: );
7366: IF l_return_status = FND_API.g_ret_sts_error THEN
7367: RAISE FND_API.g_exc_unexpected_error;
7368: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7369: RAISE FND_API.g_exc_unexpected_error;
7370: END IF;
7371: END IF; -- End of delete claim line
7372: ELSE
7365: );
7366: IF l_return_status = FND_API.g_ret_sts_error THEN
7367: RAISE FND_API.g_exc_unexpected_error;
7368: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7369: RAISE FND_API.g_exc_unexpected_error;
7370: END IF;
7371: END IF; -- End of delete claim line
7372: ELSE
7373: IF OZF_DEBUG_HIGH_ON THEN
7381:
7382: END IF; --l_claim_line_count > 0
7383:
7384: END IF; --IF (l_claim.claim_class IN ('CLAIM', 'DEDUCTION')) THEN
7385: END IF; --IF ((l_claim.offer_id IS NOT NULL AND l_claim.offer_id <> FND_API.G_MISS_NUM) ...
7386:
7387: IF OZF_DEBUG_HIGH_ON THEN
7388: OZF_Utility_PVT.debug_message('Caim Line Does not Exists :');
7389: OZF_Utility_PVT.debug_message('Before Asso API l_claim.claim_id :' || l_claim.claim_id);
7405: END IF;
7406:
7407: Create_Claim_Association(
7408: p_api_version => 1.0
7409: ,p_init_msg_list => FND_API.g_false
7410: ,p_commit => FND_API.g_false
7411: ,p_validation_level => FND_API.g_valid_level_full
7412: ,p_claim_id => l_claim.claim_id
7413: ,p_offer_id => l_claim.offer_id
7406:
7407: Create_Claim_Association(
7408: p_api_version => 1.0
7409: ,p_init_msg_list => FND_API.g_false
7410: ,p_commit => FND_API.g_false
7411: ,p_validation_level => FND_API.g_valid_level_full
7412: ,p_claim_id => l_claim.claim_id
7413: ,p_offer_id => l_claim.offer_id
7414: ,p_claim_amt => l_claim.amount
7407: Create_Claim_Association(
7408: p_api_version => 1.0
7409: ,p_init_msg_list => FND_API.g_false
7410: ,p_commit => FND_API.g_false
7411: ,p_validation_level => FND_API.g_valid_level_full
7412: ,p_claim_id => l_claim.claim_id
7413: ,p_offer_id => l_claim.offer_id
7414: ,p_claim_amt => l_claim.amount
7415: ,p_claim_acc_amt => l_claim.acctd_amount
7418: ,x_return_status => l_return_status
7419: );
7420:
7421:
7422: IF l_return_status = FND_API.g_ret_sts_error THEN
7423: RAISE FND_API.g_exc_unexpected_error;
7424: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7425: RAISE FND_API.g_exc_unexpected_error;
7426: END IF;
7419: );
7420:
7421:
7422: IF l_return_status = FND_API.g_ret_sts_error THEN
7423: RAISE FND_API.g_exc_unexpected_error;
7424: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7425: RAISE FND_API.g_exc_unexpected_error;
7426: END IF;
7427: IF (l_claim.claim_class = 'DEDUCTION') THEN
7420:
7421:
7422: IF l_return_status = FND_API.g_ret_sts_error THEN
7423: RAISE FND_API.g_exc_unexpected_error;
7424: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7425: RAISE FND_API.g_exc_unexpected_error;
7426: END IF;
7427: IF (l_claim.claim_class = 'DEDUCTION') THEN
7428: OPEN csr_offer_code(l_claim.offer_id);
7421:
7422: IF l_return_status = FND_API.g_ret_sts_error THEN
7423: RAISE FND_API.g_exc_unexpected_error;
7424: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7425: RAISE FND_API.g_exc_unexpected_error;
7426: END IF;
7427: IF (l_claim.claim_class = 'DEDUCTION') THEN
7428: OPEN csr_offer_code(l_claim.offer_id);
7429: FETCH csr_offer_code INTO l_offer_code;
7456: OZF_Utility_PVT.debug_message('l_claim.claim_class =' || l_claim.claim_class);
7457: END IF;
7458:
7459: -- For Deduction the payment method should be credit memo only.
7460: IF (l_claim.offer_id IS NOT NULL AND l_claim.offer_id <> FND_API.G_MISS_NUM
7461: AND l_claim.claim_class = 'DEDUCTION') THEN
7462: l_claim.payment_method := 'CREDIT_MEMO';
7463: -- Fix for Bug 9706115
7464: l_claim.USER_STATUS_ID := to_number(
7470: l_prev_status_code := l_claim.status_code;
7471:
7472: END IF;
7473:
7474: IF (l_claim.offer_id IS NOT NULL AND l_claim.offer_id <> FND_API.G_MISS_NUM
7475: AND l_activity_id = l_claim.offer_id AND l_claim.claim_class = 'CLAIM') THEN
7476:
7477: IF ((l_claim.payment_method IS NULL OR l_claim.payment_method = FND_API.G_MISS_CHAR
7478: OR l_claim.payment_method ='') AND l_claim.claim_class = 'CLAIM') THEN
7473:
7474: IF (l_claim.offer_id IS NOT NULL AND l_claim.offer_id <> FND_API.G_MISS_NUM
7475: AND l_activity_id = l_claim.offer_id AND l_claim.claim_class = 'CLAIM') THEN
7476:
7477: IF ((l_claim.payment_method IS NULL OR l_claim.payment_method = FND_API.G_MISS_CHAR
7478: OR l_claim.payment_method ='') AND l_claim.claim_class = 'CLAIM') THEN
7479: -- Get the Payment Detail
7480: IF OZF_DEBUG_HIGH_ON THEN
7481: OZF_Utility_PVT.debug_message('Before Payment Detail');
7498: OZF_Utility_PVT.debug_message('l_vendor_site_id from get_payment_details:' || l_vendor_site_id);
7499: END IF;
7500:
7501:
7502: IF(l_return_status = FND_API.G_RET_STS_SUCCESS ) THEN
7503: l_claim.payment_method := l_payment_method;
7504: END IF;
7505:
7506: IF (l_claim.payment_method IN ('CHECK', 'EFT','WIRE','AP_DEBIT','AP_DEFAULT')) THEN
7513:
7514: END IF; -- End of Payment method check for claim
7515:
7516: /* Fix for Bug 16301542
7517: IF (l_claim.payment_method IS NOT NULL AND l_claim.payment_method <> FND_API.G_MISS_CHAR) THEN
7518:
7519: l_claim.USER_STATUS_ID := to_number(
7520: ozf_utility_pvt.GET_DEFAULT_USER_STATUS(
7521: P_STATUS_TYPE=> 'OZF_CLAIM_STATUS',
7537:
7538:
7539: OZF_CLAIM_SETTLEMENT_PVT.complete_settlement(
7540: p_api_version => 1.0
7541: ,p_init_msg_list => FND_API.G_FALSE
7542: ,p_commit => FND_API.G_FALSE
7543: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
7544: ,x_return_status => l_return_status
7545: ,x_msg_data => l_msg_data
7538:
7539: OZF_CLAIM_SETTLEMENT_PVT.complete_settlement(
7540: p_api_version => 1.0
7541: ,p_init_msg_list => FND_API.G_FALSE
7542: ,p_commit => FND_API.G_FALSE
7543: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
7544: ,x_return_status => l_return_status
7545: ,x_msg_data => l_msg_data
7546: ,x_msg_count => l_msg_count
7539: OZF_CLAIM_SETTLEMENT_PVT.complete_settlement(
7540: p_api_version => 1.0
7541: ,p_init_msg_list => FND_API.G_FALSE
7542: ,p_commit => FND_API.G_FALSE
7543: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
7544: ,x_return_status => l_return_status
7545: ,x_msg_data => l_msg_data
7546: ,x_msg_count => l_msg_count
7547: ,p_claim_rec => l_claim
7546: ,x_msg_count => l_msg_count
7547: ,p_claim_rec => l_claim
7548: ,x_claim_rec => l_complete_claim
7549: );
7550: IF l_return_status = FND_API.g_ret_sts_error THEN
7551: RAISE FND_API.g_exc_error;
7552: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7553: RAISE FND_API.g_exc_unexpected_error;
7554: END IF;
7547: ,p_claim_rec => l_claim
7548: ,x_claim_rec => l_complete_claim
7549: );
7550: IF l_return_status = FND_API.g_ret_sts_error THEN
7551: RAISE FND_API.g_exc_error;
7552: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7553: RAISE FND_API.g_exc_unexpected_error;
7554: END IF;
7555:
7548: ,x_claim_rec => l_complete_claim
7549: );
7550: IF l_return_status = FND_API.g_ret_sts_error THEN
7551: RAISE FND_API.g_exc_error;
7552: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7553: RAISE FND_API.g_exc_unexpected_error;
7554: END IF;
7555:
7556: l_claim := l_complete_claim;
7549: );
7550: IF l_return_status = FND_API.g_ret_sts_error THEN
7551: RAISE FND_API.g_exc_error;
7552: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7553: RAISE FND_API.g_exc_unexpected_error;
7554: END IF;
7555:
7556: l_claim := l_complete_claim;
7557: /*
7568: ,x_msg_count => l_msg_count
7569: ,x_msg_data => l_msg_data
7570: ,p_claim => l_claim
7571: );
7572: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
7573: RAISE FND_API.G_EXC_ERROR;
7574: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
7575: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7576: END IF;
7569: ,x_msg_data => l_msg_data
7570: ,p_claim => l_claim
7571: );
7572: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
7573: RAISE FND_API.G_EXC_ERROR;
7574: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
7575: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7576: END IF;
7577:
7570: ,p_claim => l_claim
7571: );
7572: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
7573: RAISE FND_API.G_EXC_ERROR;
7574: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
7575: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7576: END IF;
7577:
7578: -- R12: eTax Uptake Make call to validate claim tax
7571: );
7572: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
7573: RAISE FND_API.G_EXC_ERROR;
7574: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
7575: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7576: END IF;
7577:
7578: -- R12: eTax Uptake Make call to validate claim tax
7579: -- bugfix 4754589 added condition l_claim.tax_action <> FND_API.G_MISS_CHAR
7575: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7576: END IF;
7577:
7578: -- R12: eTax Uptake Make call to validate claim tax
7579: -- bugfix 4754589 added condition l_claim.tax_action <> FND_API.G_MISS_CHAR
7580: -- Moved the ASSOUI check for Validate_claim_For_tax method call also for Bug 12373880
7581: -- Added for Bug Fix 11793070
7582: IF(l_claim.created_from <> 'ASSOUI') THEN
7583: IF (l_claim.tax_action IS NOT NULL AND l_claim.tax_action <> FND_API.G_MISS_CHAR) THEN
7579: -- bugfix 4754589 added condition l_claim.tax_action <> FND_API.G_MISS_CHAR
7580: -- Moved the ASSOUI check for Validate_claim_For_tax method call also for Bug 12373880
7581: -- Added for Bug Fix 11793070
7582: IF(l_claim.created_from <> 'ASSOUI') THEN
7583: IF (l_claim.tax_action IS NOT NULL AND l_claim.tax_action <> FND_API.G_MISS_CHAR) THEN
7584: OZF_CLAIM_TAX_PVT. Validate_Claim_For_Tax(
7585: p_api_version => l_api_version
7586: ,p_init_msg_list => FND_API.G_FALSE
7587: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
7582: IF(l_claim.created_from <> 'ASSOUI') THEN
7583: IF (l_claim.tax_action IS NOT NULL AND l_claim.tax_action <> FND_API.G_MISS_CHAR) THEN
7584: OZF_CLAIM_TAX_PVT. Validate_Claim_For_Tax(
7585: p_api_version => l_api_version
7586: ,p_init_msg_list => FND_API.G_FALSE
7587: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
7588: ,x_return_status => l_return_status
7589: ,x_msg_data => l_msg_data
7590: ,x_msg_count => l_msg_count
7583: IF (l_claim.tax_action IS NOT NULL AND l_claim.tax_action <> FND_API.G_MISS_CHAR) THEN
7584: OZF_CLAIM_TAX_PVT. Validate_Claim_For_Tax(
7585: p_api_version => l_api_version
7586: ,p_init_msg_list => FND_API.G_FALSE
7587: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
7588: ,x_return_status => l_return_status
7589: ,x_msg_data => l_msg_data
7590: ,x_msg_count => l_msg_count
7591: ,p_claim_rec => l_claim) ;
7588: ,x_return_status => l_return_status
7589: ,x_msg_data => l_msg_data
7590: ,x_msg_count => l_msg_count
7591: ,p_claim_rec => l_claim) ;
7592: IF l_return_status = FND_API.g_ret_sts_error THEN
7593: RAISE FND_API.g_exc_error;
7594: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7595: RAISE FND_API.g_exc_unexpected_error;
7596: END IF;
7589: ,x_msg_data => l_msg_data
7590: ,x_msg_count => l_msg_count
7591: ,p_claim_rec => l_claim) ;
7592: IF l_return_status = FND_API.g_ret_sts_error THEN
7593: RAISE FND_API.g_exc_error;
7594: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7595: RAISE FND_API.g_exc_unexpected_error;
7596: END IF;
7597: END IF;
7590: ,x_msg_count => l_msg_count
7591: ,p_claim_rec => l_claim) ;
7592: IF l_return_status = FND_API.g_ret_sts_error THEN
7593: RAISE FND_API.g_exc_error;
7594: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7595: RAISE FND_API.g_exc_unexpected_error;
7596: END IF;
7597: END IF;
7598:
7591: ,p_claim_rec => l_claim) ;
7592: IF l_return_status = FND_API.g_ret_sts_error THEN
7593: RAISE FND_API.g_exc_error;
7594: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7595: RAISE FND_API.g_exc_unexpected_error;
7596: END IF;
7597: END IF;
7598:
7599:
7600: --Bug# 7319828 fixed by ateotia(+)
7601: -- IF l_convert_acctd_amount = 'T' THEN
7602: OZF_CLAIM_LINE_PVT.Update_Line_Fm_Claim(
7603: p_api_version => l_api_version
7604: ,p_init_msg_list => FND_API.G_FALSE
7605: ,p_commit => FND_API.G_FALSE
7606: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
7607: ,x_return_status => l_return_status
7608: ,x_msg_data => l_msg_data
7601: -- IF l_convert_acctd_amount = 'T' THEN
7602: OZF_CLAIM_LINE_PVT.Update_Line_Fm_Claim(
7603: p_api_version => l_api_version
7604: ,p_init_msg_list => FND_API.G_FALSE
7605: ,p_commit => FND_API.G_FALSE
7606: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
7607: ,x_return_status => l_return_status
7608: ,x_msg_data => l_msg_data
7609: ,x_msg_count => l_msg_count
7602: OZF_CLAIM_LINE_PVT.Update_Line_Fm_Claim(
7603: p_api_version => l_api_version
7604: ,p_init_msg_list => FND_API.G_FALSE
7605: ,p_commit => FND_API.G_FALSE
7606: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
7607: ,x_return_status => l_return_status
7608: ,x_msg_data => l_msg_data
7609: ,x_msg_count => l_msg_count
7610: ,p_new_claim_rec => l_claim
7608: ,x_msg_data => l_msg_data
7609: ,x_msg_count => l_msg_count
7610: ,p_new_claim_rec => l_claim
7611: );
7612: IF l_return_status = FND_API.g_ret_sts_error THEN
7613: RAISE FND_API.g_exc_error;
7614: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7615: RAISE FND_API.g_exc_unexpected_error;
7616: END IF;
7609: ,x_msg_count => l_msg_count
7610: ,p_new_claim_rec => l_claim
7611: );
7612: IF l_return_status = FND_API.g_ret_sts_error THEN
7613: RAISE FND_API.g_exc_error;
7614: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7615: RAISE FND_API.g_exc_unexpected_error;
7616: END IF;
7617: END IF;
7610: ,p_new_claim_rec => l_claim
7611: );
7612: IF l_return_status = FND_API.g_ret_sts_error THEN
7613: RAISE FND_API.g_exc_error;
7614: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7615: RAISE FND_API.g_exc_unexpected_error;
7616: END IF;
7617: END IF;
7618: -- END IF;
7611: );
7612: IF l_return_status = FND_API.g_ret_sts_error THEN
7613: RAISE FND_API.g_exc_error;
7614: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7615: RAISE FND_API.g_exc_unexpected_error;
7616: END IF;
7617: END IF;
7618: -- END IF;
7619: --Bug# 7319828 fixed by ateotia(+)
7631: -- mchang 12/05/2003: comment out the following message initialization code.
7632: -- message stack only allow to initialize in the begining
7633: -- of api, not at this point.
7634: /*
7635: IF FND_API.To_Boolean (p_init_msg_list) THEN
7636: FND_MSG_PUB.initialize;
7637: END IF;
7638: */
7639:
7640: IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
7641: FND_MESSAGE.Set_Name('AMS', 'OZF_CLAIM_API_NO_OPEN_STATUS');
7642: FND_MSG_PUB.ADD;
7643: END IF;
7644: RAISE FND_API.G_EXC_ERROR;
7645: END IF;
7646: -- End Bug: 2732290 -----------------------------------------------------------
7647:
7648: BEGIN
7805: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
7806: FND_MESSAGE.set_name('OZF', 'OZF_TABLE_HANDLER_ERROR');
7807: FND_MSG_PUB.add;
7808: END IF;
7809: RAISE FND_API.g_exc_error;
7810: END;
7811: l_rec_num := 1;
7812:
7813: IF l_user_sel_status_code_id IS NOT NULL THEN
7820: IF l_old_status_code <> l_claim.status_code THEN
7821:
7822: OZF_CLAIM_SETTLEMENT_PVT.settle_claim(
7823: p_api_version => 1.0
7824: ,p_init_msg_list => FND_API.G_FALSE
7825: ,p_commit => FND_API.G_FALSE
7826: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
7827: ,x_return_status => l_return_status
7828: ,x_msg_data => l_msg_data
7821:
7822: OZF_CLAIM_SETTLEMENT_PVT.settle_claim(
7823: p_api_version => 1.0
7824: ,p_init_msg_list => FND_API.G_FALSE
7825: ,p_commit => FND_API.G_FALSE
7826: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
7827: ,x_return_status => l_return_status
7828: ,x_msg_data => l_msg_data
7829: ,x_msg_count => l_msg_count
7822: OZF_CLAIM_SETTLEMENT_PVT.settle_claim(
7823: p_api_version => 1.0
7824: ,p_init_msg_list => FND_API.G_FALSE
7825: ,p_commit => FND_API.G_FALSE
7826: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
7827: ,x_return_status => l_return_status
7828: ,x_msg_data => l_msg_data
7829: ,x_msg_count => l_msg_count
7830: ,p_claim_id => l_claim.claim_id
7830: ,p_claim_id => l_claim.claim_id
7831: ,p_curr_status => l_prev_status_code
7832: ,p_prev_status => l_old_status_code
7833: );
7834: IF l_return_status = FND_API.g_ret_sts_error THEN
7835: RAISE FND_API.g_exc_error;
7836: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7837: RAISE FND_API.g_exc_unexpected_error;
7838: END IF;
7831: ,p_curr_status => l_prev_status_code
7832: ,p_prev_status => l_old_status_code
7833: );
7834: IF l_return_status = FND_API.g_ret_sts_error THEN
7835: RAISE FND_API.g_exc_error;
7836: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7837: RAISE FND_API.g_exc_unexpected_error;
7838: END IF;
7839: END IF;
7832: ,p_prev_status => l_old_status_code
7833: );
7834: IF l_return_status = FND_API.g_ret_sts_error THEN
7835: RAISE FND_API.g_exc_error;
7836: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7837: RAISE FND_API.g_exc_unexpected_error;
7838: END IF;
7839: END IF;
7840:
7833: );
7834: IF l_return_status = FND_API.g_ret_sts_error THEN
7835: RAISE FND_API.g_exc_error;
7836: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7837: RAISE FND_API.g_exc_unexpected_error;
7838: END IF;
7839: END IF;
7840:
7841: -- start bug# 4363588
7855:
7856: --Call the create history from here only after the claim update goes successfully(uday)
7857: Create_Claim_History (
7858: p_api_version => l_api_version
7859: ,p_init_msg_list => FND_API.G_FALSE
7860: ,p_commit => FND_API.G_FALSE
7861: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
7862: ,x_return_status => l_return_status
7863: ,x_msg_data => l_msg_data
7856: --Call the create history from here only after the claim update goes successfully(uday)
7857: Create_Claim_History (
7858: p_api_version => l_api_version
7859: ,p_init_msg_list => FND_API.G_FALSE
7860: ,p_commit => FND_API.G_FALSE
7861: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
7862: ,x_return_status => l_return_status
7863: ,x_msg_data => l_msg_data
7864: ,x_msg_count => l_msg_count
7857: Create_Claim_History (
7858: p_api_version => l_api_version
7859: ,p_init_msg_list => FND_API.G_FALSE
7860: ,p_commit => FND_API.G_FALSE
7861: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
7862: ,x_return_status => l_return_status
7863: ,x_msg_data => l_msg_data
7864: ,x_msg_count => l_msg_count
7865: ,p_claim => l_claim
7866: ,p_event => p_event
7867: ,x_need_to_create => l_need_to_create
7868: ,x_claim_history_id => l_claim_history_id
7869: );
7870: IF l_return_status = FND_API.g_ret_sts_error THEN
7871: RAISE FND_API.g_exc_error;
7872: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7873: RAISE FND_API.g_exc_unexpected_error;
7874: END IF;
7867: ,x_need_to_create => l_need_to_create
7868: ,x_claim_history_id => l_claim_history_id
7869: );
7870: IF l_return_status = FND_API.g_ret_sts_error THEN
7871: RAISE FND_API.g_exc_error;
7872: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7873: RAISE FND_API.g_exc_unexpected_error;
7874: END IF;
7875:
7868: ,x_claim_history_id => l_claim_history_id
7869: );
7870: IF l_return_status = FND_API.g_ret_sts_error THEN
7871: RAISE FND_API.g_exc_error;
7872: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7873: RAISE FND_API.g_exc_unexpected_error;
7874: END IF;
7875:
7876:
7869: );
7870: IF l_return_status = FND_API.g_ret_sts_error THEN
7871: RAISE FND_API.g_exc_error;
7872: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7873: RAISE FND_API.g_exc_unexpected_error;
7874: END IF;
7875:
7876:
7877: -- Create Tasks for the claim if the reason code has been changed and a history record is created.
7893: JTF_TASKS_PUB.delete_task(
7894: p_api_version => l_api_version
7895: ,p_object_version_number => l_uncompleted_tasks_tbl(i).object_version_number
7896: ,p_task_id => l_uncompleted_tasks_tbl(i).task_id
7897: ,p_delete_future_recurrences => FND_API.G_FALSE
7898: ,x_return_status => l_return_status
7899: ,x_msg_count => l_msg_count
7900: ,x_msg_data => l_msg_data
7901: );
7898: ,x_return_status => l_return_status
7899: ,x_msg_count => l_msg_count
7900: ,x_msg_data => l_msg_data
7901: );
7902: IF l_return_status = FND_API.g_ret_sts_error THEN
7903: RAISE FND_API.g_exc_error;
7904: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7905: RAISE FND_API.g_exc_unexpected_error;
7906: END IF;
7899: ,x_msg_count => l_msg_count
7900: ,x_msg_data => l_msg_data
7901: );
7902: IF l_return_status = FND_API.g_ret_sts_error THEN
7903: RAISE FND_API.g_exc_error;
7904: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7905: RAISE FND_API.g_exc_unexpected_error;
7906: END IF;
7907: END LOOP;
7900: ,x_msg_data => l_msg_data
7901: );
7902: IF l_return_status = FND_API.g_ret_sts_error THEN
7903: RAISE FND_API.g_exc_error;
7904: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7905: RAISE FND_API.g_exc_unexpected_error;
7906: END IF;
7907: END LOOP;
7908:
7901: );
7902: IF l_return_status = FND_API.g_ret_sts_error THEN
7903: RAISE FND_API.g_exc_error;
7904: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7905: RAISE FND_API.g_exc_unexpected_error;
7906: END IF;
7907: END LOOP;
7908:
7909: -- point the completed tasks to claim_history. The completed_flag is set to 'Y'
7921: -- change the source_object_id and source_object_type_code for the tasks.
7922: JTF_TASKS_PUB.update_task(
7923: p_api_version => l_api_version
7924: ,p_object_version_number => l_completed_tasks_tbl(i).object_version_number
7925: ,p_init_msg_list => FND_API.g_false
7926: ,p_commit => FND_API.g_false
7927: ,x_return_status => l_return_status
7928: ,x_msg_count => l_msg_count
7929: ,x_msg_data => l_msg_data
7922: JTF_TASKS_PUB.update_task(
7923: p_api_version => l_api_version
7924: ,p_object_version_number => l_completed_tasks_tbl(i).object_version_number
7925: ,p_init_msg_list => FND_API.g_false
7926: ,p_commit => FND_API.g_false
7927: ,x_return_status => l_return_status
7928: ,x_msg_count => l_msg_count
7929: ,x_msg_data => l_msg_data
7930: ,p_task_id => l_completed_tasks_tbl(i).task_id
7931: ,p_source_object_type_code =>G_CLAIM_HISTORY_TYPE
7932: ,p_source_object_id => l_claim_history_id
7933: );
7934:
7935: IF l_return_status = FND_API.g_ret_sts_error THEN
7936: RAISE FND_API.g_exc_error;
7937: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7938: RAISE FND_API.g_exc_unexpected_error;
7939: END IF;
7932: ,p_source_object_id => l_claim_history_id
7933: );
7934:
7935: IF l_return_status = FND_API.g_ret_sts_error THEN
7936: RAISE FND_API.g_exc_error;
7937: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7938: RAISE FND_API.g_exc_unexpected_error;
7939: END IF;
7940: END LOOP;
7933: );
7934:
7935: IF l_return_status = FND_API.g_ret_sts_error THEN
7936: RAISE FND_API.g_exc_error;
7937: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7938: RAISE FND_API.g_exc_unexpected_error;
7939: END IF;
7940: END LOOP;
7941: END IF;
7934:
7935: IF l_return_status = FND_API.g_ret_sts_error THEN
7936: RAISE FND_API.g_exc_error;
7937: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7938: RAISE FND_API.g_exc_unexpected_error;
7939: END IF;
7940: END LOOP;
7941: END IF;
7942:
7949: and source_object_type_code = G_OBJECT_TYPE;
7950: */
7951: -- Create Tasks for the claim created if there is any
7952: IF (l_claim.task_template_group_id is not null and
7953: l_claim.task_template_group_id <> FND_API.G_MISS_NUM) THEN
7954: generate_tasks(
7955: p_task_template_group_id => l_claim.task_template_group_id
7956: ,p_owner_id => l_claim.owner_id
7957: ,p_claim_number => l_claim.claim_number
7957: ,p_claim_number => l_claim.claim_number
7958: ,p_claim_id => l_claim.claim_id
7959: ,x_return_status => l_return_status
7960: );
7961: IF l_return_status = FND_API.g_ret_sts_error THEN
7962: RAISE FND_API.g_exc_error;
7963: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7964: RAISE FND_API.g_exc_unexpected_error;
7965: END IF;
7958: ,p_claim_id => l_claim.claim_id
7959: ,x_return_status => l_return_status
7960: );
7961: IF l_return_status = FND_API.g_ret_sts_error THEN
7962: RAISE FND_API.g_exc_error;
7963: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7964: RAISE FND_API.g_exc_unexpected_error;
7965: END IF;
7966: END IF;
7959: ,x_return_status => l_return_status
7960: );
7961: IF l_return_status = FND_API.g_ret_sts_error THEN
7962: RAISE FND_API.g_exc_error;
7963: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7964: RAISE FND_API.g_exc_unexpected_error;
7965: END IF;
7966: END IF;
7967: /*
7960: );
7961: IF l_return_status = FND_API.g_ret_sts_error THEN
7962: RAISE FND_API.g_exc_error;
7963: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
7964: RAISE FND_API.g_exc_unexpected_error;
7965: END IF;
7966: END IF;
7967: /*
7968: -- Temp solution for update the claim history
7993: l_claim_history_rec.task_source_object_type_code := G_CLAIM_HISTORY_TYPE;
7994:
7995: OZF_claims_history_PVT.Update_claims_history(
7996: P_Api_Version_Number => 1.0,
7997: P_Init_Msg_List => FND_API.G_FALSE,
7998: P_Commit => FND_API.G_FALSE,
7999: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
8000: x_return_status => l_return_status,
8001: x_msg_count => l_msg_count,
7994:
7995: OZF_claims_history_PVT.Update_claims_history(
7996: P_Api_Version_Number => 1.0,
7997: P_Init_Msg_List => FND_API.G_FALSE,
7998: P_Commit => FND_API.G_FALSE,
7999: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
8000: x_return_status => l_return_status,
8001: x_msg_count => l_msg_count,
8002: x_msg_data => l_msg_data,
7995: OZF_claims_history_PVT.Update_claims_history(
7996: P_Api_Version_Number => 1.0,
7997: P_Init_Msg_List => FND_API.G_FALSE,
7998: P_Commit => FND_API.G_FALSE,
7999: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
8000: x_return_status => l_return_status,
8001: x_msg_count => l_msg_count,
8002: x_msg_data => l_msg_data,
8003: P_CLAIMS_HISTORY_Rec => l_claim_history_rec,
8003: P_CLAIMS_HISTORY_Rec => l_claim_history_rec,
8004: X_Object_Version_Number => l_hist_obj_ver_num
8005: );
8006:
8007: IF l_return_status = FND_API.g_ret_sts_error THEN
8008: RAISE FND_API.g_exc_error;
8009: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
8010: RAISE FND_API.g_exc_unexpected_error;
8011: END IF;
8004: X_Object_Version_Number => l_hist_obj_ver_num
8005: );
8006:
8007: IF l_return_status = FND_API.g_ret_sts_error THEN
8008: RAISE FND_API.g_exc_error;
8009: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
8010: RAISE FND_API.g_exc_unexpected_error;
8011: END IF;
8012: END LOOP;
8005: );
8006:
8007: IF l_return_status = FND_API.g_ret_sts_error THEN
8008: RAISE FND_API.g_exc_error;
8009: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
8010: RAISE FND_API.g_exc_unexpected_error;
8011: END IF;
8012: END LOOP;
8013: END IF;
8006:
8007: IF l_return_status = FND_API.g_ret_sts_error THEN
8008: RAISE FND_API.g_exc_error;
8009: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
8010: RAISE FND_API.g_exc_unexpected_error;
8011: END IF;
8012: END LOOP;
8013: END IF;
8014: END IF;
8034: -- [END OF BUG 3835800 Fiing]
8035: l_access_list(i).act_access_to_object_id := l_claim.claim_id;
8036: ams_access_pvt.create_access(
8037: p_api_version => l_api_version
8038: ,p_init_msg_list => fnd_api.g_false
8039: ,p_validation_level => p_validation_level
8040: ,x_return_status => l_return_status
8041: ,x_msg_count => x_msg_count
8042: ,x_msg_data => x_msg_data
8039: ,p_validation_level => p_validation_level
8040: ,x_return_status => l_return_status
8041: ,x_msg_count => x_msg_count
8042: ,x_msg_data => x_msg_data
8043: ,p_commit => fnd_api.g_false
8044: ,p_access_rec => l_access_list(i)
8045: ,x_access_id => l_access_id);
8046: IF l_return_status = fnd_api.g_ret_sts_error THEN
8047: RAISE fnd_api.g_exc_error;
8042: ,x_msg_data => x_msg_data
8043: ,p_commit => fnd_api.g_false
8044: ,p_access_rec => l_access_list(i)
8045: ,x_access_id => l_access_id);
8046: IF l_return_status = fnd_api.g_ret_sts_error THEN
8047: RAISE fnd_api.g_exc_error;
8048: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
8049: RAISE fnd_api.g_exc_unexpected_error;
8050: END IF;
8043: ,p_commit => fnd_api.g_false
8044: ,p_access_rec => l_access_list(i)
8045: ,x_access_id => l_access_id);
8046: IF l_return_status = fnd_api.g_ret_sts_error THEN
8047: RAISE fnd_api.g_exc_error;
8048: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
8049: RAISE fnd_api.g_exc_unexpected_error;
8050: END IF;
8051: END IF; -- end of l_dup_resource checking BUG 3835800 Fiing
8044: ,p_access_rec => l_access_list(i)
8045: ,x_access_id => l_access_id);
8046: IF l_return_status = fnd_api.g_ret_sts_error THEN
8047: RAISE fnd_api.g_exc_error;
8048: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
8049: RAISE fnd_api.g_exc_unexpected_error;
8050: END IF;
8051: END IF; -- end of l_dup_resource checking BUG 3835800 Fiing
8052: END LOOP;
8045: ,x_access_id => l_access_id);
8046: IF l_return_status = fnd_api.g_ret_sts_error THEN
8047: RAISE fnd_api.g_exc_error;
8048: ELSIF l_return_status = fnd_api.g_ret_sts_unexp_error THEN
8049: RAISE fnd_api.g_exc_unexpected_error;
8050: END IF;
8051: END IF; -- end of l_dup_resource checking BUG 3835800 Fiing
8052: END LOOP;
8053: END IF;
8058: -------------------------------------------------
8059: IF l_old_status_code <> l_claim.status_code THEN
8060: OZF_CLAIM_SETTLEMENT_PVT.Raise_Business_Event(
8061: p_api_version => l_api_version
8062: ,p_init_msg_list => FND_API.g_false
8063: ,p_commit => FND_API.g_false
8064: ,p_validation_level => FND_API.g_valid_level_full
8065: ,x_return_status => l_return_status
8066: ,x_msg_data => x_msg_data
8059: IF l_old_status_code <> l_claim.status_code THEN
8060: OZF_CLAIM_SETTLEMENT_PVT.Raise_Business_Event(
8061: p_api_version => l_api_version
8062: ,p_init_msg_list => FND_API.g_false
8063: ,p_commit => FND_API.g_false
8064: ,p_validation_level => FND_API.g_valid_level_full
8065: ,x_return_status => l_return_status
8066: ,x_msg_data => x_msg_data
8067: ,x_msg_count => x_msg_count
8060: OZF_CLAIM_SETTLEMENT_PVT.Raise_Business_Event(
8061: p_api_version => l_api_version
8062: ,p_init_msg_list => FND_API.g_false
8063: ,p_commit => FND_API.g_false
8064: ,p_validation_level => FND_API.g_valid_level_full
8065: ,x_return_status => l_return_status
8066: ,x_msg_data => x_msg_data
8067: ,x_msg_count => x_msg_count
8068:
8070: ,p_old_status => l_old_status_code
8071: ,p_new_status => l_claim.status_code
8072: ,p_event_name => 'oracle.apps.ozf.claim.updateStatus'
8073: );
8074: IF l_return_status = FND_API.g_ret_sts_error THEN
8075: RAISE FND_API.g_exc_error;
8076: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
8077: RAISE FND_API.g_exc_unexpected_error;
8078: END IF;
8071: ,p_new_status => l_claim.status_code
8072: ,p_event_name => 'oracle.apps.ozf.claim.updateStatus'
8073: );
8074: IF l_return_status = FND_API.g_ret_sts_error THEN
8075: RAISE FND_API.g_exc_error;
8076: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
8077: RAISE FND_API.g_exc_unexpected_error;
8078: END IF;
8079: END IF;
8072: ,p_event_name => 'oracle.apps.ozf.claim.updateStatus'
8073: );
8074: IF l_return_status = FND_API.g_ret_sts_error THEN
8075: RAISE FND_API.g_exc_error;
8076: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
8077: RAISE FND_API.g_exc_unexpected_error;
8078: END IF;
8079: END IF;
8080:
8073: );
8074: IF l_return_status = FND_API.g_ret_sts_error THEN
8075: RAISE FND_API.g_exc_error;
8076: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
8077: RAISE FND_API.g_exc_unexpected_error;
8078: END IF;
8079: END IF;
8080:
8081: --//12985686 TPM Integration ER
8087: p_claim_rec => l_claim_rec1,
8088: x_complete_rec => l_claim_rec2,
8089: x_return_status => l_return_status
8090: );
8091: IF l_return_status = FND_API.g_ret_sts_error THEN
8092: RAISE FND_API.g_exc_error;
8093: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
8094: RAISE FND_API.g_exc_unexpected_error;
8095: END IF;
8088: x_complete_rec => l_claim_rec2,
8089: x_return_status => l_return_status
8090: );
8091: IF l_return_status = FND_API.g_ret_sts_error THEN
8092: RAISE FND_API.g_exc_error;
8093: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
8094: RAISE FND_API.g_exc_unexpected_error;
8095: END IF;
8096:
8089: x_return_status => l_return_status
8090: );
8091: IF l_return_status = FND_API.g_ret_sts_error THEN
8092: RAISE FND_API.g_exc_error;
8093: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
8094: RAISE FND_API.g_exc_unexpected_error;
8095: END IF;
8096:
8097: IF OZF_DEBUG_HIGH_ON THEN
8090: );
8091: IF l_return_status = FND_API.g_ret_sts_error THEN
8092: RAISE FND_API.g_exc_error;
8093: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
8094: RAISE FND_API.g_exc_unexpected_error;
8095: END IF;
8096:
8097: IF OZF_DEBUG_HIGH_ON THEN
8098: OZF_UTILITY_PVT.debug_message('G_TPM_PROCESS_ENABLED is YES');
8283: -- pass the new version number
8284: x_object_version_number := l_object_version_number;
8285:
8286: --Standard check of commit
8287: IF FND_API.To_Boolean ( p_commit ) THEN
8288: COMMIT WORK;
8289: END IF;
8290: -- Debug Message
8291: IF OZF_DEBUG_LOW_ON THEN
8294: FND_MSG_PUB.Add;
8295: END IF;
8296: --Standard call to get message count and if count=1, get the message
8297: FND_MSG_PUB.Count_And_Get (
8298: p_encoded => FND_API.G_FALSE,
8299: p_count => x_msg_count,
8300: p_data => x_msg_data
8301: );
8302: EXCEPTION
8299: p_count => x_msg_count,
8300: p_data => x_msg_data
8301: );
8302: EXCEPTION
8303: WHEN FND_API.G_EXC_ERROR THEN
8304: -- IF ( NOT G_UPDATE_CALLED ) THEN
8305: ROLLBACK TO Update_Claim_PVT;
8306: -- END IF;
8307: x_return_status := FND_API.G_RET_STS_ERROR;
8303: WHEN FND_API.G_EXC_ERROR THEN
8304: -- IF ( NOT G_UPDATE_CALLED ) THEN
8305: ROLLBACK TO Update_Claim_PVT;
8306: -- END IF;
8307: x_return_status := FND_API.G_RET_STS_ERROR;
8308: -- Standard call to get message count and if count=1, get the message
8309: FND_MSG_PUB.Count_And_Get (
8310: p_encoded => FND_API.G_FALSE,
8311: p_count => x_msg_count,
8306: -- END IF;
8307: x_return_status := FND_API.G_RET_STS_ERROR;
8308: -- Standard call to get message count and if count=1, get the message
8309: FND_MSG_PUB.Count_And_Get (
8310: p_encoded => FND_API.G_FALSE,
8311: p_count => x_msg_count,
8312: p_data => x_msg_data
8313: );
8314: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
8310: p_encoded => FND_API.G_FALSE,
8311: p_count => x_msg_count,
8312: p_data => x_msg_data
8313: );
8314: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
8315: -- IF ( NOT G_UPDATE_CALLED ) THEN
8316: ROLLBACK TO Update_Claim_PVT;
8317: -- END IF;
8318: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8314: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
8315: -- IF ( NOT G_UPDATE_CALLED ) THEN
8316: ROLLBACK TO Update_Claim_PVT;
8317: -- END IF;
8318: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8319: -- Standard call to get message count and if count=1, get the message
8320: FND_MSG_PUB.Count_And_Get (
8321: p_encoded => FND_API.G_FALSE,
8322: p_count => x_msg_count,
8317: -- END IF;
8318: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8319: -- Standard call to get message count and if count=1, get the message
8320: FND_MSG_PUB.Count_And_Get (
8321: p_encoded => FND_API.G_FALSE,
8322: p_count => x_msg_count,
8323: p_data => x_msg_data
8324: );
8325: WHEN OTHERS THEN
8325: WHEN OTHERS THEN
8326: -- IF ( NOT G_UPDATE_CALLED ) THEN
8327: ROLLBACK TO Update_Claim_PVT;
8328: -- END IF;
8329: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8330: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
8331: THEN
8332: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
8333: END IF;
8332: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
8333: END IF;
8334: -- Standard call to get message count and if count=1, get the message
8335: FND_MSG_PUB.Count_And_Get (
8336: p_encoded => FND_API.G_FALSE,
8337: p_count => x_msg_count,
8338: p_data => x_msg_data
8339: );
8340: --
8354: --
8355: ----------------------------------------------------------------------
8356: PROCEDURE Validate_Claim (
8357: p_api_version IN NUMBER
8358: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
8359: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
8360: ,x_return_status OUT NOCOPY VARCHAR2
8361: ,x_msg_count OUT NOCOPY NUMBER
8362: ,x_msg_data OUT NOCOPY VARCHAR2
8355: ----------------------------------------------------------------------
8356: PROCEDURE Validate_Claim (
8357: p_api_version IN NUMBER
8358: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
8359: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
8360: ,x_return_status OUT NOCOPY VARCHAR2
8361: ,x_msg_count OUT NOCOPY NUMBER
8362: ,x_msg_data OUT NOCOPY VARCHAR2
8363: ,p_claim IN claim_rec_type
8487: BEGIN
8488: -- Standard begin of API savepoint
8489: SAVEPOINT Validate_Claim_PVT;
8490: -- Standard call to check for call compatibility.
8491: IF NOT FND_API.Compatible_API_Call (
8492: l_api_version,
8493: p_api_version,
8494: l_api_name,
8495: G_PKG_NAME)
8493: p_api_version,
8494: l_api_name,
8495: G_PKG_NAME)
8496: THEN
8497: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
8498: END IF;
8499:
8500: -- Debug Message
8501: IF OZF_DEBUG_LOW_ON THEN
8504: FND_MSG_PUB.Add;
8505: END IF;
8506:
8507: --Initialize message list if p_init_msg_list is TRUE.
8508: IF FND_API.To_Boolean (p_init_msg_list) THEN
8509: FND_MSG_PUB.initialize;
8510: END IF;
8511:
8512: -- Initialize API return status to sucess
8509: FND_MSG_PUB.initialize;
8510: END IF;
8511:
8512: -- Initialize API return status to sucess
8513: x_return_status := FND_API.G_RET_STS_SUCCESS;
8514:
8515: IF p_validation_level >= JTF_PLSQL_API.g_valid_level_item THEN
8516: Check_Claim_Items(
8517: p_claim_rec => l_claim,
8518: p_validation_mode => JTF_PLSQL_API.g_update,
8519: x_return_status => l_return_status
8520: );
8521:
8522: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
8523: RAISE FND_API.G_EXC_ERROR;
8524: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
8525: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
8526: END IF;
8519: x_return_status => l_return_status
8520: );
8521:
8522: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
8523: RAISE FND_API.G_EXC_ERROR;
8524: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
8525: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
8526: END IF;
8527: END IF;
8520: );
8521:
8522: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
8523: RAISE FND_API.G_EXC_ERROR;
8524: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
8525: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
8526: END IF;
8527: END IF;
8528:
8521:
8522: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
8523: RAISE FND_API.G_EXC_ERROR;
8524: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
8525: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
8526: END IF;
8527: END IF;
8528:
8529: -- Raise an error
8536: IF OZF_DEBUG_HIGH_ON THEN
8537: ozf_utility_PVT.debug_message('claim date: ' || l_claim.claim_date);
8538: ozf_utility_PVT.debug_message('due date: ' || l_claim.DUE_DATE);
8539: END IF;
8540: RAISE FND_API.G_EXC_ERROR;
8541: END IF;
8542:
8543: -- Raise an error
8544: -- if the current status code is not duplicate but the duplicate_claim_id is not null
8543: -- Raise an error
8544: -- if the current status code is not duplicate but the duplicate_claim_id is not null
8545: IF ((l_claim.status_code <> G_DUPLICATE_STATUS) AND
8546: (l_claim.duplicate_claim_id is not null) AND
8547: (l_claim.duplicate_claim_id <> FND_API.G_MISS_NUM)) THEN
8548: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
8549: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_CANT_DUP');
8550: FND_MSG_PUB.Add;
8551: END IF;
8548: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
8549: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_CANT_DUP');
8550: FND_MSG_PUB.Add;
8551: END IF;
8552: RAISE FND_API.G_EXC_ERROR;
8553: END IF;
8554:
8555: -- Raise an error
8556: -- if billto_site and shipto_site do not belong to the customer
8554:
8555: -- Raise an error
8556: -- if billto_site and shipto_site do not belong to the customer
8557: IF (l_claim.cust_account_id is not null AND
8558: l_claim.cust_account_id <> FND_API.G_MISS_NUM) THEN
8559:
8560: -- check cust_billto_acct_site_id
8561: IF (l_claim.cust_billto_acct_site_id is not null AND
8562: l_claim.cust_account_id <> FND_API.G_MISS_NUM) THEN
8558: l_claim.cust_account_id <> FND_API.G_MISS_NUM) THEN
8559:
8560: -- check cust_billto_acct_site_id
8561: IF (l_claim.cust_billto_acct_site_id is not null AND
8562: l_claim.cust_account_id <> FND_API.G_MISS_NUM) THEN
8563:
8564: OPEN cust_site_csr(l_claim.cust_account_id, 'BILL_TO', l_claim.cust_billto_acct_site_id);
8565: FETCH cust_site_csr INTO l_count;
8566: CLOSE cust_site_csr;
8569: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
8570: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_BILL_TO_ST_WRNG');
8571: FND_MSG_PUB.Add;
8572: END IF;
8573: RAISE FND_API.G_EXC_ERROR;
8574: END IF;
8575: END IF;
8576:
8577: -- 4334023: check for unrelated shipto if profile does not allow unrelated
8586: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
8587: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_UNRELATED_SHIPTO');
8588: FND_MSG_PUB.Add;
8589: END IF;
8590: RAISE FND_API.G_EXC_ERROR;
8591: END IF;
8592: END IF;
8593:
8594: -- Bug 5498540 -- Removed validation for SHIP_TO Site address
8593:
8594: -- Bug 5498540 -- Removed validation for SHIP_TO Site address
8595: -- check cust_shipto_acct_site_id
8596: /*IF (l_claim.cust_shipto_acct_site_id is not null AND
8597: l_claim.cust_shipto_acct_site_id <> FND_API.G_MISS_NUM) THEN
8598:
8599: l_count := 0;
8600: OPEN cust_site_csr(l_claim.ship_to_cust_account_id, 'SHIP_TO', l_claim.cust_shipto_acct_site_id);
8601: FETCH cust_site_csr INTO l_count;
8605: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
8606: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_SHIP_TO_ST_WRNG');
8607: FND_MSG_PUB.Add;
8608: END IF;
8609: RAISE FND_API.G_EXC_ERROR;
8610: END IF;
8611: END IF; */
8612:
8613: /* phase out this check since
8613: /* phase out this check since
8614:
8615: -- check contact_id
8616: IF (l_claim.contact_id is not null AND
8617: l_claim.contact_id <> FND_API.G_MISS_NUM) THEN
8618:
8619: l_count := 0;
8620: OPEN party_csr(l_claim.cust_account_id, 'CONTACT_OF', l_claim.contact_id);
8621: FETCH party_csr INTO l_count;
8625: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
8626: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_CONTACT_WRNG');
8627: FND_MSG_PUB.Add;
8628: END IF;
8629: RAISE FND_API.G_EXC_ERROR;
8630: END IF;
8631: END IF;
8632: -- end of phase out this check */
8633:
8632: -- end of phase out this check */
8633:
8634: -- check broker_id
8635: IF (l_claim.broker_id is not null AND
8636: l_claim.broker_id <> FND_API.G_MISS_NUM) THEN
8637:
8638: l_count := 0;
8639: OPEN party_csr(l_claim.cust_account_id, 'BROKER_OF', l_claim.broker_id);
8640: FETCH party_csr INTO l_count;
8644: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
8645: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_BROKER_WRNG');
8646: FND_MSG_PUB.Add;
8647: END IF;
8648: RAISE FND_API.G_EXC_ERROR;
8649: END IF;
8650: END IF;
8651:
8652: -- check sales_rep
8653: -- 04-MAR-2002 mchang updated: comment out the following section to avoid the sales_rep_id checking
8654: -- since the sales_rep_id might not be valied over time when claim is updated.
8655: /*
8656: IF (l_claim.sales_rep_id is not NULL AND
8657: l_claim.sales_rep_id <> FND_API.G_MISS_NUM) THEN
8658: OPEN sales_rep_num_csr(l_claim.sales_rep_id);
8659: FETCH sales_rep_num_csr INTO l_sales_rep_num;
8660: CLOSE sales_rep_num_csr;
8661:
8663: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
8664: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_SALES_REP_MISSING');
8665: FND_MSG_PUB.add;
8666: END IF;
8667: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
8668: END IF;
8669: END IF;
8670: */
8671:
8673: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
8674: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_CUST_ID_MISSING');
8675: FND_MSG_PUB.Add;
8676: END IF;
8677: RAISE FND_API.G_EXC_ERROR;
8678: END IF;
8679:
8680:
8681: -- 04-MAR-2002 mchang updated: comment out the following section to avoid the status code checking
8696: FND_MESSAGE.Set_Name('OZF','OZF_API_DEBUG_MESSAGE');
8697: FND_MESSAGE.Set_Token('TEXT','code: '||l_claim.status_code||' id:'||l_claim.user_status_id);
8698: FND_MSG_PUB.Add;
8699: END IF;
8700: RAISE FND_API.G_EXC_ERROR;
8701: END IF;
8702: */
8703:
8704: -- Check to see whether the reason_code_id and task_template_id matches.
8704: -- Check to see whether the reason_code_id and task_template_id matches.
8705: -- 04-MAR-2002 mchang updated: comment out the following section to avoid the reason_code_id and reason_code_id checking
8706: -- since the reason_code_id and reason_code_id might not be valied over time when the claim is updated.
8707: /*
8708: IF l_claim.reason_code_id is not null AND l_claim.reason_code_id <> FND_API.G_MISS_NUM AND
8709: l_claim.task_template_group_id is not null AND l_claim.task_template_group_id <> FND_API.G_MISS_NUM THEN
8710: l_count := 0;
8711:
8712: OPEN action_count_csr(l_claim.reason_code_id, l_claim.task_template_group_id);
8705: -- 04-MAR-2002 mchang updated: comment out the following section to avoid the reason_code_id and reason_code_id checking
8706: -- since the reason_code_id and reason_code_id might not be valied over time when the claim is updated.
8707: /*
8708: IF l_claim.reason_code_id is not null AND l_claim.reason_code_id <> FND_API.G_MISS_NUM AND
8709: l_claim.task_template_group_id is not null AND l_claim.task_template_group_id <> FND_API.G_MISS_NUM THEN
8710: l_count := 0;
8711:
8712: OPEN action_count_csr(l_claim.reason_code_id, l_claim.task_template_group_id);
8713: FETCH action_count_csr INTO l_count;
8717: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
8718: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_ACTION_NOT_MAT');
8719: FND_MSG_PUB.Add;
8720: END IF;
8721: RAISE FND_API.G_EXC_ERROR;
8722: END IF;
8723: END IF;
8724: */
8725:
8724: */
8725:
8726: -- raise an error if owner_id is not found
8727: IF (l_claim.owner_id is null OR
8728: l_claim.owner_id = FND_API.G_MISS_NUM) THEN
8729: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
8730: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_OWNER_NOT_FOUND');
8731: FND_MSG_PUB.Add;
8732: END IF;
8729: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
8730: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_OWNER_NOT_FOUND');
8731: FND_MSG_PUB.Add;
8732: END IF;
8733: RAISE FND_API.G_EXC_ERROR;
8734: END IF;
8735:
8736: -- raise an error if status_code is open and amount_remaining is 0
8737: IF (l_claim.status_code = G_OPEN_STATUS AND
8739: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
8740: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_AMT_ZERO_WOPEN');
8741: FND_MSG_PUB.Add;
8742: END IF;
8743: RAISE FND_API.G_EXC_ERROR;
8744: END IF;
8745:
8746: -- raise an error if amount is <0 and claim_class = Claim or DEDUCTION
8747: -- raise an error if amount is >0 and claim_class = OVERPAYMENT or charge
8751: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
8752: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_AMT_NEG');
8753: FND_MSG_PUB.Add;
8754: END IF;
8755: RAISE FND_API.G_EXC_ERROR;
8756: END IF;
8757:
8758: IF (l_claim.amount > 0 AND
8759: (l_claim.claim_class = G_OVERPAYMENT_CLASS OR
8761: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_ERROR) THEN
8762: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_AMT_POS_OPM');
8763: FND_MSG_PUB.Add;
8764: END IF;
8765: RAISE FND_API.G_EXC_ERROR;
8766: END IF;
8767:
8768: -- if source_object_id is set, all info about source_object has to be set
8769: IF (l_claim.claim_class = G_DEDUCTION_CLASS AND
8767:
8768: -- if source_object_id is set, all info about source_object has to be set
8769: IF (l_claim.claim_class = G_DEDUCTION_CLASS AND
8770: (l_claim.source_object_id IS NOT NULL AND
8771: l_claim.source_object_id <> FND_API.G_MISS_NUM)) THEN
8772:
8773: IF ((l_claim.source_object_class IS NULL OR
8774: l_claim.source_object_class = FND_API.G_MISS_CHAR) OR
8775: (l_claim.source_object_type_id IS NULL OR
8770: (l_claim.source_object_id IS NOT NULL AND
8771: l_claim.source_object_id <> FND_API.G_MISS_NUM)) THEN
8772:
8773: IF ((l_claim.source_object_class IS NULL OR
8774: l_claim.source_object_class = FND_API.G_MISS_CHAR) OR
8775: (l_claim.source_object_type_id IS NULL OR
8776: l_claim.source_object_type_id = FND_API.G_MISS_NUM) OR
8777: (l_claim.source_object_number IS NULL OR
8778: l_claim.source_object_number = FND_API.G_MISS_CHAR)) THEN
8772:
8773: IF ((l_claim.source_object_class IS NULL OR
8774: l_claim.source_object_class = FND_API.G_MISS_CHAR) OR
8775: (l_claim.source_object_type_id IS NULL OR
8776: l_claim.source_object_type_id = FND_API.G_MISS_NUM) OR
8777: (l_claim.source_object_number IS NULL OR
8778: l_claim.source_object_number = FND_API.G_MISS_CHAR)) THEN
8779:
8780: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
8774: l_claim.source_object_class = FND_API.G_MISS_CHAR) OR
8775: (l_claim.source_object_type_id IS NULL OR
8776: l_claim.source_object_type_id = FND_API.G_MISS_NUM) OR
8777: (l_claim.source_object_number IS NULL OR
8778: l_claim.source_object_number = FND_API.G_MISS_CHAR)) THEN
8779:
8780: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
8781: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_SRC_INFO_MISSING');
8782: FND_MSG_PUB.add;
8780: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
8781: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_SRC_INFO_MISSING');
8782: FND_MSG_PUB.add;
8783: END IF;
8784: RAISE FND_API.g_exc_error;
8785: END IF;
8786: END IF;
8787:
8788: -- check payment_method
8786: END IF;
8787:
8788: -- check payment_method
8789: IF l_claim.payment_method IS NOT NULL AND
8790: l_claim.payment_method <> FND_API.G_MISS_CHAR THEN
8791:
8792: OPEN payment_method_csr(l_claim.payment_method);
8793: FETCH payment_method_csr into l_lookup_code_count;
8794: CLOSE payment_method_csr;
8797: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
8798: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_PAY_MTHD_WRG');
8799: FND_MSG_PUB.add;
8800: END IF;
8801: RAISE FND_API.g_exc_error;
8802: END IF;
8803: END IF;
8804:
8805: -- check pay_related_account_flag
8803: END IF;
8804:
8805: -- check pay_related_account_flag
8806: IF (l_claim.pay_related_account_flag IS NOT NULL AND
8807: l_claim.pay_related_account_flag <> FND_API.G_MISS_CHAR) THEN
8808:
8809: IF (l_claim.pay_related_account_flag <> 'F' AND
8810: l_claim.pay_related_account_flag <> 'T') THEN
8811:
8812: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
8813: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_PAY_REL_FLG_WRG');
8814: FND_MSG_PUB.add;
8815: END IF;
8816: RAISE FND_API.g_exc_error;
8817: END IF;
8818: END IF;
8819:
8820: -- check order_type_id
8818: END IF;
8819:
8820: -- check order_type_id
8821: IF (l_claim.order_type_id IS NOT NULL AND
8822: l_claim.order_type_id <> FND_API.G_MISS_NUM) THEN
8823:
8824: OPEN order_type_count_csr(l_claim.order_type_id);
8825: FETCH order_type_count_csr into l_order_type_count;
8826: CLOSE order_type_count_csr;
8828: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
8829: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_ODTYPE_WRG');
8830: FND_MSG_PUB.add;
8831: END IF;
8832: RAISE FND_API.g_exc_error;
8833: END IF;
8834: END IF;
8835:
8836: -- Fix for Bug 16301571
8836: -- Fix for Bug 16301571
8837: -- check for the claim type organization with claim organization
8838:
8839: IF (l_claim.claim_type_id IS NOT NULL AND
8840: l_claim.claim_type_id <> FND_API.G_MISS_NUM) THEN
8841:
8842: OPEN claim_type_org_csr(l_claim.claim_type_id);
8843: FETCH claim_type_org_csr INTO l_claim_type_org_id;
8844: CLOSE claim_type_org_csr;
8852: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
8853: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_TYPE_MISMATCH');
8854: FND_MSG_PUB.add;
8855: END IF;
8856: RAISE FND_API.g_exc_error;
8857: END IF;
8858:
8859: END IF;
8860:
8862: -- check for the claim reason organization with claim organization
8863:
8864:
8865: IF (l_claim.reason_code_id IS NOT NULL AND
8866: l_claim.reason_code_id <> FND_API.G_MISS_NUM) THEN
8867:
8868: OPEN claim_reason_org_csr(l_claim.reason_code_id);
8869: FETCH claim_reason_org_csr INTO l_claim_reason_org_id;
8870: CLOSE claim_reason_org_csr;
8878: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
8879: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_REASON_MISMATCH');
8880: FND_MSG_PUB.add;
8881: END IF;
8882: RAISE FND_API.g_exc_error;
8883: END IF;
8884:
8885: END IF;
8886:
8894: FND_MSG_PUB.Add;
8895: END IF;
8896: --Standard call to get message count and if count=1, get the message
8897: FND_MSG_PUB.Count_And_Get (
8898: p_encoded => FND_API.G_FALSE,
8899: p_count => x_msg_count,
8900: p_data => x_msg_data
8901: );
8902: EXCEPTION
8899: p_count => x_msg_count,
8900: p_data => x_msg_data
8901: );
8902: EXCEPTION
8903: WHEN FND_API.G_EXC_ERROR THEN
8904: ROLLBACK TO Validate_Claim_PVT;
8905: x_return_status := FND_API.G_RET_STS_ERROR;
8906: -- Standard call to get message count and if count=1, get the message
8907: FND_MSG_PUB.Count_And_Get (
8901: );
8902: EXCEPTION
8903: WHEN FND_API.G_EXC_ERROR THEN
8904: ROLLBACK TO Validate_Claim_PVT;
8905: x_return_status := FND_API.G_RET_STS_ERROR;
8906: -- Standard call to get message count and if count=1, get the message
8907: FND_MSG_PUB.Count_And_Get (
8908: p_encoded => FND_API.G_FALSE,
8909: p_count => x_msg_count,
8904: ROLLBACK TO Validate_Claim_PVT;
8905: x_return_status := FND_API.G_RET_STS_ERROR;
8906: -- Standard call to get message count and if count=1, get the message
8907: FND_MSG_PUB.Count_And_Get (
8908: p_encoded => FND_API.G_FALSE,
8909: p_count => x_msg_count,
8910: p_data => x_msg_data
8911: );
8912: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
8908: p_encoded => FND_API.G_FALSE,
8909: p_count => x_msg_count,
8910: p_data => x_msg_data
8911: );
8912: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
8913: ROLLBACK TO Validate_Claim_PVT;
8914: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8915: -- Standard call to get message count and if count=1, get the message
8916: FND_MSG_PUB.Count_And_Get (
8910: p_data => x_msg_data
8911: );
8912: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
8913: ROLLBACK TO Validate_Claim_PVT;
8914: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8915: -- Standard call to get message count and if count=1, get the message
8916: FND_MSG_PUB.Count_And_Get (
8917: p_encoded => FND_API.G_FALSE,
8918: p_count => x_msg_count,
8913: ROLLBACK TO Validate_Claim_PVT;
8914: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8915: -- Standard call to get message count and if count=1, get the message
8916: FND_MSG_PUB.Count_And_Get (
8917: p_encoded => FND_API.G_FALSE,
8918: p_count => x_msg_count,
8919: p_data => x_msg_data
8920: );
8921: WHEN OTHERS THEN
8919: p_data => x_msg_data
8920: );
8921: WHEN OTHERS THEN
8922: ROLLBACK TO Validate_Claim_PVT;
8923: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
8924: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
8925: THEN
8926: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
8927: END IF;
8926: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
8927: END IF;
8928: -- Standard call to get message count and if count=1, get the message
8929: FND_MSG_PUB.Count_And_Get (
8930: p_encoded => FND_API.G_FALSE,
8931: p_count => x_msg_count,
8932: p_data => x_msg_data
8933: );
8934: END Validate_Claim;
8949: --
8950: ----------------------------------------------------------------------
8951: PROCEDURE Check_Claim_Common_Element (
8952: p_api_version IN NUMBER
8953: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
8954: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
8955: ,x_return_status OUT NOCOPY VARCHAR2
8956: ,x_msg_count OUT NOCOPY NUMBER
8957: ,x_msg_data OUT NOCOPY VARCHAR2
8950: ----------------------------------------------------------------------
8951: PROCEDURE Check_Claim_Common_Element (
8952: p_api_version IN NUMBER
8953: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
8954: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
8955: ,x_return_status OUT NOCOPY VARCHAR2
8956: ,x_msg_count OUT NOCOPY NUMBER
8957: ,x_msg_data OUT NOCOPY VARCHAR2
8958: ,p_claim IN claim_rec_type
9009: BEGIN
9010: -- Standard begin of API savepoint
9011: SAVEPOINT Check_Clm_Cmn_Element_PVT;
9012: -- Standard call to check for call compatibility.
9013: IF NOT FND_API.Compatible_API_Call (
9014: l_api_version,
9015: p_api_version,
9016: l_api_name,
9017: G_PKG_NAME)
9015: p_api_version,
9016: l_api_name,
9017: G_PKG_NAME)
9018: THEN
9019: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9020: END IF;
9021:
9022: -- Debug Message
9023: IF OZF_DEBUG_LOW_ON THEN
9026: FND_MSG_PUB.Add;
9027: END IF;
9028:
9029: --Initialize message list if p_init_msg_list is TRUE.
9030: IF FND_API.To_Boolean (p_init_msg_list) THEN
9031: FND_MSG_PUB.initialize;
9032: END IF;
9033:
9034: -- Initialize API return status to sucess
9031: FND_MSG_PUB.initialize;
9032: END IF;
9033:
9034: -- Initialize API return status to sucess
9035: x_return_status := FND_API.G_RET_STS_SUCCESS;
9036:
9037:
9038: -- Begin of minimum required data for claims in general.
9039: -- We will check: claim_type_id, reason_code_id
9041: -- 11.5.10(uday) Removed check for Claim type id and Reason code id
9042: -- as these values are defaulted from Claim Defaults.
9043: -- Check claim_type_id
9044: -- IF l_claim.claim_type_id is NULL OR
9045: -- l_claim.claim_type_id = FND_API.G_MISS_NUM THEN
9046:
9047: -- OPEN claim_type_id_csr;
9048: -- FETCH claim_type_id_csr into l_claim.claim_type_id;
9049: -- CLOSE claim_type_id_csr;
9051: -- IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.g_msg_lvl_error) THEN
9052: -- FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_CLAIM_TYPE_MISSING');
9053: -- FND_MSG_PUB.Add;
9054: -- END IF;
9055: -- RAISE FND_API.G_EXC_ERROR;
9056: -- END IF;
9057: -- ELSE
9058: -- -- check whether the claim_type_id is in the database.
9059: -- OPEN number_of_claim_type_id_csr(l_claim.claim_type_id);
9064: -- IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
9065: -- FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_CLAIM_TYPE_NOT_IN_DB');
9066: -- FND_MSG_PUB.add;
9067: -- END IF;
9068: -- RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9069: -- END IF;
9070: -- END IF;
9071:
9072: -- -- Check reason_code_id
9070: -- END IF;
9071:
9072: -- -- Check reason_code_id
9073: -- IF l_claim.reason_code_id is NULL OR
9074: -- l_claim.reason_code_id = FND_API.G_MISS_NUM THEN
9075:
9076: -- ELSE
9077: -- check whether reason code exists
9078: -- OPEN number_of_reason_code_id_csr(l_claim.reason_code_id);
9083: -- IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
9084: -- FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_REASON_CD_NOT_IN_DB');
9085: -- FND_MSG_PUB.add;
9086: -- END IF;
9087: -- RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9088: -- END IF;
9089: -- END IF;
9090:
9091: -- Check cust_account_id
9089: -- END IF;
9090:
9091: -- Check cust_account_id
9092: IF l_claim.cust_account_id is NULL OR
9093: l_claim.cust_account_id = FND_API.G_MISS_NUM THEN
9094:
9095: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.g_msg_lvl_error) THEN
9096: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_CUST_ID_MISSING');
9097: FND_MSG_PUB.Add;
9095: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.g_msg_lvl_error) THEN
9096: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_CUST_ID_MISSING');
9097: FND_MSG_PUB.Add;
9098: END IF;
9099: RAISE FND_API.G_EXC_ERROR;
9100: ELSE
9101: -- check whether the customer is in the database.
9102: OPEN num_of_cust_acctid_csr(l_claim.cust_account_id);
9103: FETCH num_of_cust_acctid_csr INTO l_number_of_cust;
9107: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
9108: FND_MESSAGE.set_name('OZF', 'OZF_CLAIM_CUST_NOT_IN_DB');
9109: FND_MSG_PUB.add;
9110: END IF;
9111: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9112: END IF;
9113: END IF;
9114: -- End of minimum checking
9115:
9133: , x_write_off_flag => l_claim.write_off_flag
9134: , x_write_off_threshold_amount => l_claim.write_off_threshold_amount
9135: , x_under_write_off_threshold => l_claim.under_write_off_threshold
9136: ,x_return_status => l_return_status);
9137: IF l_return_status = FND_API.g_ret_sts_error THEN
9138: RAISE FND_API.g_exc_error;
9139: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
9140: RAISE FND_API.g_exc_unexpected_error;
9141: END IF;
9134: , x_write_off_threshold_amount => l_claim.write_off_threshold_amount
9135: , x_under_write_off_threshold => l_claim.under_write_off_threshold
9136: ,x_return_status => l_return_status);
9137: IF l_return_status = FND_API.g_ret_sts_error THEN
9138: RAISE FND_API.g_exc_error;
9139: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
9140: RAISE FND_API.g_exc_unexpected_error;
9141: END IF;
9142: END IF;
9135: , x_under_write_off_threshold => l_claim.under_write_off_threshold
9136: ,x_return_status => l_return_status);
9137: IF l_return_status = FND_API.g_ret_sts_error THEN
9138: RAISE FND_API.g_exc_error;
9139: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
9140: RAISE FND_API.g_exc_unexpected_error;
9141: END IF;
9142: END IF;
9143: -- -----------------------------------------------------------
9136: ,x_return_status => l_return_status);
9137: IF l_return_status = FND_API.g_ret_sts_error THEN
9138: RAISE FND_API.g_exc_error;
9139: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
9140: RAISE FND_API.g_exc_unexpected_error;
9141: END IF;
9142: END IF;
9143: -- -----------------------------------------------------------
9144: -- End of Bug : 2710047
9152: FND_MSG_PUB.Add;
9153: END IF;
9154: --Standard call to get message count and if count=1, get the message
9155: FND_MSG_PUB.Count_And_Get (
9156: p_encoded => FND_API.G_FALSE,
9157: p_count => x_msg_count,
9158: p_data => x_msg_data
9159: );
9160: EXCEPTION
9157: p_count => x_msg_count,
9158: p_data => x_msg_data
9159: );
9160: EXCEPTION
9161: WHEN FND_API.G_EXC_ERROR THEN
9162: ROLLBACK TO Check_Clm_Cmn_Element_PVT;
9163: x_return_status := FND_API.G_RET_STS_ERROR;
9164: -- Standard call to get message count and if count=1, get the message
9165: FND_MSG_PUB.Count_And_Get (
9159: );
9160: EXCEPTION
9161: WHEN FND_API.G_EXC_ERROR THEN
9162: ROLLBACK TO Check_Clm_Cmn_Element_PVT;
9163: x_return_status := FND_API.G_RET_STS_ERROR;
9164: -- Standard call to get message count and if count=1, get the message
9165: FND_MSG_PUB.Count_And_Get (
9166: p_encoded => FND_API.G_FALSE,
9167: p_count => x_msg_count,
9162: ROLLBACK TO Check_Clm_Cmn_Element_PVT;
9163: x_return_status := FND_API.G_RET_STS_ERROR;
9164: -- Standard call to get message count and if count=1, get the message
9165: FND_MSG_PUB.Count_And_Get (
9166: p_encoded => FND_API.G_FALSE,
9167: p_count => x_msg_count,
9168: p_data => x_msg_data
9169: );
9170: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9166: p_encoded => FND_API.G_FALSE,
9167: p_count => x_msg_count,
9168: p_data => x_msg_data
9169: );
9170: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9171: ROLLBACK TO Check_Clm_Cmn_Element_PVT;
9172: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9173: -- Standard call to get message count and if count=1, get the message
9174: FND_MSG_PUB.Count_And_Get (
9168: p_data => x_msg_data
9169: );
9170: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9171: ROLLBACK TO Check_Clm_Cmn_Element_PVT;
9172: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9173: -- Standard call to get message count and if count=1, get the message
9174: FND_MSG_PUB.Count_And_Get (
9175: p_encoded => FND_API.G_FALSE,
9176: p_count => x_msg_count,
9171: ROLLBACK TO Check_Clm_Cmn_Element_PVT;
9172: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9173: -- Standard call to get message count and if count=1, get the message
9174: FND_MSG_PUB.Count_And_Get (
9175: p_encoded => FND_API.G_FALSE,
9176: p_count => x_msg_count,
9177: p_data => x_msg_data
9178: );
9179: WHEN OTHERS THEN
9177: p_data => x_msg_data
9178: );
9179: WHEN OTHERS THEN
9180: ROLLBACK TO Check_Clm_Cmn_Element_PVT;
9181: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9182: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
9183: THEN
9184: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
9185: END IF;
9184: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
9185: END IF;
9186: -- Standard call to get message count and if count=1, get the message
9187: FND_MSG_PUB.Count_And_Get (
9188: p_encoded => FND_API.G_FALSE,
9189: p_count => x_msg_count,
9190: p_data => x_msg_data
9191: );
9192: END Check_Claim_Common_Element;
9207: -- Raise exception in case of duplicates.
9208: ---------------------------------------------------------------------
9209: PROCEDURE Create_Claim_tbl (
9210: p_api_version IN NUMBER
9211: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
9212: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
9213: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
9214:
9215: ,x_return_status OUT NOCOPY VARCHAR2
9208: ---------------------------------------------------------------------
9209: PROCEDURE Create_Claim_tbl (
9210: p_api_version IN NUMBER
9211: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
9212: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
9213: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
9214:
9215: ,x_return_status OUT NOCOPY VARCHAR2
9216: ,x_msg_data OUT NOCOPY VARCHAR2
9209: PROCEDURE Create_Claim_tbl (
9210: p_api_version IN NUMBER
9211: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
9212: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
9213: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
9214:
9215: ,x_return_status OUT NOCOPY VARCHAR2
9216: ,x_msg_data OUT NOCOPY VARCHAR2
9217: ,x_msg_count OUT NOCOPY NUMBER
9237: BEGIN
9238: -- Standard begin of API savepoint
9239: SAVEPOINT Create_Claim_Tbl_PVT;
9240: -- Standard call to check for call compatibility.
9241: IF NOT FND_API.Compatible_API_Call (
9242: l_api_version,
9243: p_api_version,
9244: l_api_name,
9245: G_PKG_NAME)
9243: p_api_version,
9244: l_api_name,
9245: G_PKG_NAME)
9246: THEN
9247: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9248: END IF;
9249: x_error_index := -1;
9250:
9251: -- Debug Message
9255: FND_MSG_PUB.Add;
9256: END IF;
9257:
9258: --Initialize message list if p_init_msg_list is TRUE.
9259: IF FND_API.To_Boolean (p_init_msg_list) THEN
9260: FND_MSG_PUB.initialize;
9261: END IF;
9262:
9263: -- Initialize API return status to sucess
9260: FND_MSG_PUB.initialize;
9261: END IF;
9262:
9263: -- Initialize API return status to sucess
9264: x_return_status := FND_API.G_RET_STS_SUCCESS;
9265:
9266: For i in 1..p_claim_tbl.count LOOP
9267:
9268: l_claim := p_claim_tbl(i);
9269:
9270: -- default claim_type_id, reason_code_id if necessary.
9271: OZF_claim_PVT.Check_Claim_Common_Element (
9272: p_api_version => 1.0,
9273: p_init_msg_list => FND_API.G_FALSE,
9274: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
9275: x_Return_Status => l_return_status,
9276: x_Msg_Count => l_msg_count,
9277: x_Msg_Data => l_msg_data,
9270: -- default claim_type_id, reason_code_id if necessary.
9271: OZF_claim_PVT.Check_Claim_Common_Element (
9272: p_api_version => 1.0,
9273: p_init_msg_list => FND_API.G_FALSE,
9274: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
9275: x_Return_Status => l_return_status,
9276: x_Msg_Count => l_msg_count,
9277: x_Msg_Data => l_msg_data,
9278: p_claim => l_claim,
9279: x_claim => l_x_claim,
9280: p_mode => l_mode
9281: );
9282: -- Check return status from the above procedure call
9283: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
9284: x_error_index := i;
9285: RAISE FND_API.G_EXC_ERROR;
9286: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
9287: x_error_index := i;
9281: );
9282: -- Check return status from the above procedure call
9283: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
9284: x_error_index := i;
9285: RAISE FND_API.G_EXC_ERROR;
9286: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
9287: x_error_index := i;
9288: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9289: END IF;
9282: -- Check return status from the above procedure call
9283: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
9284: x_error_index := i;
9285: RAISE FND_API.G_EXC_ERROR;
9286: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
9287: x_error_index := i;
9288: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9289: END IF;
9290:
9284: x_error_index := i;
9285: RAISE FND_API.G_EXC_ERROR;
9286: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
9287: x_error_index := i;
9288: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9289: END IF;
9290:
9291: l_claim := l_x_claim;
9292:
9293: -- default currency code if necessary.
9294: -- Default the transaction currency code to functional currency code
9295: -- if it's null.
9296: IF (l_claim.currency_code is NULL OR
9297: l_claim.currency_code = FND_API.G_MISS_CHAR)THEN
9298: l_claim.currency_code := l_default_curr_code;
9299: END IF;
9300:
9301: -- l_claim.claim_class := G_CLAIM_CLASS;
9303: -- Calling Private package: Create_claim
9304: -- Hint: Primary key needs to be returned
9305: OZF_claim_PVT.Create_Claim(
9306: P_Api_Version => 1.0,
9307: P_Init_Msg_List => FND_API.G_FALSE,
9308: P_Commit => FND_API.G_FALSE,
9309: P_Validation_Level => FND_API.G_VALID_LEVEL_FULL,
9310: X_Return_Status => l_return_status,
9311: X_Msg_Count => l_msg_count,
9304: -- Hint: Primary key needs to be returned
9305: OZF_claim_PVT.Create_Claim(
9306: P_Api_Version => 1.0,
9307: P_Init_Msg_List => FND_API.G_FALSE,
9308: P_Commit => FND_API.G_FALSE,
9309: P_Validation_Level => FND_API.G_VALID_LEVEL_FULL,
9310: X_Return_Status => l_return_status,
9311: X_Msg_Count => l_msg_count,
9312: X_Msg_Data => l_msg_data,
9305: OZF_claim_PVT.Create_Claim(
9306: P_Api_Version => 1.0,
9307: P_Init_Msg_List => FND_API.G_FALSE,
9308: P_Commit => FND_API.G_FALSE,
9309: P_Validation_Level => FND_API.G_VALID_LEVEL_FULL,
9310: X_Return_Status => l_return_status,
9311: X_Msg_Count => l_msg_count,
9312: X_Msg_Data => l_msg_data,
9313: P_claim => l_claim,
9314: X_CLAIM_ID => l_claim_id
9315: );
9316:
9317: -- Check return status from the above procedure call
9318: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
9319: x_error_index := i;
9320: RAISE FND_API.G_EXC_ERROR;
9321: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
9322: x_error_index := i;
9316:
9317: -- Check return status from the above procedure call
9318: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
9319: x_error_index := i;
9320: RAISE FND_API.G_EXC_ERROR;
9321: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
9322: x_error_index := i;
9323: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9324: END IF;
9317: -- Check return status from the above procedure call
9318: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
9319: x_error_index := i;
9320: RAISE FND_API.G_EXC_ERROR;
9321: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
9322: x_error_index := i;
9323: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9324: END IF;
9325:
9319: x_error_index := i;
9320: RAISE FND_API.G_EXC_ERROR;
9321: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
9322: x_error_index := i;
9323: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9324: END IF;
9325:
9326: END LOOP;
9327:
9332: FND_MSG_PUB.Add;
9333: END IF;
9334: --Standard call to get message count and if count=1, get the message
9335: FND_MSG_PUB.Count_And_Get (
9336: p_encoded => FND_API.G_FALSE,
9337: p_count => x_msg_count,
9338: p_data => x_msg_data
9339: );
9340: EXCEPTION
9337: p_count => x_msg_count,
9338: p_data => x_msg_data
9339: );
9340: EXCEPTION
9341: WHEN FND_API.G_EXC_ERROR THEN
9342: ROLLBACK TO Create_Claim_Tbl_PVT;
9343: x_return_status := FND_API.G_RET_STS_ERROR;
9344: /* IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
9345: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_TBL_ERR');
9339: );
9340: EXCEPTION
9341: WHEN FND_API.G_EXC_ERROR THEN
9342: ROLLBACK TO Create_Claim_Tbl_PVT;
9343: x_return_status := FND_API.G_RET_STS_ERROR;
9344: /* IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
9345: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_TBL_ERR');
9346: FND_MESSAGE.Set_Token('ROW',l_err_row);
9347: FND_MSG_PUB.Add;
9348: END IF;
9349: */
9350: -- Standard call to get message count and if count=1, get the message
9351: FND_MSG_PUB.Count_And_Get (
9352: p_encoded => FND_API.G_FALSE,
9353: p_count => x_msg_count,
9354: p_data => x_msg_data
9355: );
9356: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9352: p_encoded => FND_API.G_FALSE,
9353: p_count => x_msg_count,
9354: p_data => x_msg_data
9355: );
9356: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9357: ROLLBACK TO Create_Claim_Tbl_PVT;
9358: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9359: /* IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
9360: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_TBL_ERR');
9354: p_data => x_msg_data
9355: );
9356: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9357: ROLLBACK TO Create_Claim_Tbl_PVT;
9358: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9359: /* IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
9360: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_TBL_ERR');
9361: FND_MESSAGE.Set_Token('ROW',l_err_row);
9362: FND_MSG_PUB.Add;
9363: END IF;
9364: */
9365: -- Standard call to get message count and if count=1, get the message
9366: FND_MSG_PUB.Count_And_Get (
9367: p_encoded => FND_API.G_FALSE,
9368: p_count => x_msg_count,
9369: p_data => x_msg_data
9370: );
9371: WHEN OTHERS THEN
9369: p_data => x_msg_data
9370: );
9371: WHEN OTHERS THEN
9372: ROLLBACK TO Create_Claim_Tbl_PVT;
9373: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9374: /* IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
9375: THEN
9376: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_TBL_ERR');
9377: FND_MESSAGE.Set_Token('ROW',l_err_row);
9378: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
9379: END IF;
9380: */ -- Standard call to get message count and if count=1, get the message
9381: FND_MSG_PUB.Count_And_Get (
9382: p_encoded => FND_API.G_FALSE,
9383: p_count => x_msg_count,
9384: p_data => x_msg_data
9385: );
9386: END Create_Claim_tbl;
9409: --
9410: ---------------------------------------------------------------------
9411: PROCEDURE Update_Claim_tbl (
9412: p_api_version IN NUMBER
9413: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
9414: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
9415: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
9416:
9417: ,x_return_status OUT NOCOPY VARCHAR2
9410: ---------------------------------------------------------------------
9411: PROCEDURE Update_Claim_tbl (
9412: p_api_version IN NUMBER
9413: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
9414: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
9415: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
9416:
9417: ,x_return_status OUT NOCOPY VARCHAR2
9418: ,x_msg_data OUT NOCOPY VARCHAR2
9411: PROCEDURE Update_Claim_tbl (
9412: p_api_version IN NUMBER
9413: ,p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE
9414: ,p_commit IN VARCHAR2 := FND_API.G_FALSE
9415: ,p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL
9416:
9417: ,x_return_status OUT NOCOPY VARCHAR2
9418: ,x_msg_data OUT NOCOPY VARCHAR2
9419: ,x_msg_count OUT NOCOPY NUMBER
9438: BEGIN
9439: -- Standard begin of API savepoint
9440: SAVEPOINT Update_Claim_Tbl_PVT;
9441: -- Standard call to check for call compatibility.
9442: IF NOT FND_API.Compatible_API_Call (
9443: l_api_version,
9444: p_api_version,
9445: l_api_name,
9446: G_PKG_NAME) THEN
9443: l_api_version,
9444: p_api_version,
9445: l_api_name,
9446: G_PKG_NAME) THEN
9447: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9448: END IF;
9449:
9450: -- Debug Message
9451: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW) THEN
9454: FND_MSG_PUB.Add;
9455: END IF;
9456:
9457: --Initialize message list if p_init_msg_list is TRUE.
9458: IF FND_API.To_Boolean (p_init_msg_list) THEN
9459: FND_MSG_PUB.initialize;
9460: END IF;
9461:
9462: -- Initialize API return status to sucess
9459: FND_MSG_PUB.initialize;
9460: END IF;
9461:
9462: -- Initialize API return status to sucess
9463: x_return_status := FND_API.G_RET_STS_SUCCESS;
9464:
9465: For i in 1..p_claim_tbl.count LOOP
9466: l_claim := p_claim_tbl(i);
9467:
9472: FND_MESSAGE.Set_Name('OZF', 'OZF_CLAIM_API_NO_OPEN_STATUS');
9473: FND_MESSAGE.Set_Token('ROW',l_err_row);
9474: FND_MSG_PUB.ADD;
9475: END IF;
9476: RAISE FND_API.G_EXC_ERROR;
9477: END IF;
9478:
9479: -- If incoming value for write-off flag is unchecked then set the values in database is 'N'.
9480: IF (l_claim.write_off_flag is NULL OR
9477: END IF;
9478:
9479: -- If incoming value for write-off flag is unchecked then set the values in database is 'N'.
9480: IF (l_claim.write_off_flag is NULL OR
9481: l_claim.write_off_flag = FND_API.G_MISS_CHAR)THEN
9482: l_claim.write_off_flag := 'F';
9483: END IF;
9484:
9485: -- Calling Private package: Update_claim
9484:
9485: -- Calling Private package: Update_claim
9486: OZF_claim_PVT.Update_Claim (
9487: p_api_version => l_api_version
9488: ,p_init_msg_list => FND_API.G_FALSE
9489: ,p_commit => FND_API.G_FALSE
9490: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
9491: ,x_return_status => l_return_status
9492: ,x_msg_data => l_msg_data
9485: -- Calling Private package: Update_claim
9486: OZF_claim_PVT.Update_Claim (
9487: p_api_version => l_api_version
9488: ,p_init_msg_list => FND_API.G_FALSE
9489: ,p_commit => FND_API.G_FALSE
9490: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
9491: ,x_return_status => l_return_status
9492: ,x_msg_data => l_msg_data
9493: ,x_msg_count => l_msg_count
9486: OZF_claim_PVT.Update_Claim (
9487: p_api_version => l_api_version
9488: ,p_init_msg_list => FND_API.G_FALSE
9489: ,p_commit => FND_API.G_FALSE
9490: ,p_validation_level => FND_API.G_VALID_LEVEL_FULL
9491: ,x_return_status => l_return_status
9492: ,x_msg_data => l_msg_data
9493: ,x_msg_count => l_msg_count
9494: ,p_claim => l_claim
9496: ,p_mode => OZF_claim_Utility_pvt.G_AUTO_MODE
9497: ,x_object_version_number => l_object_version_number
9498: );
9499:
9500: IF l_return_status = FND_API.g_ret_sts_error THEN
9501: l_err_row := i;
9502: RAISE FND_API.g_exc_error;
9503: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
9504: l_err_row := i;
9498: );
9499:
9500: IF l_return_status = FND_API.g_ret_sts_error THEN
9501: l_err_row := i;
9502: RAISE FND_API.g_exc_error;
9503: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
9504: l_err_row := i;
9505: RAISE FND_API.g_exc_unexpected_error;
9506: END IF;
9499:
9500: IF l_return_status = FND_API.g_ret_sts_error THEN
9501: l_err_row := i;
9502: RAISE FND_API.g_exc_error;
9503: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
9504: l_err_row := i;
9505: RAISE FND_API.g_exc_unexpected_error;
9506: END IF;
9507: END LOOP;
9501: l_err_row := i;
9502: RAISE FND_API.g_exc_error;
9503: ELSIF l_return_status = FND_API.g_ret_sts_unexp_error THEN
9504: l_err_row := i;
9505: RAISE FND_API.g_exc_unexpected_error;
9506: END IF;
9507: END LOOP;
9508:
9509: -- Debug Message
9513: FND_MSG_PUB.Add;
9514: END IF;
9515: --Standard call to get message count and if count=1, get the message
9516: FND_MSG_PUB.Count_And_Get (
9517: p_encoded => FND_API.G_FALSE,
9518: p_count => x_msg_count,
9519: p_data => x_msg_data
9520: );
9521: EXCEPTION
9518: p_count => x_msg_count,
9519: p_data => x_msg_data
9520: );
9521: EXCEPTION
9522: WHEN FND_API.G_EXC_ERROR THEN
9523: ROLLBACK TO Update_Claim_Tbl_PVT;
9524: x_return_status := FND_API.G_RET_STS_ERROR;
9525: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
9526: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_TBL_ERR');
9520: );
9521: EXCEPTION
9522: WHEN FND_API.G_EXC_ERROR THEN
9523: ROLLBACK TO Update_Claim_Tbl_PVT;
9524: x_return_status := FND_API.G_RET_STS_ERROR;
9525: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
9526: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_TBL_ERR');
9527: FND_MESSAGE.Set_Token('ROW',l_err_row);
9528: FND_MSG_PUB.Add;
9528: FND_MSG_PUB.Add;
9529: END IF;
9530: -- Standard call to get message count and if count=1, get the message
9531: FND_MSG_PUB.Count_And_Get (
9532: p_encoded => FND_API.G_FALSE,
9533: p_count => x_msg_count,
9534: p_data => x_msg_data
9535: );
9536: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9532: p_encoded => FND_API.G_FALSE,
9533: p_count => x_msg_count,
9534: p_data => x_msg_data
9535: );
9536: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9537: ROLLBACK TO Update_Claim_Tbl_PVT;
9538: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9539: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
9540: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_TBL_ERR');
9534: p_data => x_msg_data
9535: );
9536: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9537: ROLLBACK TO Update_Claim_Tbl_PVT;
9538: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9539: IF FND_MSG_PUB.Check_Msg_level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
9540: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_TBL_ERR');
9541: FND_MESSAGE.Set_Token('ROW',l_err_row);
9542: FND_MSG_PUB.Add;
9542: FND_MSG_PUB.Add;
9543: END IF;
9544: -- Standard call to get message count and if count=1, get the message
9545: FND_MSG_PUB.Count_And_Get (
9546: p_encoded => FND_API.G_FALSE,
9547: p_count => x_msg_count,
9548: p_data => x_msg_data
9549: );
9550: WHEN OTHERS THEN
9548: p_data => x_msg_data
9549: );
9550: WHEN OTHERS THEN
9551: ROLLBACK TO Update_Claim_Tbl_PVT;
9552: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9553: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
9554: FND_MESSAGE.Set_Name('OZF','OZF_CLAIM_TBL_ERR');
9555: FND_MESSAGE.Set_Token('ROW',l_err_row);
9556: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
9556: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
9557: END IF;
9558: -- Standard call to get message count and if count=1, get the message
9559: FND_MSG_PUB.Count_And_Get (
9560: p_encoded => FND_API.G_FALSE,
9561: p_count => x_msg_count,
9562: p_data => x_msg_data
9563: );
9564: END Update_Claim_tbl;