Cash registers – system description

Data model of the cash register master, save rules, content scope and reference-protected deletion.

Cash register master per client: company, name, currency, ledger account, status. The content scope is the register's company; the list also calculates balances from the vouchers.

Data model

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

TableRoleRelation
cashregisterregister: company, name, currency, ledger account, statuscompany
transactioncash vouchers; balance (getCashBalances), delete protectionregister id

Process

  1. List: filter by company group/company, name and status, always narrowed to the allowed companies (getCompanyGroupFilter); paging slices the full result in PHP.
  2. Save: company required, name at least 2 characters, currency 3 capitals, ledger account 1–16 digits; both the new and the old company must be in scope; saveCashregister(), logged. A database error returns DB: ….
  3. Status: setStatus() after the scope check.
  4. Delete: scope check per selected row; deleteCashregister() deletes only without references, otherwise returns error_linked with the reference count and stops.

Permissions

  • Function rights: list; edit (form, status and the header Add button); save via canSave() – with no add row in the catalogue, edit decides; delete; debug. Changes need core modify.
  • Content scope: the register's company in every operation. Company picker: filtercompanies (shared picker, list right).

Known limitations

The statusdelete key is classified BASE but the controller does not implement it: there is no trash state, only physical deletion.

Related topics: cash register permissions