0%
balqalam Logo
balqalam
FeaturesCommunityPricingDocumentation
Login
  • Introduction
  • Help center
  • Common questions
  • Get Started
  • Localhost
  • Architecture
  • Structure
  • Pattern
  • Page
  • Layout
  • Content
  • Types
  • Config
  • Actions
  • Queries
  • Authorization
  • Validation
  • Form
  • Table
  • Detail
  • Card
  • Util
  • Hooks
  • List Params
  • Views
  • README.md
  • ISSUE.md
  • Technology Stack
  • Database
  • File
  • CDN Assets
  • Entry Points
  • Dashboard
  • Authentication
  • Credentials
  • OAuth
  • Flow Diagrams
  • Multi-Tenancy
  • Offline
  • Onboarding
  • Onboarding Videos
  • Add Values
  • Admission
  • Application
  • Attendance
  • Compliance
  • Profile
  • Exams
  • Exam Wizard
  • Timetable
  • Classrooms
  • Notifications
  • Conference
  • LMS (Lumos)
  • Finance
  • Fee Management
  • Invoice
  • Wallet
  • Salary
  • Payroll
  • Timesheet
  • Expenses
  • Budget
  • Receipt
  • Accounts
  • Banking
  • Reports
  • Dashboard
  • Permissions
  • Messages
  • Integration Flow
  • Provision
  • AI Document Processing
  • Document Intelligence
  • Internationalization
  • Translation
  • Translation Guide
  • Icons
  • Docs Factory
  • Inspiration
  • Listings
  • Teachers
  • Students
  • Catalog
  • Library
  • Contributing
  • Code of conduct
  • GitHub Workflow
  • Database Seeds
  • Database Safety
  • Test Accounts
  • Bulk import
  • Playwright
  • Prettier
  • Block Rebound
  • Transportation

Timesheet

PreviousNext

Staff time tracking via pay periods and per-day entries (hours, overtime, leave) with an open → closed → approved workflow. Period and entry CRUD work; there is no clock-in UI, no overtime detection, and the manual-entry form is a placeholder.

Timesheet manages pay periods and the time entries within them. Approved timesheets are intended to feed payroll's day/hour counts — but that link is not wired today, so payroll hardcodes 22 days regardless.

Flow

1. Create period (OPEN)                              — createTimesheet
2. Add entries (hours / overtime / leave per day)    — addTimesheetEntry  (db.$transaction)
3. Submit period (→ CLOSED)                          — submitTimesheet
4. Approve / reject                                  — approveTimesheet

Status

FeatureStatus
Timesheet period CRUD + listProduction
Time entry creation (transactional)Production
Submit periodProduction
Approve / reject periodProduction
Manual entry UI formStubbed — "coming soon" placeholder
Overtime detection (>8h/day flag)Planned
Mobile / GPS / QR clock-inPlanned
Export to payroll inputPlanned
Payroll consumption of approved hoursNot wired (payroll hardcodes 22 days)

Routes

RoutePageStatus
/{lang}/finance/timesheetOverviewReady
/{lang}/finance/timesheet/periodsPeriods listReady
/{lang}/finance/timesheet/entriesEntries listReady
/{lang}/finance/timesheet/entries/newManual entryStubbed (placeholder)

Server actions

RBAC is enforced in content.tsx. These actions resolve the tenant from session.user.schoolId directly rather than getTenantContext() (an inconsistency with payroll/salary — flagged for cleanup). addTimesheetEntry wraps its write in db.$transaction.

ActionPurpose
createTimesheetCreate period (OPEN)
addTimesheetEntryCreate entry + reload period in one transaction
submitTimesheetPeriod → CLOSED
approveTimesheetSet approve/reject status + closedBy
getTimesheetsList periods + entries

Concepts

ConceptValues
PeriodStatusOPEN, CLOSED, LOCKED
EntryStatusDRAFT, SUBMITTED, APPROVED, REJECTED
Config rulesPERIOD_DURATION_DAYS 14, ROUNDING_INTERVAL 0.25, REQUIRE_APPROVAL true

Ledger / accounting

No journal posting — timesheet is upstream of payroll and has no money event of its own.

Schema

prisma/models/finance-payroll.prisma:

  • TimesheetPeriod — name, startDate, endDate, status, closedBy/At; @@unique([schoolId, name]).
  • TimesheetEntry — periodId, teacherId, entryDate, hoursWorked, overtimeHours, leaveHours, leaveType, notes, status; @@unique([schoolId, periodId, teacherId, entryDate]).

No lang field (the free-text fields here are short operational labels).

Stubs

  • timesheet/entries/new/page.tsx — manual-entry form is a placeholder.
  • validation.ts:25 — hardcoded Zod message (not yet routed through ValidationHelper).

Tests

None.

Key files

ComponentPath
Server actionssrc/components/school-dashboard/finance/timesheet/actions.ts
Configsrc/components/school-dashboard/finance/timesheet/config.ts
Entries pagesrc/app/[lang]/s/[subdomain]/(school-dashboard)/finance/timesheet/entries/page.tsx
Schemaprisma/models/finance-payroll.prisma

See also

  • Finance — block overview
  • Payroll — the intended consumer of approved hours
  • Salary — pay definitions
PayrollExpenses

On This Page

FlowStatusRoutesServer actionsConceptsLedger / accountingSchemaStubsTestsKey filesSee also

Built by Databayt ·

Welcome to balqalam.

A great journey is about to begin.