85: arp_standard.debug('Insert_schedule_Row -');
86: EXCEPTION
87: WHEN OTHERS THEN
88: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
89: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
90: FND_MESSAGE.SET_TOKEN('ERROR' ,'Insert_schedule_Row:'||SQLERRM);
91: FND_MSG_PUB.ADD;
92: END Insert_schedule_Row;
93:
86: EXCEPTION
87: WHEN OTHERS THEN
88: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
89: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
90: FND_MESSAGE.SET_TOKEN('ERROR' ,'Insert_schedule_Row:'||SQLERRM);
91: FND_MSG_PUB.ADD;
92: END Insert_schedule_Row;
93:
94:
178: arp_standard.debug('Insert_schedule_Row -');
179: EXCEPTION
180: WHEN OTHERS THEN
181: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
182: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
183: FND_MESSAGE.SET_TOKEN('ERROR' ,'Insert_schedule_Row:'||SQLERRM);
184: FND_MSG_PUB.ADD;
185: END Update_schedule_Row;
186:
179: EXCEPTION
180: WHEN OTHERS THEN
181: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
182: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
183: FND_MESSAGE.SET_TOKEN('ERROR' ,'Insert_schedule_Row:'||SQLERRM);
184: FND_MSG_PUB.ADD;
185: END Update_schedule_Row;
186:
187:
282: arp_standard.debug('Insert_Head_Row -');
283: EXCEPTION
284: WHEN OTHERS THEN
285: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
286: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
287: FND_MESSAGE.SET_TOKEN('ERROR' ,'Insert_Head_Row:'||SQLERRM);
288: FND_MSG_PUB.ADD;
289: END Insert_Head_Row;
290:
283: EXCEPTION
284: WHEN OTHERS THEN
285: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
286: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
287: FND_MESSAGE.SET_TOKEN('ERROR' ,'Insert_Head_Row:'||SQLERRM);
288: FND_MSG_PUB.ADD;
289: END Insert_Head_Row;
290:
291:
388: arp_standard.debug('Update_Head_Row -');
389: EXCEPTION
390: WHEN OTHERS THEN
391: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
392: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
393: FND_MESSAGE.SET_TOKEN('ERROR' ,'Update_Head_Row:'||SQLERRM);
394: FND_MSG_PUB.ADD;
395: END Update_Head_Row;
396:
389: EXCEPTION
390: WHEN OTHERS THEN
391: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
392: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
393: FND_MESSAGE.SET_TOKEN('ERROR' ,'Update_Head_Row:'||SQLERRM);
394: FND_MSG_PUB.ADD;
395: END Update_Head_Row;
396:
397:
492: arp_standard.debug('Insert_Line_Row -');
493: EXCEPTION
494: WHEN OTHERS THEN
495: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
496: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
497: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
498: FND_MSG_PUB.ADD;
499: END Insert_Line_Row;
500:
493: EXCEPTION
494: WHEN OTHERS THEN
495: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
496: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
497: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
498: FND_MSG_PUB.ADD;
499: END Insert_Line_Row;
500:
501:
590: arp_standard.debug('Update_Line_Row -');
591: EXCEPTION
592: WHEN OTHERS THEN
593: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
594: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
595: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
596: FND_MSG_PUB.ADD;
597: END Update_Line_Row;
598:
591: EXCEPTION
592: WHEN OTHERS THEN
593: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
594: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
595: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
596: FND_MSG_PUB.ADD;
597: END Update_Line_Row;
598:
599:
669: -------------------------
670: arp_standard.debug(' Validate schedule_name +');
671: IF p_mode = 'INSERT' THEN
672: IF p_schedule_name IS NULL OR p_schedule_name = FND_API.G_MISS_CHAR THEN
673: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
674: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'schedule_name' );
675: FND_MSG_PUB.ADD;
676: x_return_status := FND_API.G_RET_STS_ERROR;
677: END IF;
670: arp_standard.debug(' Validate schedule_name +');
671: IF p_mode = 'INSERT' THEN
672: IF p_schedule_name IS NULL OR p_schedule_name = FND_API.G_MISS_CHAR THEN
673: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
674: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'schedule_name' );
675: FND_MSG_PUB.ADD;
676: x_return_status := FND_API.G_RET_STS_ERROR;
677: END IF;
678: END IF;
733: -- Validate schedule_id
734: -------------------------------------
735: arp_standard.debug(' Validate schedule_id +');
736: IF P_SCHEDULE_ID IS NULL OR P_SCHEDULE_ID = fnd_api.g_miss_num THEN
737: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
738: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'SCHEDULE_ID' );
739: FND_MSG_PUB.ADD;
740: x_return_status := FND_API.G_RET_STS_ERROR;
741: END IF;
734: -------------------------------------
735: arp_standard.debug(' Validate schedule_id +');
736: IF P_SCHEDULE_ID IS NULL OR P_SCHEDULE_ID = fnd_api.g_miss_num THEN
737: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
738: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'SCHEDULE_ID' );
739: FND_MSG_PUB.ADD;
740: x_return_status := FND_API.G_RET_STS_ERROR;
741: END IF;
742: OPEN c_schedule_id;
741: END IF;
742: OPEN c_schedule_id;
743: FETCH c_schedule_id INTO l_c;
744: IF c_schedule_id%NOTFOUND THEN
745: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
746: FND_MESSAGE.SET_TOKEN('FK', 'ar charge schedules');
747: FND_MESSAGE.SET_TOKEN('COLUMN', 'schedule_id');
748: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_charge_schedules');
749: FND_MSG_PUB.ADD;
742: OPEN c_schedule_id;
743: FETCH c_schedule_id INTO l_c;
744: IF c_schedule_id%NOTFOUND THEN
745: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
746: FND_MESSAGE.SET_TOKEN('FK', 'ar charge schedules');
747: FND_MESSAGE.SET_TOKEN('COLUMN', 'schedule_id');
748: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_charge_schedules');
749: FND_MSG_PUB.ADD;
750: x_return_status := FND_API.G_RET_STS_ERROR;
743: FETCH c_schedule_id INTO l_c;
744: IF c_schedule_id%NOTFOUND THEN
745: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
746: FND_MESSAGE.SET_TOKEN('FK', 'ar charge schedules');
747: FND_MESSAGE.SET_TOKEN('COLUMN', 'schedule_id');
748: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_charge_schedules');
749: FND_MSG_PUB.ADD;
750: x_return_status := FND_API.G_RET_STS_ERROR;
751: END IF;
744: IF c_schedule_id%NOTFOUND THEN
745: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
746: FND_MESSAGE.SET_TOKEN('FK', 'ar charge schedules');
747: FND_MESSAGE.SET_TOKEN('COLUMN', 'schedule_id');
748: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_charge_schedules');
749: FND_MSG_PUB.ADD;
750: x_return_status := FND_API.G_RET_STS_ERROR;
751: END IF;
752: CLOSE c_schedule_id;
756: -- Validate SCHEDULE_HEADER_TYPE lookup code in lookup type SCHEDULE_HEADER_TYPE
757: --------------------------------------------------------------------------
758: arp_standard.debug(' Validate schedule_header_type +');
759: IF p_schedule_header_type IS NULL OR p_schedule_header_type = fnd_api.g_miss_char THEN
760: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
761: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'schedule_header_type' );
762: FND_MSG_PUB.ADD;
763: x_return_status := FND_API.G_RET_STS_ERROR;
764: END IF;
757: --------------------------------------------------------------------------
758: arp_standard.debug(' Validate schedule_header_type +');
759: IF p_schedule_header_type IS NULL OR p_schedule_header_type = fnd_api.g_miss_char THEN
760: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
761: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'schedule_header_type' );
762: FND_MSG_PUB.ADD;
763: x_return_status := FND_API.G_RET_STS_ERROR;
764: END IF;
765:
764: END IF;
765:
766: IF validate_lookup('SCHEDULE_HEADER_TYPE',p_schedule_header_type) = FALSE THEN
767: arp_standard.debug(' schedule type should be lookup code for the lookup type SCHEDULE_HEADER_TYPE');
768: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_LOOKUP' );
769: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'schedule header type' );
770: FND_MESSAGE.SET_TOKEN( 'LOOKUP_TYPE', 'SCHEDULE_HEADER_TYPE' );
771: FND_MSG_PUB.ADD;
772: x_return_status := FND_API.G_RET_STS_ERROR;
765:
766: IF validate_lookup('SCHEDULE_HEADER_TYPE',p_schedule_header_type) = FALSE THEN
767: arp_standard.debug(' schedule type should be lookup code for the lookup type SCHEDULE_HEADER_TYPE');
768: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_LOOKUP' );
769: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'schedule header type' );
770: FND_MESSAGE.SET_TOKEN( 'LOOKUP_TYPE', 'SCHEDULE_HEADER_TYPE' );
771: FND_MSG_PUB.ADD;
772: x_return_status := FND_API.G_RET_STS_ERROR;
773: END IF;
766: IF validate_lookup('SCHEDULE_HEADER_TYPE',p_schedule_header_type) = FALSE THEN
767: arp_standard.debug(' schedule type should be lookup code for the lookup type SCHEDULE_HEADER_TYPE');
768: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_LOOKUP' );
769: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'schedule header type' );
770: FND_MESSAGE.SET_TOKEN( 'LOOKUP_TYPE', 'SCHEDULE_HEADER_TYPE' );
771: FND_MSG_PUB.ADD;
772: x_return_status := FND_API.G_RET_STS_ERROR;
773: END IF;
774: arp_standard.debug(' Validate schedule_header_type -');
778: -- Validate STATUS lookup code in lookup type REGISTRY_STATUS
779: -------------------------------------------------------------
780: arp_standard.debug(' Validate status +');
781: IF p_status IS NULL OR p_status = fnd_api.g_miss_char THEN
782: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
783: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'status' );
784: FND_MSG_PUB.ADD;
785: x_return_status := FND_API.G_RET_STS_ERROR;
786: END IF;
779: -------------------------------------------------------------
780: arp_standard.debug(' Validate status +');
781: IF p_status IS NULL OR p_status = fnd_api.g_miss_char THEN
782: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
783: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'status' );
784: FND_MSG_PUB.ADD;
785: x_return_status := FND_API.G_RET_STS_ERROR;
786: END IF;
787:
786: END IF;
787:
788: IF validate_lookup('REGISTRY_STATUS',p_status) = FALSE THEN
789: arp_standard.debug(' status should be lookup code for the lookup type REGISTRY_STATUS');
790: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_LOOKUP' );
791: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'status' );
792: FND_MESSAGE.SET_TOKEN( 'LOOKUP_TYPE', 'REGISTRY_STATUS' );
793: FND_MSG_PUB.ADD;
794: x_return_status := FND_API.G_RET_STS_ERROR;
787:
788: IF validate_lookup('REGISTRY_STATUS',p_status) = FALSE THEN
789: arp_standard.debug(' status should be lookup code for the lookup type REGISTRY_STATUS');
790: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_LOOKUP' );
791: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'status' );
792: FND_MESSAGE.SET_TOKEN( 'LOOKUP_TYPE', 'REGISTRY_STATUS' );
793: FND_MSG_PUB.ADD;
794: x_return_status := FND_API.G_RET_STS_ERROR;
795: END IF;
788: IF validate_lookup('REGISTRY_STATUS',p_status) = FALSE THEN
789: arp_standard.debug(' status should be lookup code for the lookup type REGISTRY_STATUS');
790: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_LOOKUP' );
791: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'status' );
792: FND_MESSAGE.SET_TOKEN( 'LOOKUP_TYPE', 'REGISTRY_STATUS' );
793: FND_MSG_PUB.ADD;
794: x_return_status := FND_API.G_RET_STS_ERROR;
795: END IF;
796: arp_standard.debug(' Validate status -');
805: ELSE
806: OPEN c_aging_bucket;
807: FETCH c_aging_bucket INTO l_c;
808: IF c_aging_bucket%NOTFOUND THEN
809: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
810: FND_MESSAGE.SET_TOKEN('FK', 'ar aging bucket id');
811: FND_MESSAGE.SET_TOKEN('COLUMN', 'aging_bucket_id');
812: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_aging_bucket');
813: FND_MSG_PUB.ADD;
806: OPEN c_aging_bucket;
807: FETCH c_aging_bucket INTO l_c;
808: IF c_aging_bucket%NOTFOUND THEN
809: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
810: FND_MESSAGE.SET_TOKEN('FK', 'ar aging bucket id');
811: FND_MESSAGE.SET_TOKEN('COLUMN', 'aging_bucket_id');
812: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_aging_bucket');
813: FND_MSG_PUB.ADD;
814: x_return_status := FND_API.G_RET_STS_ERROR;
807: FETCH c_aging_bucket INTO l_c;
808: IF c_aging_bucket%NOTFOUND THEN
809: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
810: FND_MESSAGE.SET_TOKEN('FK', 'ar aging bucket id');
811: FND_MESSAGE.SET_TOKEN('COLUMN', 'aging_bucket_id');
812: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_aging_bucket');
813: FND_MSG_PUB.ADD;
814: x_return_status := FND_API.G_RET_STS_ERROR;
815: END IF;
808: IF c_aging_bucket%NOTFOUND THEN
809: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
810: FND_MESSAGE.SET_TOKEN('FK', 'ar aging bucket id');
811: FND_MESSAGE.SET_TOKEN('COLUMN', 'aging_bucket_id');
812: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_aging_bucket');
813: FND_MSG_PUB.ADD;
814: x_return_status := FND_API.G_RET_STS_ERROR;
815: END IF;
816: CLOSE c_aging_bucket;
824: arp_standard.debug(' validate start and end dates +');
825:
826: IF p_start_date IS NULL OR p_start_date = fnd_api.g_miss_date THEN
827: arp_standard.debug(' validate start date is mandatory');
828: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
829: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'p_start_date' );
830: FND_MSG_PUB.ADD;
831: x_return_status := FND_API.G_RET_STS_ERROR;
832: END IF;
825:
826: IF p_start_date IS NULL OR p_start_date = fnd_api.g_miss_date THEN
827: arp_standard.debug(' validate start date is mandatory');
828: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
829: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'p_start_date' );
830: FND_MSG_PUB.ADD;
831: x_return_status := FND_API.G_RET_STS_ERROR;
832: END IF;
833:
835: date2 => p_end_date );
836:
837: IF l_val = 1 THEN
838: arp_standard.debug(' end date should be greater than the start date');
839: fnd_message.set_name('AR', 'HZ_API_DATE_GREATER');
840: fnd_message.set_token('DATE2', 'end_date');
841: fnd_message.set_token('DATE1', 'start_date');
842: fnd_msg_pub.add;
843: x_return_status := fnd_api.g_ret_sts_error;
836:
837: IF l_val = 1 THEN
838: arp_standard.debug(' end date should be greater than the start date');
839: fnd_message.set_name('AR', 'HZ_API_DATE_GREATER');
840: fnd_message.set_token('DATE2', 'end_date');
841: fnd_message.set_token('DATE1', 'start_date');
842: fnd_msg_pub.add;
843: x_return_status := fnd_api.g_ret_sts_error;
844: END IF;
837: IF l_val = 1 THEN
838: arp_standard.debug(' end date should be greater than the start date');
839: fnd_message.set_name('AR', 'HZ_API_DATE_GREATER');
840: fnd_message.set_token('DATE2', 'end_date');
841: fnd_message.set_token('DATE1', 'start_date');
842: fnd_msg_pub.add;
843: x_return_status := fnd_api.g_ret_sts_error;
844: END IF;
845:
861: ELSE
862: arp_standard.debug(' overlapping issue :');
863: arp_standard.debug(' existing start :'||l_start_date|| ' end :'||l_end_date);
864: arp_standard.debug(' entered start :'||p_start_date|| ' end :'||p_end_date);
865: fnd_message.set_name('AR', 'AR_DATE_OVERLAPP');
866: fnd_message.set_token('START_DATE_PER_1', l_start_date);
867: fnd_message.set_token('END_DATE_PER_1' , l_end_date);
868: fnd_message.set_token('START_DATE_PER_2', p_start_date);
869: fnd_message.set_token('END_DATE_PER_2' , p_end_date);
862: arp_standard.debug(' overlapping issue :');
863: arp_standard.debug(' existing start :'||l_start_date|| ' end :'||l_end_date);
864: arp_standard.debug(' entered start :'||p_start_date|| ' end :'||p_end_date);
865: fnd_message.set_name('AR', 'AR_DATE_OVERLAPP');
866: fnd_message.set_token('START_DATE_PER_1', l_start_date);
867: fnd_message.set_token('END_DATE_PER_1' , l_end_date);
868: fnd_message.set_token('START_DATE_PER_2', p_start_date);
869: fnd_message.set_token('END_DATE_PER_2' , p_end_date);
870: fnd_msg_pub.add;
863: arp_standard.debug(' existing start :'||l_start_date|| ' end :'||l_end_date);
864: arp_standard.debug(' entered start :'||p_start_date|| ' end :'||p_end_date);
865: fnd_message.set_name('AR', 'AR_DATE_OVERLAPP');
866: fnd_message.set_token('START_DATE_PER_1', l_start_date);
867: fnd_message.set_token('END_DATE_PER_1' , l_end_date);
868: fnd_message.set_token('START_DATE_PER_2', p_start_date);
869: fnd_message.set_token('END_DATE_PER_2' , p_end_date);
870: fnd_msg_pub.add;
871: x_return_status := fnd_api.g_ret_sts_error;
864: arp_standard.debug(' entered start :'||p_start_date|| ' end :'||p_end_date);
865: fnd_message.set_name('AR', 'AR_DATE_OVERLAPP');
866: fnd_message.set_token('START_DATE_PER_1', l_start_date);
867: fnd_message.set_token('END_DATE_PER_1' , l_end_date);
868: fnd_message.set_token('START_DATE_PER_2', p_start_date);
869: fnd_message.set_token('END_DATE_PER_2' , p_end_date);
870: fnd_msg_pub.add;
871: x_return_status := fnd_api.g_ret_sts_error;
872: END IF;
865: fnd_message.set_name('AR', 'AR_DATE_OVERLAPP');
866: fnd_message.set_token('START_DATE_PER_1', l_start_date);
867: fnd_message.set_token('END_DATE_PER_1' , l_end_date);
868: fnd_message.set_token('START_DATE_PER_2', p_start_date);
869: fnd_message.set_token('END_DATE_PER_2' , p_end_date);
870: fnd_msg_pub.add;
871: x_return_status := fnd_api.g_ret_sts_error;
872: END IF;
873: END IF;
887: -- Validate STATUS lookup code in lookup type REGISTRY_STATUS
888: -------------------------------------------------------------
889: arp_standard.debug(' Validate status +');
890: IF p_status = fnd_api.g_miss_char THEN
891: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
892: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'status' );
893: FND_MSG_PUB.ADD;
894: x_return_status := FND_API.G_RET_STS_ERROR;
895: END IF;
888: -------------------------------------------------------------
889: arp_standard.debug(' Validate status +');
890: IF p_status = fnd_api.g_miss_char THEN
891: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
892: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'status' );
893: FND_MSG_PUB.ADD;
894: x_return_status := FND_API.G_RET_STS_ERROR;
895: END IF;
896:
896:
897: IF p_status IS NOT NULL THEN
898: IF validate_lookup('REGISTRY_STATUS',p_status) = FALSE THEN
899: arp_standard.debug(' status should be lookup code for the lookup type REGISTRY_STATUS');
900: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_LOOKUP' );
901: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'status' );
902: FND_MESSAGE.SET_TOKEN( 'LOOKUP_TYPE', 'REGISTRY_STATUS' );
903: FND_MSG_PUB.ADD;
904: x_return_status := FND_API.G_RET_STS_ERROR;
897: IF p_status IS NOT NULL THEN
898: IF validate_lookup('REGISTRY_STATUS',p_status) = FALSE THEN
899: arp_standard.debug(' status should be lookup code for the lookup type REGISTRY_STATUS');
900: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_LOOKUP' );
901: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'status' );
902: FND_MESSAGE.SET_TOKEN( 'LOOKUP_TYPE', 'REGISTRY_STATUS' );
903: FND_MSG_PUB.ADD;
904: x_return_status := FND_API.G_RET_STS_ERROR;
905: END IF;
898: IF validate_lookup('REGISTRY_STATUS',p_status) = FALSE THEN
899: arp_standard.debug(' status should be lookup code for the lookup type REGISTRY_STATUS');
900: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_LOOKUP' );
901: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'status' );
902: FND_MESSAGE.SET_TOKEN( 'LOOKUP_TYPE', 'REGISTRY_STATUS' );
903: FND_MSG_PUB.ADD;
904: x_return_status := FND_API.G_RET_STS_ERROR;
905: END IF;
906: END IF;
906: END IF;
907:
908: IF p_old_status = 'I' AND p_status = 'A' THEN
909: arp_standard.debug(' Schedule Header can not be reactivated');
910: FND_MESSAGE.SET_NAME( 'AR', 'AR_NO_REACTIVATE_ALLOW' );
911: FND_MSG_PUB.ADD;
912: x_return_status := FND_API.G_RET_STS_ERROR;
913: END IF;
914:
922: l_val := compare(date1 => p_start_date,
923: date2 => p_end_date );
924: IF l_val = 1 THEN
925: arp_standard.debug(' end date should be greater than the start date');
926: fnd_message.set_name('AR', 'HZ_API_DATE_GREATER');
927: fnd_message.set_token('DATE2', 'end_date');
928: fnd_message.set_token('DATE1', 'start_date');
929: fnd_msg_pub.add;
930: x_return_status := fnd_api.g_ret_sts_error;
923: date2 => p_end_date );
924: IF l_val = 1 THEN
925: arp_standard.debug(' end date should be greater than the start date');
926: fnd_message.set_name('AR', 'HZ_API_DATE_GREATER');
927: fnd_message.set_token('DATE2', 'end_date');
928: fnd_message.set_token('DATE1', 'start_date');
929: fnd_msg_pub.add;
930: x_return_status := fnd_api.g_ret_sts_error;
931: END IF;
924: IF l_val = 1 THEN
925: arp_standard.debug(' end date should be greater than the start date');
926: fnd_message.set_name('AR', 'HZ_API_DATE_GREATER');
927: fnd_message.set_token('DATE2', 'end_date');
928: fnd_message.set_token('DATE1', 'start_date');
929: fnd_msg_pub.add;
930: x_return_status := fnd_api.g_ret_sts_error;
931: END IF;
932: IF x_return_status = fnd_api.g_ret_sts_success THEN
946: ELSE
947: arp_standard.debug(' overlapping issue :');
948: arp_standard.debug(' existing start :'||l_start_date|| ' end :'||l_end_date);
949: arp_standard.debug(' entered start :'||p_start_date|| ' end :'||p_end_date);
950: fnd_message.set_name('AR', 'AR_DATE_OVERLAPP');
951: fnd_message.set_token('START_DATE_PER_1', l_start_date);
952: fnd_message.set_token('END_DATE_PER_1' , l_end_date);
953: fnd_message.set_token('START_DATE_PER_2', p_start_date);
954: fnd_message.set_token('END_DATE_PER_2' , p_end_date);
947: arp_standard.debug(' overlapping issue :');
948: arp_standard.debug(' existing start :'||l_start_date|| ' end :'||l_end_date);
949: arp_standard.debug(' entered start :'||p_start_date|| ' end :'||p_end_date);
950: fnd_message.set_name('AR', 'AR_DATE_OVERLAPP');
951: fnd_message.set_token('START_DATE_PER_1', l_start_date);
952: fnd_message.set_token('END_DATE_PER_1' , l_end_date);
953: fnd_message.set_token('START_DATE_PER_2', p_start_date);
954: fnd_message.set_token('END_DATE_PER_2' , p_end_date);
955: fnd_msg_pub.add;
948: arp_standard.debug(' existing start :'||l_start_date|| ' end :'||l_end_date);
949: arp_standard.debug(' entered start :'||p_start_date|| ' end :'||p_end_date);
950: fnd_message.set_name('AR', 'AR_DATE_OVERLAPP');
951: fnd_message.set_token('START_DATE_PER_1', l_start_date);
952: fnd_message.set_token('END_DATE_PER_1' , l_end_date);
953: fnd_message.set_token('START_DATE_PER_2', p_start_date);
954: fnd_message.set_token('END_DATE_PER_2' , p_end_date);
955: fnd_msg_pub.add;
956: x_return_status := fnd_api.g_ret_sts_error;
949: arp_standard.debug(' entered start :'||p_start_date|| ' end :'||p_end_date);
950: fnd_message.set_name('AR', 'AR_DATE_OVERLAPP');
951: fnd_message.set_token('START_DATE_PER_1', l_start_date);
952: fnd_message.set_token('END_DATE_PER_1' , l_end_date);
953: fnd_message.set_token('START_DATE_PER_2', p_start_date);
954: fnd_message.set_token('END_DATE_PER_2' , p_end_date);
955: fnd_msg_pub.add;
956: x_return_status := fnd_api.g_ret_sts_error;
957: END IF;
950: fnd_message.set_name('AR', 'AR_DATE_OVERLAPP');
951: fnd_message.set_token('START_DATE_PER_1', l_start_date);
952: fnd_message.set_token('END_DATE_PER_1' , l_end_date);
953: fnd_message.set_token('START_DATE_PER_2', p_start_date);
954: fnd_message.set_token('END_DATE_PER_2' , p_end_date);
955: fnd_msg_pub.add;
956: x_return_status := fnd_api.g_ret_sts_error;
957: END IF;
958: END IF;
1025: -------------------------------------
1026: arp_standard.debug(' Validate schedule_header_id +');
1027:
1028: IF p_schedule_header_id IS NULL OR p_schedule_header_id = fnd_api.g_miss_num THEN
1029: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
1030: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'schedule_header_id' );
1031: FND_MSG_PUB.ADD;
1032: x_return_status := FND_API.G_RET_STS_ERROR;
1033: END IF;
1026: arp_standard.debug(' Validate schedule_header_id +');
1027:
1028: IF p_schedule_header_id IS NULL OR p_schedule_header_id = fnd_api.g_miss_num THEN
1029: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
1030: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'schedule_header_id' );
1031: FND_MSG_PUB.ADD;
1032: x_return_status := FND_API.G_RET_STS_ERROR;
1033: END IF;
1034:
1034:
1035: OPEN c_header;
1036: FETCH c_header INTO l_rec;
1037: IF c_header%NOTFOUND THEN
1038: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
1039: FND_MESSAGE.SET_TOKEN('FK', 'schedule header');
1040: FND_MESSAGE.SET_TOKEN('COLUMN', 'schedule_header_id');
1041: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_charge_schedule_hdrs');
1042: FND_MSG_PUB.ADD;
1035: OPEN c_header;
1036: FETCH c_header INTO l_rec;
1037: IF c_header%NOTFOUND THEN
1038: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
1039: FND_MESSAGE.SET_TOKEN('FK', 'schedule header');
1040: FND_MESSAGE.SET_TOKEN('COLUMN', 'schedule_header_id');
1041: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_charge_schedule_hdrs');
1042: FND_MSG_PUB.ADD;
1043: x_return_status := FND_API.G_RET_STS_ERROR;
1036: FETCH c_header INTO l_rec;
1037: IF c_header%NOTFOUND THEN
1038: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
1039: FND_MESSAGE.SET_TOKEN('FK', 'schedule header');
1040: FND_MESSAGE.SET_TOKEN('COLUMN', 'schedule_header_id');
1041: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_charge_schedule_hdrs');
1042: FND_MSG_PUB.ADD;
1043: x_return_status := FND_API.G_RET_STS_ERROR;
1044: END IF;
1037: IF c_header%NOTFOUND THEN
1038: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
1039: FND_MESSAGE.SET_TOKEN('FK', 'schedule header');
1040: FND_MESSAGE.SET_TOKEN('COLUMN', 'schedule_header_id');
1041: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_charge_schedule_hdrs');
1042: FND_MSG_PUB.ADD;
1043: x_return_status := FND_API.G_RET_STS_ERROR;
1044: END IF;
1045: CLOSE c_header;
1050: -- Validate schedule_id
1051: ------------------------
1052: arp_standard.debug(' Validate schedule_id +');
1053: IF p_schedule_id IS NULL OR p_schedule_id = fnd_api.g_miss_num THEN
1054: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
1055: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'schedule_id' );
1056: FND_MSG_PUB.ADD;
1057: x_return_status := FND_API.G_RET_STS_ERROR;
1058: ELSE
1051: ------------------------
1052: arp_standard.debug(' Validate schedule_id +');
1053: IF p_schedule_id IS NULL OR p_schedule_id = fnd_api.g_miss_num THEN
1054: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
1055: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'schedule_id' );
1056: FND_MSG_PUB.ADD;
1057: x_return_status := FND_API.G_RET_STS_ERROR;
1058: ELSE
1059: IF p_schedule_id <> l_rec.schedule_id THEN
1056: FND_MSG_PUB.ADD;
1057: x_return_status := FND_API.G_RET_STS_ERROR;
1058: ELSE
1059: IF p_schedule_id <> l_rec.schedule_id THEN
1060: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
1061: FND_MESSAGE.SET_TOKEN('FK', 'schedule header');
1062: FND_MESSAGE.SET_TOKEN('COLUMN', 'schedule_id');
1063: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_charge_schedule_hdrs');
1064: FND_MSG_PUB.ADD;
1057: x_return_status := FND_API.G_RET_STS_ERROR;
1058: ELSE
1059: IF p_schedule_id <> l_rec.schedule_id THEN
1060: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
1061: FND_MESSAGE.SET_TOKEN('FK', 'schedule header');
1062: FND_MESSAGE.SET_TOKEN('COLUMN', 'schedule_id');
1063: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_charge_schedule_hdrs');
1064: FND_MSG_PUB.ADD;
1065: x_return_status := FND_API.G_RET_STS_ERROR;
1058: ELSE
1059: IF p_schedule_id <> l_rec.schedule_id THEN
1060: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
1061: FND_MESSAGE.SET_TOKEN('FK', 'schedule header');
1062: FND_MESSAGE.SET_TOKEN('COLUMN', 'schedule_id');
1063: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_charge_schedule_hdrs');
1064: FND_MSG_PUB.ADD;
1065: x_return_status := FND_API.G_RET_STS_ERROR;
1066: END IF;
1059: IF p_schedule_id <> l_rec.schedule_id THEN
1060: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
1061: FND_MESSAGE.SET_TOKEN('FK', 'schedule header');
1062: FND_MESSAGE.SET_TOKEN('COLUMN', 'schedule_id');
1063: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_charge_schedule_hdrs');
1064: FND_MSG_PUB.ADD;
1065: x_return_status := FND_API.G_RET_STS_ERROR;
1066: END IF;
1067: END IF;
1072: -- Validate aging_bucket_id
1073: ---------------------------
1074: arp_standard.debug(' Validate aging_bucket_id +');
1075: IF P_AGING_BUCKET_ID IS NULL OR P_AGING_BUCKET_ID = fnd_api.g_miss_num THEN
1076: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
1077: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'P_AGING_BUCKET_ID' );
1078: FND_MSG_PUB.ADD;
1079: x_return_status := FND_API.G_RET_STS_ERROR;
1080: ELSE
1073: ---------------------------
1074: arp_standard.debug(' Validate aging_bucket_id +');
1075: IF P_AGING_BUCKET_ID IS NULL OR P_AGING_BUCKET_ID = fnd_api.g_miss_num THEN
1076: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
1077: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'P_AGING_BUCKET_ID' );
1078: FND_MSG_PUB.ADD;
1079: x_return_status := FND_API.G_RET_STS_ERROR;
1080: ELSE
1081: IF P_AGING_BUCKET_ID <> l_rec.aging_bucket_id THEN
1078: FND_MSG_PUB.ADD;
1079: x_return_status := FND_API.G_RET_STS_ERROR;
1080: ELSE
1081: IF P_AGING_BUCKET_ID <> l_rec.aging_bucket_id THEN
1082: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
1083: FND_MESSAGE.SET_TOKEN('FK', 'schedule header');
1084: FND_MESSAGE.SET_TOKEN('COLUMN', 'aging_bucket_id');
1085: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_charge_schedule_hdrs');
1086: FND_MSG_PUB.ADD;
1079: x_return_status := FND_API.G_RET_STS_ERROR;
1080: ELSE
1081: IF P_AGING_BUCKET_ID <> l_rec.aging_bucket_id THEN
1082: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
1083: FND_MESSAGE.SET_TOKEN('FK', 'schedule header');
1084: FND_MESSAGE.SET_TOKEN('COLUMN', 'aging_bucket_id');
1085: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_charge_schedule_hdrs');
1086: FND_MSG_PUB.ADD;
1087: x_return_status := FND_API.G_RET_STS_ERROR;
1080: ELSE
1081: IF P_AGING_BUCKET_ID <> l_rec.aging_bucket_id THEN
1082: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
1083: FND_MESSAGE.SET_TOKEN('FK', 'schedule header');
1084: FND_MESSAGE.SET_TOKEN('COLUMN', 'aging_bucket_id');
1085: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_charge_schedule_hdrs');
1086: FND_MSG_PUB.ADD;
1087: x_return_status := FND_API.G_RET_STS_ERROR;
1088: END IF;
1081: IF P_AGING_BUCKET_ID <> l_rec.aging_bucket_id THEN
1082: FND_MESSAGE.SET_NAME('AR', 'HZ_API_INVALID_FK');
1083: FND_MESSAGE.SET_TOKEN('FK', 'schedule header');
1084: FND_MESSAGE.SET_TOKEN('COLUMN', 'aging_bucket_id');
1085: FND_MESSAGE.SET_TOKEN('TABLE', 'ar_charge_schedule_hdrs');
1086: FND_MSG_PUB.ADD;
1087: x_return_status := FND_API.G_RET_STS_ERROR;
1088: END IF;
1089: END IF;
1101: FETCH ar_schedule_line_u2 INTO l_c;
1102: IF ar_schedule_line_u2%FOUND THEN
1103: arp_standard.debug(' A Record in ar_charge_schedule_lines exists with '||
1104: ' schedule_header_id - aging_bucket_id - aging_bucket_line_id');
1105: fnd_message.set_name('AR', 'AR_API_REC_COMB_EXISTS');
1106: fnd_message.set_token('COLUMN1', 'schedule_header_id');
1107: fnd_message.set_token('COLUMN2', 'aging_bucket_id');
1108: fnd_message.set_token('COLUMN3', 'aging_bucket_line_id');
1109: fnd_msg_pub.add;
1102: IF ar_schedule_line_u2%FOUND THEN
1103: arp_standard.debug(' A Record in ar_charge_schedule_lines exists with '||
1104: ' schedule_header_id - aging_bucket_id - aging_bucket_line_id');
1105: fnd_message.set_name('AR', 'AR_API_REC_COMB_EXISTS');
1106: fnd_message.set_token('COLUMN1', 'schedule_header_id');
1107: fnd_message.set_token('COLUMN2', 'aging_bucket_id');
1108: fnd_message.set_token('COLUMN3', 'aging_bucket_line_id');
1109: fnd_msg_pub.add;
1110: x_return_status := fnd_api.g_ret_sts_error;
1103: arp_standard.debug(' A Record in ar_charge_schedule_lines exists with '||
1104: ' schedule_header_id - aging_bucket_id - aging_bucket_line_id');
1105: fnd_message.set_name('AR', 'AR_API_REC_COMB_EXISTS');
1106: fnd_message.set_token('COLUMN1', 'schedule_header_id');
1107: fnd_message.set_token('COLUMN2', 'aging_bucket_id');
1108: fnd_message.set_token('COLUMN3', 'aging_bucket_line_id');
1109: fnd_msg_pub.add;
1110: x_return_status := fnd_api.g_ret_sts_error;
1111: END IF;
1104: ' schedule_header_id - aging_bucket_id - aging_bucket_line_id');
1105: fnd_message.set_name('AR', 'AR_API_REC_COMB_EXISTS');
1106: fnd_message.set_token('COLUMN1', 'schedule_header_id');
1107: fnd_message.set_token('COLUMN2', 'aging_bucket_id');
1108: fnd_message.set_token('COLUMN3', 'aging_bucket_line_id');
1109: fnd_msg_pub.add;
1110: x_return_status := fnd_api.g_ret_sts_error;
1111: END IF;
1112: CLOSE ar_schedule_line_u2;
1120: IF p_aging_bucket_line_id IS NULL OR p_aging_bucket_line_id = fnd_api.g_miss_num
1121: THEN
1122: IF p_aging_bucket_line_id IS NULL or p_aging_bucket_line_id = fnd_api.g_miss_num THEN
1123: arp_standard.debug(' AGING_BUCKET_LINE_ID missing');
1124: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
1125: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'AGING_BUCKET_LINE_ID' );
1126: FND_MSG_PUB.ADD;
1127: x_return_status := FND_API.G_RET_STS_ERROR;
1128: END IF;
1121: THEN
1122: IF p_aging_bucket_line_id IS NULL or p_aging_bucket_line_id = fnd_api.g_miss_num THEN
1123: arp_standard.debug(' AGING_BUCKET_LINE_ID missing');
1124: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_MISSING_COLUMN' );
1125: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'AGING_BUCKET_LINE_ID' );
1126: FND_MSG_PUB.ADD;
1127: x_return_status := FND_API.G_RET_STS_ERROR;
1128: END IF;
1129: ELSE
1131: OPEN c_aging_bucket_id(p_aging_bucket_id, p_aging_bucket_line_id);
1132: FETCH c_aging_bucket_id INTO l_c;
1133: IF c_aging_bucket_id%NOTFOUND THEN
1134: arp_standard.debug(' AGING_BUCKET_ID/AGING_BUCKET_LINE_ID are not valid');
1135: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
1136: FND_MESSAGE.SET_TOKEN( 'FK', 'aging_bucket_id' );
1137: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'aging_bucket_id' );
1138: FND_MESSAGE.SET_TOKEN( 'TABLE', 'ar_aging_buckets');
1139: FND_MSG_PUB.ADD;
1132: FETCH c_aging_bucket_id INTO l_c;
1133: IF c_aging_bucket_id%NOTFOUND THEN
1134: arp_standard.debug(' AGING_BUCKET_ID/AGING_BUCKET_LINE_ID are not valid');
1135: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
1136: FND_MESSAGE.SET_TOKEN( 'FK', 'aging_bucket_id' );
1137: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'aging_bucket_id' );
1138: FND_MESSAGE.SET_TOKEN( 'TABLE', 'ar_aging_buckets');
1139: FND_MSG_PUB.ADD;
1140: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
1133: IF c_aging_bucket_id%NOTFOUND THEN
1134: arp_standard.debug(' AGING_BUCKET_ID/AGING_BUCKET_LINE_ID are not valid');
1135: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
1136: FND_MESSAGE.SET_TOKEN( 'FK', 'aging_bucket_id' );
1137: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'aging_bucket_id' );
1138: FND_MESSAGE.SET_TOKEN( 'TABLE', 'ar_aging_buckets');
1139: FND_MSG_PUB.ADD;
1140: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
1141: FND_MESSAGE.SET_TOKEN( 'FK', 'aging_bucket_line_id' );
1134: arp_standard.debug(' AGING_BUCKET_ID/AGING_BUCKET_LINE_ID are not valid');
1135: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
1136: FND_MESSAGE.SET_TOKEN( 'FK', 'aging_bucket_id' );
1137: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'aging_bucket_id' );
1138: FND_MESSAGE.SET_TOKEN( 'TABLE', 'ar_aging_buckets');
1139: FND_MSG_PUB.ADD;
1140: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
1141: FND_MESSAGE.SET_TOKEN( 'FK', 'aging_bucket_line_id' );
1142: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'aging_bucket_line_id' );
1136: FND_MESSAGE.SET_TOKEN( 'FK', 'aging_bucket_id' );
1137: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'aging_bucket_id' );
1138: FND_MESSAGE.SET_TOKEN( 'TABLE', 'ar_aging_buckets');
1139: FND_MSG_PUB.ADD;
1140: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
1141: FND_MESSAGE.SET_TOKEN( 'FK', 'aging_bucket_line_id' );
1142: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'aging_bucket_line_id' );
1143: FND_MESSAGE.SET_TOKEN( 'TABLE', 'ar_aging_bucket_lines_b');
1144: FND_MSG_PUB.ADD;
1137: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'aging_bucket_id' );
1138: FND_MESSAGE.SET_TOKEN( 'TABLE', 'ar_aging_buckets');
1139: FND_MSG_PUB.ADD;
1140: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
1141: FND_MESSAGE.SET_TOKEN( 'FK', 'aging_bucket_line_id' );
1142: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'aging_bucket_line_id' );
1143: FND_MESSAGE.SET_TOKEN( 'TABLE', 'ar_aging_bucket_lines_b');
1144: FND_MSG_PUB.ADD;
1145: x_return_status := FND_API.G_RET_STS_ERROR;
1138: FND_MESSAGE.SET_TOKEN( 'TABLE', 'ar_aging_buckets');
1139: FND_MSG_PUB.ADD;
1140: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
1141: FND_MESSAGE.SET_TOKEN( 'FK', 'aging_bucket_line_id' );
1142: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'aging_bucket_line_id' );
1143: FND_MESSAGE.SET_TOKEN( 'TABLE', 'ar_aging_bucket_lines_b');
1144: FND_MSG_PUB.ADD;
1145: x_return_status := FND_API.G_RET_STS_ERROR;
1146: END IF;
1139: FND_MSG_PUB.ADD;
1140: FND_MESSAGE.SET_NAME( 'AR', 'HZ_API_INVALID_FK' );
1141: FND_MESSAGE.SET_TOKEN( 'FK', 'aging_bucket_line_id' );
1142: FND_MESSAGE.SET_TOKEN( 'COLUMN', 'aging_bucket_line_id' );
1143: FND_MESSAGE.SET_TOKEN( 'TABLE', 'ar_aging_bucket_lines_b');
1144: FND_MSG_PUB.ADD;
1145: x_return_status := FND_API.G_RET_STS_ERROR;
1146: END IF;
1147: CLOSE c_aging_bucket_id;
1163: IF (p_amount IS NULL OR p_amount = FND_API.G_MISS_NUM) AND
1164: (l_c = 'AMOUNT')
1165: THEN
1166: arp_standard.debug(' The amount column is mandatory for SCHEDULE_HEADER_TYPE :'||l_c);
1167: fnd_message.set_name('AR', 'HZ_API_MISSING_COLUMN');
1168: fnd_message.set_token('COLUMN', 'AMOUNT');
1169: FND_MSG_PUB.ADD;
1170: x_return_status := FND_API.G_RET_STS_ERROR;
1171: END IF;
1164: (l_c = 'AMOUNT')
1165: THEN
1166: arp_standard.debug(' The amount column is mandatory for SCHEDULE_HEADER_TYPE :'||l_c);
1167: fnd_message.set_name('AR', 'HZ_API_MISSING_COLUMN');
1168: fnd_message.set_token('COLUMN', 'AMOUNT');
1169: FND_MSG_PUB.ADD;
1170: x_return_status := FND_API.G_RET_STS_ERROR;
1171: END IF;
1172:
1173: IF (p_rate IS NULL OR p_rate = FND_API.G_MISS_NUM) AND
1174: (l_c = 'PERCENTAGE')
1175: THEN
1176: arp_standard.debug(' The rate column is mandatory for SCHEDULE_HEADER_TYPE:'||l_c);
1177: fnd_message.set_name('AR', 'HZ_API_MISSING_COLUMN');
1178: fnd_message.set_token('COLUMN', 'RATE');
1179: fnd_msg_pub.add;
1180: FND_MSG_PUB.ADD;
1181: x_return_status := FND_API.G_RET_STS_ERROR;
1174: (l_c = 'PERCENTAGE')
1175: THEN
1176: arp_standard.debug(' The rate column is mandatory for SCHEDULE_HEADER_TYPE:'||l_c);
1177: fnd_message.set_name('AR', 'HZ_API_MISSING_COLUMN');
1178: fnd_message.set_token('COLUMN', 'RATE');
1179: fnd_msg_pub.add;
1180: FND_MSG_PUB.ADD;
1181: x_return_status := FND_API.G_RET_STS_ERROR;
1182: END IF;
1294:
1295: WHEN OTHERS THEN
1296: ROLLBACK TO create_schedule;
1297: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1298: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
1299: FND_MESSAGE.SET_TOKEN('ERROR' ,l_n||' '||SQLERRM);
1300: FND_MSG_PUB.ADD;
1301: FND_MSG_PUB.Count_And_Get(
1302: p_encoded => FND_API.G_FALSE,
1295: WHEN OTHERS THEN
1296: ROLLBACK TO create_schedule;
1297: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1298: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
1299: FND_MESSAGE.SET_TOKEN('ERROR' ,l_n||' '||SQLERRM);
1300: FND_MSG_PUB.ADD;
1301: FND_MSG_PUB.Count_And_Get(
1302: p_encoded => FND_API.G_FALSE,
1303: p_count => x_msg_count,
1393: l_rec.OBJECT_VERSION_NUMBER;
1394: CLOSE c;
1395:
1396: IF l_rec.SCHEDULE_ID IS NULL THEN
1397: fnd_message.set_name('AR', 'HZ_API_NO_RECORD');
1398: fnd_message.set_token('RECORD', 'ar_charge_schedules');
1399: fnd_message.set_token('VALUE',
1400: NVL(TO_CHAR(P_SCHEDULE_ID), 'null'));
1401: fnd_msg_pub.add;
1394: CLOSE c;
1395:
1396: IF l_rec.SCHEDULE_ID IS NULL THEN
1397: fnd_message.set_name('AR', 'HZ_API_NO_RECORD');
1398: fnd_message.set_token('RECORD', 'ar_charge_schedules');
1399: fnd_message.set_token('VALUE',
1400: NVL(TO_CHAR(P_SCHEDULE_ID), 'null'));
1401: fnd_msg_pub.add;
1402: RAISE fnd_api.g_exc_error;
1395:
1396: IF l_rec.SCHEDULE_ID IS NULL THEN
1397: fnd_message.set_name('AR', 'HZ_API_NO_RECORD');
1398: fnd_message.set_token('RECORD', 'ar_charge_schedules');
1399: fnd_message.set_token('VALUE',
1400: NVL(TO_CHAR(P_SCHEDULE_ID), 'null'));
1401: fnd_msg_pub.add;
1402: RAISE fnd_api.g_exc_error;
1403: END IF;
1408: (x_object_version_number IS NOT NULL AND
1409: l_rec.OBJECT_VERSION_NUMBER IS NOT NULL AND
1410: x_object_version_number = l_rec.OBJECT_VERSION_NUMBER))
1411: THEN
1412: fnd_message.set_name('AR', 'HZ_API_RECORD_CHANGED');
1413: fnd_message.set_token('TABLE', 'ar_charge_schedules');
1414: fnd_msg_pub.add;
1415: RAISE fnd_api.g_exc_error;
1416: END IF;
1409: l_rec.OBJECT_VERSION_NUMBER IS NOT NULL AND
1410: x_object_version_number = l_rec.OBJECT_VERSION_NUMBER))
1411: THEN
1412: fnd_message.set_name('AR', 'HZ_API_RECORD_CHANGED');
1413: fnd_message.set_token('TABLE', 'ar_charge_schedules');
1414: fnd_msg_pub.add;
1415: RAISE fnd_api.g_exc_error;
1416: END IF;
1417:
1465:
1466: WHEN OTHERS THEN
1467: ROLLBACK TO Update_schedule;
1468: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1469: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
1470: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
1471: FND_MSG_PUB.ADD;
1472: FND_MSG_PUB.Count_And_Get(
1473: p_encoded => FND_API.G_FALSE,
1466: WHEN OTHERS THEN
1467: ROLLBACK TO Update_schedule;
1468: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1469: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
1470: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
1471: FND_MSG_PUB.ADD;
1472: FND_MSG_PUB.Count_And_Get(
1473: p_encoded => FND_API.G_FALSE,
1474: p_count => x_msg_count,
1598:
1599: WHEN OTHERS THEN
1600: ROLLBACK TO create_schedule_header;
1601: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1602: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
1603: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
1604: FND_MSG_PUB.ADD;
1605: FND_MSG_PUB.Count_And_Get(
1606: p_encoded => FND_API.G_FALSE,
1599: WHEN OTHERS THEN
1600: ROLLBACK TO create_schedule_header;
1601: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1602: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
1603: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
1604: FND_MSG_PUB.ADD;
1605: FND_MSG_PUB.Count_And_Get(
1606: p_encoded => FND_API.G_FALSE,
1607: p_count => x_msg_count,
1708: l_rec.status;
1709: CLOSE c;
1710:
1711: IF l_rec.SCHEDULE_HEADER_ID IS NULL THEN
1712: fnd_message.set_name('AR', 'HZ_API_NO_RECORD');
1713: fnd_message.set_token('RECORD', 'ar_charge_schedule_hdrs');
1714: fnd_message.set_token('VALUE',
1715: NVL(TO_CHAR(P_SCHEDULE_HEADER_ID), 'null'));
1716: fnd_msg_pub.add;
1709: CLOSE c;
1710:
1711: IF l_rec.SCHEDULE_HEADER_ID IS NULL THEN
1712: fnd_message.set_name('AR', 'HZ_API_NO_RECORD');
1713: fnd_message.set_token('RECORD', 'ar_charge_schedule_hdrs');
1714: fnd_message.set_token('VALUE',
1715: NVL(TO_CHAR(P_SCHEDULE_HEADER_ID), 'null'));
1716: fnd_msg_pub.add;
1717: RAISE fnd_api.g_exc_error;
1710:
1711: IF l_rec.SCHEDULE_HEADER_ID IS NULL THEN
1712: fnd_message.set_name('AR', 'HZ_API_NO_RECORD');
1713: fnd_message.set_token('RECORD', 'ar_charge_schedule_hdrs');
1714: fnd_message.set_token('VALUE',
1715: NVL(TO_CHAR(P_SCHEDULE_HEADER_ID), 'null'));
1716: fnd_msg_pub.add;
1717: RAISE fnd_api.g_exc_error;
1718: END IF;
1723: (x_object_version_number IS NOT NULL AND
1724: l_rec.OBJECT_VERSION_NUMBER IS NOT NULL AND
1725: x_object_version_number = l_rec.OBJECT_VERSION_NUMBER))
1726: THEN
1727: fnd_message.set_name('AR', 'HZ_API_RECORD_CHANGED');
1728: fnd_message.set_token('TABLE', 'ar_charge_schedule_hdrs');
1729: fnd_msg_pub.add;
1730: RAISE fnd_api.g_exc_error;
1731: END IF;
1724: l_rec.OBJECT_VERSION_NUMBER IS NOT NULL AND
1725: x_object_version_number = l_rec.OBJECT_VERSION_NUMBER))
1726: THEN
1727: fnd_message.set_name('AR', 'HZ_API_RECORD_CHANGED');
1728: fnd_message.set_token('TABLE', 'ar_charge_schedule_hdrs');
1729: fnd_msg_pub.add;
1730: RAISE fnd_api.g_exc_error;
1731: END IF;
1732:
1788:
1789: WHEN OTHERS THEN
1790: ROLLBACK TO Update_schedule_header;
1791: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1792: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
1793: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
1794: FND_MSG_PUB.ADD;
1795: FND_MSG_PUB.Count_And_Get(
1796: p_encoded => FND_API.G_FALSE,
1789: WHEN OTHERS THEN
1790: ROLLBACK TO Update_schedule_header;
1791: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1792: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
1793: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
1794: FND_MSG_PUB.ADD;
1795: FND_MSG_PUB.Count_And_Get(
1796: p_encoded => FND_API.G_FALSE,
1797: p_count => x_msg_count,
1919:
1920: WHEN OTHERS THEN
1921: ROLLBACK TO create_schedule_line;
1922: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1923: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
1924: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
1925: FND_MSG_PUB.ADD;
1926: FND_MSG_PUB.Count_And_Get(
1927: p_encoded => FND_API.G_FALSE,
1920: WHEN OTHERS THEN
1921: ROLLBACK TO create_schedule_line;
1922: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1923: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
1924: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
1925: FND_MSG_PUB.ADD;
1926: FND_MSG_PUB.Count_And_Get(
1927: p_encoded => FND_API.G_FALSE,
1928: p_count => x_msg_count,
2025: l_rec.OBJECT_VERSION_NUMBER;
2026: CLOSE c;
2027:
2028: IF l_rec.SCHEDULE_line_ID IS NULL THEN
2029: fnd_message.set_name('AR', 'HZ_API_NO_RECORD');
2030: fnd_message.set_token('RECORD', 'ar_charge_schedule_lines');
2031: fnd_message.set_token('VALUE',
2032: NVL(TO_CHAR(P_SCHEDULE_line_ID), 'null'));
2033: fnd_msg_pub.add;
2026: CLOSE c;
2027:
2028: IF l_rec.SCHEDULE_line_ID IS NULL THEN
2029: fnd_message.set_name('AR', 'HZ_API_NO_RECORD');
2030: fnd_message.set_token('RECORD', 'ar_charge_schedule_lines');
2031: fnd_message.set_token('VALUE',
2032: NVL(TO_CHAR(P_SCHEDULE_line_ID), 'null'));
2033: fnd_msg_pub.add;
2034: RAISE fnd_api.g_exc_error;
2027:
2028: IF l_rec.SCHEDULE_line_ID IS NULL THEN
2029: fnd_message.set_name('AR', 'HZ_API_NO_RECORD');
2030: fnd_message.set_token('RECORD', 'ar_charge_schedule_lines');
2031: fnd_message.set_token('VALUE',
2032: NVL(TO_CHAR(P_SCHEDULE_line_ID), 'null'));
2033: fnd_msg_pub.add;
2034: RAISE fnd_api.g_exc_error;
2035: END IF;
2040: (x_object_version_number IS NOT NULL AND
2041: l_rec.OBJECT_VERSION_NUMBER IS NOT NULL AND
2042: x_object_version_number = l_rec.OBJECT_VERSION_NUMBER))
2043: THEN
2044: fnd_message.set_name('AR', 'HZ_API_RECORD_CHANGED');
2045: fnd_message.set_token('TABLE', 'ar_charge_schedule_lines');
2046: fnd_msg_pub.add;
2047: RAISE fnd_api.g_exc_error;
2048: END IF;
2041: l_rec.OBJECT_VERSION_NUMBER IS NOT NULL AND
2042: x_object_version_number = l_rec.OBJECT_VERSION_NUMBER))
2043: THEN
2044: fnd_message.set_name('AR', 'HZ_API_RECORD_CHANGED');
2045: fnd_message.set_token('TABLE', 'ar_charge_schedule_lines');
2046: fnd_msg_pub.add;
2047: RAISE fnd_api.g_exc_error;
2048: END IF;
2049:
2104:
2105: WHEN OTHERS THEN
2106: ROLLBACK TO Update_schedule_header;
2107: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2108: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
2109: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
2110: FND_MSG_PUB.ADD;
2111: FND_MSG_PUB.Count_And_Get(
2112: p_encoded => FND_API.G_FALSE,
2105: WHEN OTHERS THEN
2106: ROLLBACK TO Update_schedule_header;
2107: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2108: FND_MESSAGE.SET_NAME('AR', 'HZ_API_OTHERS_EXCEP');
2109: FND_MESSAGE.SET_TOKEN('ERROR' ,SQLERRM);
2110: FND_MSG_PUB.ADD;
2111: FND_MSG_PUB.Count_And_Get(
2112: p_encoded => FND_API.G_FALSE,
2113: p_count => x_msg_count,