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.
| Table | Role | Main fields |
|---|---|---|
workday | calendar | day, working day flag, name, source, next working day |
Process
- 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 issetWorkday(). - Delete (one or more rows): does not delete; it resets to the value by rule and source
auto(resetWorkday), thenrefreshNext. - Generate a year: for years 1900–2200 the missing days are filled by rule (
ensureYears,INSERT IGNORE), manual rows untouched, thenrefreshNext.
Permissions
- Function rights:
list; formaddoredit; saveaddfor a new day,editfor an existing one; toggleedit; resetdelete(one item) /bulkdelete(several);generate;debug. Every change needs coremodify. - No content scope on purpose: the calendar is national, company-independent data. The keys have a catalogue seed.