499: /* Record does not exist in jg_zz_vat_rep_status for the given combination */
500:
501: /* Validation#1 : Only selection process can initiate the entire processing, for other processes selection should have run */
502: if pv_process_name <> 'SELECTION' then
503: fnd_message.set_name('JG', 'JG_ZZ_VAT_NO_SELECTION');
504: fnd_message.set_token('SOURCE', lv_source);
505: fnd_message.set_token('PROCESS_NAME', pv_process_name);
506: xv_return_message := fnd_message.get;
507: xv_return_status := fnd_api.g_ret_sts_error;
500:
501: /* Validation#1 : Only selection process can initiate the entire processing, for other processes selection should have run */
502: if pv_process_name <> 'SELECTION' then
503: fnd_message.set_name('JG', 'JG_ZZ_VAT_NO_SELECTION');
504: fnd_message.set_token('SOURCE', lv_source);
505: fnd_message.set_token('PROCESS_NAME', pv_process_name);
506: xv_return_message := fnd_message.get;
507: xv_return_status := fnd_api.g_ret_sts_error;
508: goto error_exit_from_procedure;
501: /* Validation#1 : Only selection process can initiate the entire processing, for other processes selection should have run */
502: if pv_process_name <> 'SELECTION' then
503: fnd_message.set_name('JG', 'JG_ZZ_VAT_NO_SELECTION');
504: fnd_message.set_token('SOURCE', lv_source);
505: fnd_message.set_token('PROCESS_NAME', pv_process_name);
506: xv_return_message := fnd_message.get;
507: xv_return_status := fnd_api.g_ret_sts_error;
508: goto error_exit_from_procedure;
509: end if;
502: if pv_process_name <> 'SELECTION' then
503: fnd_message.set_name('JG', 'JG_ZZ_VAT_NO_SELECTION');
504: fnd_message.set_token('SOURCE', lv_source);
505: fnd_message.set_token('PROCESS_NAME', pv_process_name);
506: xv_return_message := fnd_message.get;
507: xv_return_status := fnd_api.g_ret_sts_error;
508: goto error_exit_from_procedure;
509: end if;
510:
567: /* Record exists in jg_zz_vat_rep_status for the given combination */
568:
569: /* Validation # 2: Common validation - Final reporting should not have happened */
570: if cur_rec_jg_zz_vat_rep_status.final_reporting_status_flag = fnd_api.g_ret_sts_success then
571: fnd_message.set_name('JG', 'JG_ZZ_VAT_FINALLY_REPORTED');
572: fnd_message.set_token('SOURCE', lv_source);
573: fnd_message.set_token('PROCESS_NAME', pv_process_name);
574: xv_return_message := fnd_message.get;
575: xv_return_status := fnd_api.g_ret_sts_error;
568:
569: /* Validation # 2: Common validation - Final reporting should not have happened */
570: if cur_rec_jg_zz_vat_rep_status.final_reporting_status_flag = fnd_api.g_ret_sts_success then
571: fnd_message.set_name('JG', 'JG_ZZ_VAT_FINALLY_REPORTED');
572: fnd_message.set_token('SOURCE', lv_source);
573: fnd_message.set_token('PROCESS_NAME', pv_process_name);
574: xv_return_message := fnd_message.get;
575: xv_return_status := fnd_api.g_ret_sts_error;
576: goto error_exit_from_procedure;
569: /* Validation # 2: Common validation - Final reporting should not have happened */
570: if cur_rec_jg_zz_vat_rep_status.final_reporting_status_flag = fnd_api.g_ret_sts_success then
571: fnd_message.set_name('JG', 'JG_ZZ_VAT_FINALLY_REPORTED');
572: fnd_message.set_token('SOURCE', lv_source);
573: fnd_message.set_token('PROCESS_NAME', pv_process_name);
574: xv_return_message := fnd_message.get;
575: xv_return_status := fnd_api.g_ret_sts_error;
576: goto error_exit_from_procedure;
577: end if;
570: if cur_rec_jg_zz_vat_rep_status.final_reporting_status_flag = fnd_api.g_ret_sts_success then
571: fnd_message.set_name('JG', 'JG_ZZ_VAT_FINALLY_REPORTED');
572: fnd_message.set_token('SOURCE', lv_source);
573: fnd_message.set_token('PROCESS_NAME', pv_process_name);
574: xv_return_message := fnd_message.get;
575: xv_return_status := fnd_api.g_ret_sts_error;
576: goto error_exit_from_procedure;
577: end if;
578:
611: x_return_status => xv_return_status
612: );
613:
614: if xv_return_status <> fnd_api.g_ret_sts_success then
615: fnd_message.set_name('JG', 'JG_ZZ_VAT_GENERIC_ERROR');
616: fnd_message.set_token('PROCESS_DETAILS', ' during purge of previous selection data');
617: xv_return_message := fnd_message.get;
618: goto error_exit_from_procedure;
619: end if;
612: );
613:
614: if xv_return_status <> fnd_api.g_ret_sts_success then
615: fnd_message.set_name('JG', 'JG_ZZ_VAT_GENERIC_ERROR');
616: fnd_message.set_token('PROCESS_DETAILS', ' during purge of previous selection data');
617: xv_return_message := fnd_message.get;
618: goto error_exit_from_procedure;
619: end if;
620:
613:
614: if xv_return_status <> fnd_api.g_ret_sts_success then
615: fnd_message.set_name('JG', 'JG_ZZ_VAT_GENERIC_ERROR');
616: fnd_message.set_token('PROCESS_DETAILS', ' during purge of previous selection data');
617: xv_return_message := fnd_message.get;
618: goto error_exit_from_procedure;
619: end if;
620:
621: elsif pv_process_name = 'ALLOCATION' then
621: elsif pv_process_name = 'ALLOCATION' then
622:
623: /* Check if selection has already happened successfully */
624: if cur_rec_jg_zz_vat_rep_status.selection_status_flag <> fnd_api.g_ret_sts_success then
625: fnd_message.set_name('JG', 'JG_ZZ_VAT_ERROR_SELECTION');
626: fnd_message.set_token('SOURCE', lv_source);
627: fnd_message.set_token('PROCESS_NAME', pv_process_name);
628: xv_return_message := fnd_message.get;
629: xv_return_status := fnd_api.g_ret_sts_error;
622:
623: /* Check if selection has already happened successfully */
624: if cur_rec_jg_zz_vat_rep_status.selection_status_flag <> fnd_api.g_ret_sts_success then
625: fnd_message.set_name('JG', 'JG_ZZ_VAT_ERROR_SELECTION');
626: fnd_message.set_token('SOURCE', lv_source);
627: fnd_message.set_token('PROCESS_NAME', pv_process_name);
628: xv_return_message := fnd_message.get;
629: xv_return_status := fnd_api.g_ret_sts_error;
630: goto error_exit_from_procedure;
623: /* Check if selection has already happened successfully */
624: if cur_rec_jg_zz_vat_rep_status.selection_status_flag <> fnd_api.g_ret_sts_success then
625: fnd_message.set_name('JG', 'JG_ZZ_VAT_ERROR_SELECTION');
626: fnd_message.set_token('SOURCE', lv_source);
627: fnd_message.set_token('PROCESS_NAME', pv_process_name);
628: xv_return_message := fnd_message.get;
629: xv_return_status := fnd_api.g_ret_sts_error;
630: goto error_exit_from_procedure;
631: end if;
624: if cur_rec_jg_zz_vat_rep_status.selection_status_flag <> fnd_api.g_ret_sts_success then
625: fnd_message.set_name('JG', 'JG_ZZ_VAT_ERROR_SELECTION');
626: fnd_message.set_token('SOURCE', lv_source);
627: fnd_message.set_token('PROCESS_NAME', pv_process_name);
628: xv_return_message := fnd_message.get;
629: xv_return_status := fnd_api.g_ret_sts_error;
630: goto error_exit_from_procedure;
631: end if;
632:
672: elsif pv_process_name = 'FINAL REPORTING' then
673:
674: /* Check if selection has already happened successfully */
675: if cur_rec_jg_zz_vat_rep_status.selection_status_flag <> fnd_api.g_ret_sts_success then
676: fnd_message.set_name('JG', 'JG_ZZ_VAT_ERROR_SELECTION');
677: fnd_message.set_token('SOURCE', lv_source);
678: fnd_message.set_token('PROCESS_NAME', pv_process_name);
679: xv_return_message := fnd_message.get;
680: xv_return_status := fnd_api.g_ret_sts_error;
673:
674: /* Check if selection has already happened successfully */
675: if cur_rec_jg_zz_vat_rep_status.selection_status_flag <> fnd_api.g_ret_sts_success then
676: fnd_message.set_name('JG', 'JG_ZZ_VAT_ERROR_SELECTION');
677: fnd_message.set_token('SOURCE', lv_source);
678: fnd_message.set_token('PROCESS_NAME', pv_process_name);
679: xv_return_message := fnd_message.get;
680: xv_return_status := fnd_api.g_ret_sts_error;
681: goto error_exit_from_procedure;
674: /* Check if selection has already happened successfully */
675: if cur_rec_jg_zz_vat_rep_status.selection_status_flag <> fnd_api.g_ret_sts_success then
676: fnd_message.set_name('JG', 'JG_ZZ_VAT_ERROR_SELECTION');
677: fnd_message.set_token('SOURCE', lv_source);
678: fnd_message.set_token('PROCESS_NAME', pv_process_name);
679: xv_return_message := fnd_message.get;
680: xv_return_status := fnd_api.g_ret_sts_error;
681: goto error_exit_from_procedure;
682: end if;
675: if cur_rec_jg_zz_vat_rep_status.selection_status_flag <> fnd_api.g_ret_sts_success then
676: fnd_message.set_name('JG', 'JG_ZZ_VAT_ERROR_SELECTION');
677: fnd_message.set_token('SOURCE', lv_source);
678: fnd_message.set_token('PROCESS_NAME', pv_process_name);
679: xv_return_message := fnd_message.get;
680: xv_return_status := fnd_api.g_ret_sts_error;
681: goto error_exit_from_procedure;
682: end if;
683:
684: if cur_rec_jg_zz_vat_rep_status.allocation_status_flag = 'N' then
685:
686: /* Allocation has not happened, check if it is applicable */
687: if cur_rec_jg_zz_vat_rep_entities.enable_allocations_flag = 'Y' then
688: fnd_message.set_name('JG', 'JG_ZZ_VAT_NO_ALLOCATION');
689: fnd_message.set_token('SOURCE', lv_source);
690: fnd_message.set_token('PROCESS_NAME', pv_process_name);
691: xv_return_message := fnd_message.get;
692: xv_return_status := fnd_api.g_ret_sts_error;
685:
686: /* Allocation has not happened, check if it is applicable */
687: if cur_rec_jg_zz_vat_rep_entities.enable_allocations_flag = 'Y' then
688: fnd_message.set_name('JG', 'JG_ZZ_VAT_NO_ALLOCATION');
689: fnd_message.set_token('SOURCE', lv_source);
690: fnd_message.set_token('PROCESS_NAME', pv_process_name);
691: xv_return_message := fnd_message.get;
692: xv_return_status := fnd_api.g_ret_sts_error;
693: goto error_exit_from_procedure;
686: /* Allocation has not happened, check if it is applicable */
687: if cur_rec_jg_zz_vat_rep_entities.enable_allocations_flag = 'Y' then
688: fnd_message.set_name('JG', 'JG_ZZ_VAT_NO_ALLOCATION');
689: fnd_message.set_token('SOURCE', lv_source);
690: fnd_message.set_token('PROCESS_NAME', pv_process_name);
691: xv_return_message := fnd_message.get;
692: xv_return_status := fnd_api.g_ret_sts_error;
693: goto error_exit_from_procedure;
694: end if;
687: if cur_rec_jg_zz_vat_rep_entities.enable_allocations_flag = 'Y' then
688: fnd_message.set_name('JG', 'JG_ZZ_VAT_NO_ALLOCATION');
689: fnd_message.set_token('SOURCE', lv_source);
690: fnd_message.set_token('PROCESS_NAME', pv_process_name);
691: xv_return_message := fnd_message.get;
692: xv_return_status := fnd_api.g_ret_sts_error;
693: goto error_exit_from_procedure;
694: end if;
695:
694: end if;
695:
696: elsif cur_rec_jg_zz_vat_rep_status.allocation_status_flag <> fnd_api.g_ret_sts_success then
697:
698: fnd_message.set_name('JG', 'JG_ZZ_VAT_ERROR_ALLOCATION');
699: fnd_message.set_token('SOURCE', lv_source);
700: fnd_message.set_token('PROCESS_NAME', pv_process_name);
701: xv_return_message := fnd_message.get;
702: xv_return_status := fnd_api.g_ret_sts_error;
695:
696: elsif cur_rec_jg_zz_vat_rep_status.allocation_status_flag <> fnd_api.g_ret_sts_success then
697:
698: fnd_message.set_name('JG', 'JG_ZZ_VAT_ERROR_ALLOCATION');
699: fnd_message.set_token('SOURCE', lv_source);
700: fnd_message.set_token('PROCESS_NAME', pv_process_name);
701: xv_return_message := fnd_message.get;
702: xv_return_status := fnd_api.g_ret_sts_error;
703: goto error_exit_from_procedure;
696: elsif cur_rec_jg_zz_vat_rep_status.allocation_status_flag <> fnd_api.g_ret_sts_success then
697:
698: fnd_message.set_name('JG', 'JG_ZZ_VAT_ERROR_ALLOCATION');
699: fnd_message.set_token('SOURCE', lv_source);
700: fnd_message.set_token('PROCESS_NAME', pv_process_name);
701: xv_return_message := fnd_message.get;
702: xv_return_status := fnd_api.g_ret_sts_error;
703: goto error_exit_from_procedure;
704:
697:
698: fnd_message.set_name('JG', 'JG_ZZ_VAT_ERROR_ALLOCATION');
699: fnd_message.set_token('SOURCE', lv_source);
700: fnd_message.set_token('PROCESS_NAME', pv_process_name);
701: xv_return_message := fnd_message.get;
702: xv_return_status := fnd_api.g_ret_sts_error;
703: goto error_exit_from_procedure;
704:
705: end if; /* Has allocation happend successfully or is it enabled but not happened */
1064:
1065: if pn_vat_reporting_entity_id is null then
1066: /* This parameter is required for entities of all level*/
1067: xv_return_status := fnd_api.g_ret_sts_error;
1068: fnd_message.set_name('JG', 'JG_ZZ_VAT_INVALID_ENTITY');
1069: fnd_message.set_token('PARAMETER', 'TRN');
1070: fnd_message.set_token('LEVEL', 'pv_entity_level_code');
1071: xv_return_message := fnd_message.get;
1072: xv_return_status := fnd_api.g_ret_sts_error;
1065: if pn_vat_reporting_entity_id is null then
1066: /* This parameter is required for entities of all level*/
1067: xv_return_status := fnd_api.g_ret_sts_error;
1068: fnd_message.set_name('JG', 'JG_ZZ_VAT_INVALID_ENTITY');
1069: fnd_message.set_token('PARAMETER', 'TRN');
1070: fnd_message.set_token('LEVEL', 'pv_entity_level_code');
1071: xv_return_message := fnd_message.get;
1072: xv_return_status := fnd_api.g_ret_sts_error;
1073: goto exit_from_procedure;
1066: /* This parameter is required for entities of all level*/
1067: xv_return_status := fnd_api.g_ret_sts_error;
1068: fnd_message.set_name('JG', 'JG_ZZ_VAT_INVALID_ENTITY');
1069: fnd_message.set_token('PARAMETER', 'TRN');
1070: fnd_message.set_token('LEVEL', 'pv_entity_level_code');
1071: xv_return_message := fnd_message.get;
1072: xv_return_status := fnd_api.g_ret_sts_error;
1073: goto exit_from_procedure;
1074: end if;
1067: xv_return_status := fnd_api.g_ret_sts_error;
1068: fnd_message.set_name('JG', 'JG_ZZ_VAT_INVALID_ENTITY');
1069: fnd_message.set_token('PARAMETER', 'TRN');
1070: fnd_message.set_token('LEVEL', 'pv_entity_level_code');
1071: xv_return_message := fnd_message.get;
1072: xv_return_status := fnd_api.g_ret_sts_error;
1073: goto exit_from_procedure;
1074: end if;
1075:
1076: if pv_entity_level_code = 'LEDGER' then
1077:
1078: if pn_ledger_id is null then /* Required parameter */
1079: xv_return_status := fnd_api.g_ret_sts_error;
1080: fnd_message.set_name('JG', 'JG_ZZ_VAT_INVALID_ENTITY');
1081: fnd_message.set_token('PARAMETER', 'LEDGER');
1082: fnd_message.set_token('LEVEL', 'pv_entity_level_code');
1083: xv_return_message := fnd_message.get;
1084: goto exit_from_procedure;
1077:
1078: if pn_ledger_id is null then /* Required parameter */
1079: xv_return_status := fnd_api.g_ret_sts_error;
1080: fnd_message.set_name('JG', 'JG_ZZ_VAT_INVALID_ENTITY');
1081: fnd_message.set_token('PARAMETER', 'LEDGER');
1082: fnd_message.set_token('LEVEL', 'pv_entity_level_code');
1083: xv_return_message := fnd_message.get;
1084: goto exit_from_procedure;
1085: end if;
1078: if pn_ledger_id is null then /* Required parameter */
1079: xv_return_status := fnd_api.g_ret_sts_error;
1080: fnd_message.set_name('JG', 'JG_ZZ_VAT_INVALID_ENTITY');
1081: fnd_message.set_token('PARAMETER', 'LEDGER');
1082: fnd_message.set_token('LEVEL', 'pv_entity_level_code');
1083: xv_return_message := fnd_message.get;
1084: goto exit_from_procedure;
1085: end if;
1086:
1079: xv_return_status := fnd_api.g_ret_sts_error;
1080: fnd_message.set_name('JG', 'JG_ZZ_VAT_INVALID_ENTITY');
1081: fnd_message.set_token('PARAMETER', 'LEDGER');
1082: fnd_message.set_token('LEVEL', 'pv_entity_level_code');
1083: xv_return_message := fnd_message.get;
1084: goto exit_from_procedure;
1085: end if;
1086:
1087: end if;
1090: if pv_entity_level_code = 'BSV' then
1091:
1092: if pn_ledger_id is null then /* Required parameter */
1093: xv_return_status := fnd_api.g_ret_sts_error;
1094: fnd_message.set_name('JG', 'JG_ZZ_VAT_INVALID_ENTITY');
1095: fnd_message.set_token('PARAMETER', 'LEDGER');
1096: fnd_message.set_token('LEVEL', 'pv_entity_level_code');
1097: xv_return_message := fnd_message.get;
1098: goto exit_from_procedure;
1091:
1092: if pn_ledger_id is null then /* Required parameter */
1093: xv_return_status := fnd_api.g_ret_sts_error;
1094: fnd_message.set_name('JG', 'JG_ZZ_VAT_INVALID_ENTITY');
1095: fnd_message.set_token('PARAMETER', 'LEDGER');
1096: fnd_message.set_token('LEVEL', 'pv_entity_level_code');
1097: xv_return_message := fnd_message.get;
1098: goto exit_from_procedure;
1099: end if;
1092: if pn_ledger_id is null then /* Required parameter */
1093: xv_return_status := fnd_api.g_ret_sts_error;
1094: fnd_message.set_name('JG', 'JG_ZZ_VAT_INVALID_ENTITY');
1095: fnd_message.set_token('PARAMETER', 'LEDGER');
1096: fnd_message.set_token('LEVEL', 'pv_entity_level_code');
1097: xv_return_message := fnd_message.get;
1098: goto exit_from_procedure;
1099: end if;
1100:
1093: xv_return_status := fnd_api.g_ret_sts_error;
1094: fnd_message.set_name('JG', 'JG_ZZ_VAT_INVALID_ENTITY');
1095: fnd_message.set_token('PARAMETER', 'LEDGER');
1096: fnd_message.set_token('LEVEL', 'pv_entity_level_code');
1097: xv_return_message := fnd_message.get;
1098: goto exit_from_procedure;
1099: end if;
1100:
1101: if pv_balancing_segment_value is null then
1099: end if;
1100:
1101: if pv_balancing_segment_value is null then
1102: xv_return_status := fnd_api.g_ret_sts_error;
1103: fnd_message.set_name('JG', 'JG_ZZ_VAT_INVALID_ENTITY');
1104: fnd_message.set_token('PARAMETER', 'BSV');
1105: fnd_message.set_token('LEVEL', 'pv_entity_level_code');
1106: xv_return_message := fnd_message.get;
1107: goto exit_from_procedure; end if;
1100:
1101: if pv_balancing_segment_value is null then
1102: xv_return_status := fnd_api.g_ret_sts_error;
1103: fnd_message.set_name('JG', 'JG_ZZ_VAT_INVALID_ENTITY');
1104: fnd_message.set_token('PARAMETER', 'BSV');
1105: fnd_message.set_token('LEVEL', 'pv_entity_level_code');
1106: xv_return_message := fnd_message.get;
1107: goto exit_from_procedure; end if;
1108:
1101: if pv_balancing_segment_value is null then
1102: xv_return_status := fnd_api.g_ret_sts_error;
1103: fnd_message.set_name('JG', 'JG_ZZ_VAT_INVALID_ENTITY');
1104: fnd_message.set_token('PARAMETER', 'BSV');
1105: fnd_message.set_token('LEVEL', 'pv_entity_level_code');
1106: xv_return_message := fnd_message.get;
1107: goto exit_from_procedure; end if;
1108:
1109: end if;
1102: xv_return_status := fnd_api.g_ret_sts_error;
1103: fnd_message.set_name('JG', 'JG_ZZ_VAT_INVALID_ENTITY');
1104: fnd_message.set_token('PARAMETER', 'BSV');
1105: fnd_message.set_token('LEVEL', 'pv_entity_level_code');
1106: xv_return_message := fnd_message.get;
1107: goto exit_from_procedure; end if;
1108:
1109: end if;
1110: