24: if nvl(pv_reallocate_flag, 'N') = 'Y' then
25: delete from jg_zz_vat_box_allocs
26: where vat_transaction_id in
27: ( select vat_transaction_id
28: from jg_zz_vat_trx_details a
29: where a.reporting_status_id = pn_reporting_status_id);
30:
31: delete from jg_zz_vat_box_errors
32: where vat_transaction_id in
30:
31: delete from jg_zz_vat_box_errors
32: where vat_transaction_id in
33: ( select vat_transaction_id
34: from jg_zz_vat_trx_details a
35: where a.reporting_status_id = pn_reporting_status_id);
36:
37: end if;
38:
269: dtl.tax_rate_vat_trx_type_code vat_trans_type,
270: nvl(dtl.tax_amt_funcl_curr, dtl.tax_amt) tax_amount,
271: NULL allocation_error_code,
272: NULL period_type
273: FROM jg_zz_vat_trx_details dtl, jg_zz_vat_rep_status status
274: WHERE status.reporting_status_id = dtl.reporting_status_id
275: AND status.vat_reporting_entity_id = pn_vat_reporting_entity_id
276: AND status.tax_calendar_period = cp_period_name
277: AND dtl.extract_source_ledger = cp_source;
325: dtl.tax_rate_vat_trx_type_code vat_trans_type,
326: nvl(dtl.tax_amt_funcl_curr, dtl.tax_amt) tax_amount,
327: NULL allocation_error_code,
328: NULL period_type
329: FROM jg_zz_vat_trx_details dtl, jg_zz_vat_rep_status status
330: WHERE status.reporting_status_id = dtl.reporting_status_id
331: AND status.vat_reporting_entity_id = pn_vat_reporting_entity_id
332: AND status.tax_calendar_period = pv_tax_period_name
333: AND dtl.extract_source_ledger = pv_extract_source_ledger;
359: dtl.tax_rate_vat_trx_type_code vat_trans_type,
360: nvl(dtl.tax_amt_funcl_curr, dtl.tax_amt) tax_amount,
361: err.allocation_error_code allocation_error_code,
362: err.period_type period_type
363: FROM jg_zz_vat_trx_details dtl,
364: jg_zz_vat_box_errors err,
365: jg_zz_vat_rep_status status
366: WHERE status.reporting_status_id = dtl.reporting_status_id
367: AND dtl.vat_transaction_id = err.vat_transaction_id
498: else /*meaning the processing for allocation errors */
499: lv_fresh_allocation_flag := g_no;
500: end if;
501:
502: /* Dynamic cursor that fetches data either from JG_ZZ_VAT_TRX_DETAILS or JG_ZZ_VAT_BOX_ERRORS depending
503: on the REALLOCATE_FLAG value
504: While looping thru transaction -
505: If the record is being processed from JG_ZZ_VAT_TRX_DETAILS, then it is processed for both period_types
506: else if the record is being processed from JG_ZZ_VAT_BOX_ERRORS, then only error period_type is processed
501:
502: /* Dynamic cursor that fetches data either from JG_ZZ_VAT_TRX_DETAILS or JG_ZZ_VAT_BOX_ERRORS depending
503: on the REALLOCATE_FLAG value
504: While looping thru transaction -
505: If the record is being processed from JG_ZZ_VAT_TRX_DETAILS, then it is processed for both period_types
506: else if the record is being processed from JG_ZZ_VAT_BOX_ERRORS, then only error period_type is processed
507: */
508: l_trxs_for_alloc_csr :=
509: get_transactions_cursor(