151: FETCH cur_frozen INTO l_status_code;
152: CLOSE cur_frozen;
153:
154: IF l_status_code <> 'Y' THEN
155: FND_MESSAGE.SET_NAME('JE','JE_IT_SETUP_NOT_FROZEN');
156: FND_MESSAGE.SET_TOKEN('VAT_REP',p_vat_reporting_entity_id);
157: FND_MESSAGE.SET_TOKEN('VAT_YEAR',p_year);
158: errbuf :=FND_MESSAGE.get;
159: retcode := 2; -- Error
152: CLOSE cur_frozen;
153:
154: IF l_status_code <> 'Y' THEN
155: FND_MESSAGE.SET_NAME('JE','JE_IT_SETUP_NOT_FROZEN');
156: FND_MESSAGE.SET_TOKEN('VAT_REP',p_vat_reporting_entity_id);
157: FND_MESSAGE.SET_TOKEN('VAT_YEAR',p_year);
158: errbuf :=FND_MESSAGE.get;
159: retcode := 2; -- Error
160: debug_message( 'Setup not frozen for VAT Reporting Entity'||p_vat_reporting_entity_id|| 'and declaration year '||p_year);
153:
154: IF l_status_code <> 'Y' THEN
155: FND_MESSAGE.SET_NAME('JE','JE_IT_SETUP_NOT_FROZEN');
156: FND_MESSAGE.SET_TOKEN('VAT_REP',p_vat_reporting_entity_id);
157: FND_MESSAGE.SET_TOKEN('VAT_YEAR',p_year);
158: errbuf :=FND_MESSAGE.get;
159: retcode := 2; -- Error
160: debug_message( 'Setup not frozen for VAT Reporting Entity'||p_vat_reporting_entity_id|| 'and declaration year '||p_year);
161: return;
154: IF l_status_code <> 'Y' THEN
155: FND_MESSAGE.SET_NAME('JE','JE_IT_SETUP_NOT_FROZEN');
156: FND_MESSAGE.SET_TOKEN('VAT_REP',p_vat_reporting_entity_id);
157: FND_MESSAGE.SET_TOKEN('VAT_YEAR',p_year);
158: errbuf :=FND_MESSAGE.get;
159: retcode := 2; -- Error
160: debug_message( 'Setup not frozen for VAT Reporting Entity'||p_vat_reporting_entity_id|| 'and declaration year '||p_year);
161: return;
162: END IF;
161: return;
162: END IF;
163: EXCEPTION
164: WHEN NO_DATA_FOUND THEN -- If setup not available.
165: FND_MESSAGE.SET_NAME('JE','JE_IT_SETUP_NOT_AVAILABLE');
166: FND_MESSAGE.SET_TOKEN('VAT_REP',p_vat_reporting_entity_id);
167: FND_MESSAGE.SET_TOKEN('VAT_YEAR',p_year);
168: errbuf :=FND_MESSAGE.get;
169: retcode := 2; -- Error
162: END IF;
163: EXCEPTION
164: WHEN NO_DATA_FOUND THEN -- If setup not available.
165: FND_MESSAGE.SET_NAME('JE','JE_IT_SETUP_NOT_AVAILABLE');
166: FND_MESSAGE.SET_TOKEN('VAT_REP',p_vat_reporting_entity_id);
167: FND_MESSAGE.SET_TOKEN('VAT_YEAR',p_year);
168: errbuf :=FND_MESSAGE.get;
169: retcode := 2; -- Error
170: IF g_debug_flag = 'Y' THEN
163: EXCEPTION
164: WHEN NO_DATA_FOUND THEN -- If setup not available.
165: FND_MESSAGE.SET_NAME('JE','JE_IT_SETUP_NOT_AVAILABLE');
166: FND_MESSAGE.SET_TOKEN('VAT_REP',p_vat_reporting_entity_id);
167: FND_MESSAGE.SET_TOKEN('VAT_YEAR',p_year);
168: errbuf :=FND_MESSAGE.get;
169: retcode := 2; -- Error
170: IF g_debug_flag = 'Y' THEN
171: debug_message( 'Setup doesnt exist for VAT Reporting Entity'||p_vat_reporting_entity_id|| 'and declaration year '||p_year);
164: WHEN NO_DATA_FOUND THEN -- If setup not available.
165: FND_MESSAGE.SET_NAME('JE','JE_IT_SETUP_NOT_AVAILABLE');
166: FND_MESSAGE.SET_TOKEN('VAT_REP',p_vat_reporting_entity_id);
167: FND_MESSAGE.SET_TOKEN('VAT_YEAR',p_year);
168: errbuf :=FND_MESSAGE.get;
169: retcode := 2; -- Error
170: IF g_debug_flag = 'Y' THEN
171: debug_message( 'Setup doesnt exist for VAT Reporting Entity'||p_vat_reporting_entity_id|| 'and declaration year '||p_year);
172: END IF;
203: AND type_of_upload in (0,2)
204: AND report_mode = 'F';
205:
206: IF l_count = 0 THEN
207: FND_MESSAGE.SET_NAME('JE','JE_IT_CANNOT_ISSUE_DECL1');
208: errbuf :=FND_MESSAGE.get;
209: retcode := 2; -- Error
210: debug_message( 'Original or Cancellation Declaration was not submitted in Final mode'||p_year);
211: return;
204: AND report_mode = 'F';
205:
206: IF l_count = 0 THEN
207: FND_MESSAGE.SET_NAME('JE','JE_IT_CANNOT_ISSUE_DECL1');
208: errbuf :=FND_MESSAGE.get;
209: retcode := 2; -- Error
210: debug_message( 'Original or Cancellation Declaration was not submitted in Final mode'||p_year);
211: return;
212: END IF;
221: AND type_of_upload in (0,1)
222: AND report_mode = 'F';
223:
224: IF l_count = 0 THEN
225: FND_MESSAGE.SET_NAME('JE','JE_IT_CANNOT_ISSUE_DECL2');
226: errbuf :=FND_MESSAGE.get;
227: retcode := 2; -- Error
228: debug_message( 'Original or Substitution Declaration was not submitted in Final mode'||p_year);
229: return;
222: AND report_mode = 'F';
223:
224: IF l_count = 0 THEN
225: FND_MESSAGE.SET_NAME('JE','JE_IT_CANNOT_ISSUE_DECL2');
226: errbuf :=FND_MESSAGE.get;
227: retcode := 2; -- Error
228: debug_message( 'Original or Substitution Declaration was not submitted in Final mode'||p_year);
229: return;
230: END IF;
238: FETCH cur_report_mode INTO l_status_code;
239: CLOSE cur_report_mode;
240: debug_message('earlier report mode-'||l_status_code);
241: IF l_status_code in ('F','R') THEN
242: FND_MESSAGE.SET_NAME('JE','JE_IT_FINAL_LISTING');
243: FND_MESSAGE.SET_TOKEN('VAT_REP',p_vat_reporting_entity_id);
244: FND_MESSAGE.SET_TOKEN('VAT_YEAR',p_year);
245: FND_MESSAGE.SET_TOKEN('UPLOAD_TYPE',l_type_of_upload_mng);
246: errbuf :=FND_MESSAGE.get;
239: CLOSE cur_report_mode;
240: debug_message('earlier report mode-'||l_status_code);
241: IF l_status_code in ('F','R') THEN
242: FND_MESSAGE.SET_NAME('JE','JE_IT_FINAL_LISTING');
243: FND_MESSAGE.SET_TOKEN('VAT_REP',p_vat_reporting_entity_id);
244: FND_MESSAGE.SET_TOKEN('VAT_YEAR',p_year);
245: FND_MESSAGE.SET_TOKEN('UPLOAD_TYPE',l_type_of_upload_mng);
246: errbuf :=FND_MESSAGE.get;
247: retcode := 2; -- Error
240: debug_message('earlier report mode-'||l_status_code);
241: IF l_status_code in ('F','R') THEN
242: FND_MESSAGE.SET_NAME('JE','JE_IT_FINAL_LISTING');
243: FND_MESSAGE.SET_TOKEN('VAT_REP',p_vat_reporting_entity_id);
244: FND_MESSAGE.SET_TOKEN('VAT_YEAR',p_year);
245: FND_MESSAGE.SET_TOKEN('UPLOAD_TYPE',l_type_of_upload_mng);
246: errbuf :=FND_MESSAGE.get;
247: retcode := 2; -- Error
248: debug_message( 'Report got already submitted in Final mode for the declaratiob year '||p_year||' and for type of upload '||p_type_of_upload);
241: IF l_status_code in ('F','R') THEN
242: FND_MESSAGE.SET_NAME('JE','JE_IT_FINAL_LISTING');
243: FND_MESSAGE.SET_TOKEN('VAT_REP',p_vat_reporting_entity_id);
244: FND_MESSAGE.SET_TOKEN('VAT_YEAR',p_year);
245: FND_MESSAGE.SET_TOKEN('UPLOAD_TYPE',l_type_of_upload_mng);
246: errbuf :=FND_MESSAGE.get;
247: retcode := 2; -- Error
248: debug_message( 'Report got already submitted in Final mode for the declaratiob year '||p_year||' and for type of upload '||p_type_of_upload);
249: return;
242: FND_MESSAGE.SET_NAME('JE','JE_IT_FINAL_LISTING');
243: FND_MESSAGE.SET_TOKEN('VAT_REP',p_vat_reporting_entity_id);
244: FND_MESSAGE.SET_TOKEN('VAT_YEAR',p_year);
245: FND_MESSAGE.SET_TOKEN('UPLOAD_TYPE',l_type_of_upload_mng);
246: errbuf :=FND_MESSAGE.get;
247: retcode := 2; -- Error
248: debug_message( 'Report got already submitted in Final mode for the declaratiob year '||p_year||' and for type of upload '||p_type_of_upload);
249: return;
250: ELSIF l_status_code='P' THEN -- report_mode is 'preliminary'.