Sep 15 - Reverse the check-in pages, set type of work Regular as default
This commit is contained in:
@@ -547,15 +547,12 @@ Toggle UI in `create_qr_code.html` and `edit_qr_code.html` — uses `addEventLis
|
||||
### Type of Work — Check-In Dropdown (Sept 2026)
|
||||
|
||||
The check-in page carries a **Type of Work / Tipo de Trabajo** `<select>` directly after
|
||||
the Employee ID field. The employee enters a **numeric-only** ID and picks the type.
|
||||
**There is no default (Sept 14, 2026)** — the dropdown opens on a disabled placeholder
|
||||
and submit is blocked (red outline + bilingual message) until a type is chosen, because
|
||||
employees were leaving it on Regular without looking.
|
||||
the Employee ID field. The employee enters a **numeric-only** ID and picks the type;
|
||||
`Regular` is selected by default.
|
||||
|
||||
| Option value | Label shown (bilingual, one plain string) |
|
||||
|---|---|
|
||||
| `""` (disabled, selected) | -- Select type of work / Seleccione tipo de trabajo -- |
|
||||
| `R` | Regular / Trabajo Regular — stored as the plain numeric ID |
|
||||
| `""` | Regular / Trabajo Regular |
|
||||
| `PW` | Periodic Work / Trabajo Periódico (PW) |
|
||||
| `SP` | Special Project / Proyecto Especial (SP) |
|
||||
| `C` | Covering / Cobertura (C) |
|
||||
@@ -567,11 +564,7 @@ languages share one label separated by `/`.
|
||||
the format every calculator and export already parses:
|
||||
|
||||
```python
|
||||
work_type = request.form.get('work_type', '').strip().upper()
|
||||
if not work_type:
|
||||
return jsonify({...}), 400 # nothing chosen — rejected
|
||||
if work_type == 'R':
|
||||
work_type = '' # Regular — no code appended
|
||||
work_type = request.form.get('work_type', '').strip().upper() # '' = Regular
|
||||
if work_type and work_type not in VALID_CHECKIN_WORK_TYPES: # ('SP','PW','PT','C')
|
||||
return jsonify({...}), 400 # reject unknown codes
|
||||
if employee_id and work_type:
|
||||
@@ -677,7 +670,7 @@ load (i.e. after the fetch resolves) and caches plain GETs aggressively:
|
||||
|
||||
### Check-In Flow
|
||||
1. Employee scans QR → `qr_destination.html`
|
||||
2. Enters numeric ID and **must** pick Type of Work (no default); GPS captured by browser
|
||||
2. Enters numeric ID and picks Type of Work (Regular by default); GPS captured by browser
|
||||
3. On a Check Out scan the page pre-selects the open check-in's work type
|
||||
4. Work-type code appended to the ID server-side (`1234` → `1234SP`)
|
||||
5. 30-min interval guard (configurable via `TIME_INTERVAL`)
|
||||
@@ -1197,13 +1190,6 @@ exact-match test is what dropped every SP/PW/PT row the query had already return
|
||||
| `templates/time_attendance_records.html` | Tooltip on the Export by Building button |
|
||||
| — | Replaces the manual "Copilot" procedure (delete PM rows + SP rows, then build a weekly table). Decisions: PM IDs removed from both sheets; SP hours excluded from weekly hours |
|
||||
|
||||
### Set 19 — Type of Work Must Be Selected (Sept 14, 2026)
|
||||
| File | Change |
|
||||
|---|---|
|
||||
| `templates/qr_destination.html` | Disabled placeholder option is the default; Regular value `""` → `R`; `required`; submit guard + `.work-type-missing` red outline; check-out suggestion maps server `""` → `R` |
|
||||
| `static/js/qr_destination.js` | Same guard in `submitCheckin()` |
|
||||
| `routes/qr_codes.py` | `qr_checkin` rejects an empty `work_type` with HTTP 400; `R` normalised to `''` (Regular). `last-work-type` still returns `""` for Regular |
|
||||
|
||||
---
|
||||
|
||||
## 21. Infrastructure & Deployment
|
||||
|
||||
Reference in New Issue
Block a user