HRM with Attendance & Payroll
HRM Chấm công + Tính lương
HRM for a 480-worker factory — biometric attendance, per-stage payroll, ZKTeco integration.
Problem
A 480-worker shoe factory pays piece-rate (per-stage). Complex: each product passes 24 stages, each with its own rate. The old hourly system didn't match. Accounting did it manually for 5 days every month-end.
Architecture
Django + Celery (nightly payroll) + Postgres → conversion engine: stage_count × stage_rate → ZKTeco F18 (libzkteco fork) reads fingerprints over TCP → Pandas exports Excel matching the old format. Custom Django-admin reporting.
Stack & rationale
- Django: solid ORM for complex HR domain; built-in admin saves code.
- Celery nightly: payroll for 480 × 24 stages = 11k records, runs in 2 min.
- libzkteco fork: upstream missed F18 support, fork + upstream PR.
Results
| Metric | Before | After |
|---|---|---|
| Payroll calc time | 5 days | 2 hours |
| Wrong-pay complaints / month | 18 | 1-2 |
| Export Excel format | Different — accounting re-typed | 100% match |
| ZKTeco devices integrated | 0 | 7 |