Missing tax returns — system description

Mirror of the NAV missing-return answer: data model, full-replace synchronisation, scheduled background job, permission keys and the known fault of manual entry.

Overview

Mirror of the answer of the NAV M2M missing-return query per company: the list of returns not filed. The codes of the list (period, return type) are translated into readable form.

Data model

Table names carry the installation's own prefix in the database.

TablePurpose
nav_missing_tax_returnone missing return: company, taxpayer ID, name, type, identifier, period, original deadline, NAV result, query time
company, navcompany name and companies with NAV access for the filter

Process

  1. Sync: for the filtered companies, intersected with the content scope, a NAV M2M query on the tax number; logs the raw answer; only after a successful result code deletes the company's earlier rows and writes the fresh list (full replace); with zero hits it reports that NAV has no missing return.
  2. Delete: physical deletion of the selected rows (no trash state, the table is a mirror).
  3. Background job: a per-company row of type missingtaxreturn in the job queue; the catalogue-side controller fetches and stores the list for the company's tax number.

Permissions

  • Layer 1: sync, delete and save also require modify permission.
  • Layer 2: list, sync, delete, add, debug.
  • Layer 3: the list filters on permitted companies in the model query; the sync intersects the company identifiers with the content scope.

Known limitations

  • The company list of the filter shows every company with NAV access, without content filtering.
  • Delete does not check the content scope of the rows to delete.
  • Manual entry (there is no button for it on the list) passes the posted data with parameters the model does not expect, so it would stop with a type error at run time — structurally checked, not verified at run time.