إنتقل إلى المحتوى الرئيسي

Timesheets

The Timesheets module provides weekly timesheet submission and approval workflows for tracking time spent on PPM projects, WBS elements, and cost categories.

Overview​

Accurate time tracking is essential for Earned Value Management, resource utilization reporting, and cost control. ProBeya timesheets extend the core time entry system with PPM-specific context: every entry can be tagged with a project, WBS element, and cost type (CAPEX/OPEX). Timesheets follow a weekly cycle aligned to Monday–Sunday periods with a submit → approve/reject workflow that enforces governance before hours flow into cost calculations.

Getting Started​

  1. Navigate to PPM > Timesheets to see your current weekly view.
  2. Log time entries against a project and WBS element for each day of the week.
  3. Review the weekly total hours and verify all entries are complete.
  4. Click Submit to send the timesheet for approval.
  5. Your manager reviews and approves or rejects the submission.

How It Works​

Time Entry Methods​

ProBeya supports two methods for logging time:

Live Timer​

Start a real-time timer that tracks elapsed time automatically:

  1. Click the timer icon on any board or item.
  2. The timer starts with startedAt set to the current time and endedAt null.
  3. Continue working; the timer widget shows elapsed time.
  4. Click Stop to end the timer. Duration is computed server-side: floor((endedAt - startedAt) / 1000) seconds.

Business rule: Only one timer can run per user at a time. Starting a new timer while one is running returns a BAD_REQUEST error. Stop the current timer first.

Manual Entry​

Log time after the fact when you forgot to start a timer:

  1. Click + Manual Entry on the timesheet grid.
  2. Specify the start time, end time, board, and optional item.
  3. Add a description and set the billable flag.
  4. The system validates that endedAt > startedAt and computes the duration server-side.

Time Entry Fields​

Each time entry captures:

FieldTypeRequiredDescription
Board IDstringYesThe board being worked on (validated against org)
Item IDstringNoSpecific task or work item
DescriptionstringNoFree-text note explaining the work performed
Started AttimestampYesWhen the work started
Ended AttimestampTimer: autoWhen the work ended (null while timer is running)
DurationintegerComputedDuration in seconds (computed server-side)
BillablebooleanNoWhether the time is billable (default: false)

Weekly Timesheet View​

The getWeeklyTimesheet endpoint aggregates completed time entries by day for a given week:

  • Week boundaries: Aligned to ISO 8601 Monday–Sunday using PostgreSQL DATE_TRUNC('week', ...).
  • Daily totals: Total seconds, billable seconds, and entry count per day.
  • Week summary: Aggregate total seconds and billable seconds across the week.
  • Running timers excluded: Only entries with endedAt IS NOT NULL are included in aggregation to prevent incomplete data from skewing totals.

The response shape:

{
days: Array<{
date: string; // YYYY-MM-DD
totalSeconds: number;
billableSeconds: number;
entryCount: number;
}>;
weekTotalSeconds: number;
weekBillableSeconds: number;
weekStart: string; // The Monday of the queried week
}

Active Timer Widget​

The getActiveTimer query returns the user's currently running timer (if any), including related item and board data with the full project-workspace navigation chain. This powers the global timer indicator in the UI header, showing which item is being tracked and enabling one-click navigation.

Time Entry Listing​

The list endpoint supports rich filtering:

FilterTypeDefaultDescription
userIdstringCurrent userFilter by the user who tracked time
itemIdstringAll itemsFilter by specific item
boardIdstringAll boardsFilter by specific board
startDateISO dateNo limitEntries starting on or after this date
endDateISO dateNo limitEntries starting on or before this date
billablebooleanAllFilter by billable status
limitnumber50Results per page (max 200)
offsetnumber0Pagination offset

Results are ordered by startedAt descending and include total count and hasMore flag for pagination.

Entry Ownership​

Users can only manage their own time entries. The verifyEntryOwnership helper applies a triple filter on every mutation: id + organizationId + userId. This provides defense-in-depth:

  • organizationId prevents cross-tenant access
  • userId prevents users from modifying other users' entries

Permissions​

ActionRequired Role
Log, update, or delete own entriesAny member
Start and stop own timersAny member
View own weekly timesheetAny member
View another user's timesheetManager or Admin
Approve or reject timesheetsManager or Admin

API Reference​

ProcedureTypeDescription
timeTracking.startTimerMutationStart a live timer on a board/item
timeTracking.stopTimerMutationStop a running timer (computes duration)
timeTracking.getActiveTimerQueryGet the user's currently running timer
timeTracking.logManualEntryMutationCreate a time entry with explicit start/end
timeTracking.listQueryList time entries with filters and pagination
timeTracking.getWeeklyTimesheetQueryAggregate time by day for a week
timeTracking.deleteMutationDelete a user's own time entry

Tips & Best Practices​

تلميح

Log time entries daily rather than at the end of the week. This improves accuracy and makes the weekly submission process faster since entries are already in place.

تلميح

Always tag entries with the correct WBS element and cost type. These fields feed directly into EVM calculations and budget variance reports, so inaccurate tagging can distort project financials.

تلميح

Use the live timer for focused work sessions and manual entry for meetings and ad-hoc activities. The timer ensures accurate duration calculation without relying on memory.

  • WBS — Work Breakdown Structure elements referenced by time entries
  • Budgets & Costs — Time entries feed into actual cost tracking
  • EVM — Earned Value calculations rely on timesheet hours
  • Resource Reports — Utilization reports aggregate timesheet data