Working day calendar – system description

The working day table, manual override and reset, year generation and recalculation of the next working day; deliberately without content scope.

National working day calendar per day: working day or not, name, source (auto / manual). The working day library uses it to move payment deadlines to the next working day. Finalised module.

Data model

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

TableRoleMain fields
workdaycalendarday, working day flag, name, source, next working day

Process

  1. Save: valid date; saveWorkday() as a manual row, INSERT … ON DUPLICATE KEY UPDATE; then the next-working-day column is recalculated (refreshNext); logged. The toggle is setWorkday().
  2. Delete (one or more rows): does not delete; it resets to the value by rule and source auto (resetWorkday), then refreshNext.
  3. Generate a year: for years 1900–2200 the missing days are filled by rule (ensureYears, INSERT IGNORE), manual rows untouched, then refreshNext.

Permissions

  • Function rights: list; form add or edit; save add for a new day, edit for an existing one; toggle edit; reset delete (one item) / bulkdelete (several); generate; debug. Every change needs core modify.
  • No content scope on purpose: the calendar is national, company-independent data. The keys have a catalogue seed.
Related topics: working day permissions