Statement row master — versions, visibility, formulas

Tables of the balance sheet and income statement rows, save validation, formula checking, the delete block and the rights.

The ledger/statement module is the row master of the balance sheet and income statement per version, in one canonical row set; the report type (annual, simplified, micro) filters through the visibility table. Central master data, no content scope.

Data model

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

TableRole
gl_schema_versionschema versions
gl_statement_schema, gl_statement_schema_descriptionrows and their names (row number, marker, level, formula, calculation pass, side, mappable, subtotal, heading)
gl_schema_visibilityvisibility per report type, e-report identifier
gl_report_type, gl_report_type_descriptionreport types
gl_account_map, gl_statement_valuereferencing mappings and generated values (delete protection)

Save (save)

  1. Existing version (error_version); row number 1–8 digits, unique within version and statement (error_row_no, error_row_no_exists).
  2. Hungarian name at least 2 characters (error_name), marker at most 12 characters (error_row_marker).
  3. Formula: may not refer to a non-existent row or itself (validateFormula, error_formula); separate check endpoint: checkformula.
  4. E-report identifier only for a visible row (error_visibility_external).
  5. Save: row, names, visibility.

Deletion

Blocked if a gl_account_map mapping or a gl_statement_value value refers to the row, or another row's formula uses it (the error lists them); otherwise physical delete (row, names, visibility).

Permissions

  • list (UNMAPPED, gl_schema_permission_v1.sql); without it the index redirects to the dashboard. The selectablerows endpoint (mappable rows for the chart of accounts form) also checks list.
  • edit + core modify: create (the + button too), edit, status, formula check.
  • delete + core modify; debug; statusdelete seed only (BASE).

Boundaries

The module deliberately does not touch the fin_* tables of the notes to the accounts.