Reporting System Business Logic¶
The reporting system provides comprehensive analytics, compliance tracking, and business intelligence for all aspects of the Stratpoint Timesheet Application. It helps managers monitor team performance, track project progress, and ensure compliance.
How Reporting Works¶
For Employees: 1. View your own timesheet reports and leave summaries 2. Check your utilization rates and project assignments 3. Monitor your deficiency status and compliance 4. Access individual performance analytics
For Managers: 1. Review team timesheets and approval queues 2. Monitor team utilization and project performance 3. Track deficiencies and compliance issues 4. Generate reports for business planning
For Leadership: 1. Access company-wide analytics and trends 2. Monitor financial performance and revenue 3. Track organizational utilization and efficiency 4. Generate strategic planning reports
System Features: - Real-time reporting with live data - Permission-based access control - Export capabilities (CSV, Excel) - Automated deficiency tracking - Integration with external systems
Timesheet Reports¶
Individual Timesheet Reports¶
View your own or team member's timesheet activity:
What You Can See: - Daily time entries with project and task details - Total hours worked vs billable hours - Approval status (pending, approved, rejected) - Project breakdown and time distribution - Weekly and monthly summaries
How to Use: - Select date range to analyze - View detailed time entries - Check approval status - Export data for external use - Track personal productivity
Manager Approval Reports¶
For managers reviewing team submissions:
Pending Approvals: - All items waiting for your approval - Grouped by team member and project - Quick summary of hours and status - Bulk approval capabilities - Priority flagging for urgent items
Approval History: - Track what you've approved/rejected - Review approval patterns and trends - Monitor team submission compliance - Generate approval summary reports
Deficiency Tracking¶
What Are Deficiencies?¶
Deficiencies occur when employees don't meet timesheet requirements:
Types of Deficiencies: - Missing Timesheets: No time entries for working days - Insufficient Hours: Below required daily/weekly hours - Unapproved Entries: Time entries pending approval too long - Rejected Entries: Time entries that need to be fixed and resubmitted
Deficiency Reports¶
For Managers: - See which team members have deficiencies - Monitor weekly and monthly compliance - Track patterns and trends - Generate action plans for improvement
For HR: - Company-wide deficiency overview - Department-level analysis - Compliance monitoring - Policy enforcement tracking
Automated Deficiency Tracking¶
- Daily Calculation: System automatically calculates deficiencies
- Real-time Updates: Deficiency status updates as entries are submitted
- Escalation Alerts: Notifications for persistent deficiencies
- Compliance Monitoring: Track adherence to timesheet policies
Utilization Reports¶
Individual Utilization¶
Track how effectively individuals are using their time:
Weekly Analysis: - Expected hours vs actual hours worked - Billable vs non-billable time breakdown - Utilization percentage calculation - Trend analysis over time - Comparison to team averages
Key Metrics: - Utilization Rate: Actual hours / Expected hours - Billable Rate: Billable hours / Total hours - Efficiency Score: Overall productivity measurement - Project Distribution: Time allocation across projects
Team Utilization¶
Manager Dashboard: - Team member utilization comparison - Project assignment effectiveness - Resource allocation optimization - Capacity planning insights
Project Assignment Reports¶
Resource Planning: - Who's assigned to which projects - Allocation percentages and time periods - Utilization by project and client - Resource availability and conflicts - Performance against assignments
Financial Reports¶
Revenue Analysis¶
- Revenue Forecasts: Projected income from projects
- Actual vs Forecast: Performance against predictions
- Monthly Trends: Revenue patterns over time
- Project Profitability: Margin analysis by project
- Business Unit Performance: Revenue by department
Project Financial Performance¶
Project Manager Dashboard: - Revenue and cost breakdown by project - Profit margins and financial health - Budget vs actual cost analysis - Resource cost allocation - Client profitability analysis
Cost Variance Analysis: - Planned vs actual project costs - Budget overrun identification - Resource cost efficiency - Financial risk assessment - Corrective action recommendations
Profitability Reports¶
- Gross Profit: Revenue minus direct costs
- Net Profit: Complete profitability analysis
- Year-to-Date Performance: Cumulative financial performance
- Margin Trends: Profitability changes over time
System Analytics¶
Usage Analytics¶
Understand how the system is being used:
Timelog Creation Patterns: - When do people typically enter their time? - How quickly do people log time after working? - Daily and weekly submission patterns - Peak usage times and system load
System Access Analytics: - API usage patterns and trends - User activity by time of day - Feature usage statistics - System performance insights
Compensatory Time Off (CTO) Reports¶
CTO Utilization Analysis: - How much comp time is being earned vs used - CTO expiration tracking - Project-specific CTO patterns - Team CTO utilization rates
Leave Reporting¶
Individual Leave Summary: - Leave balances by type (vacation, sick, etc.) - Leave usage patterns and trends - Accrual rates and calculations - Leave policy compliance
Manager Leave Reports: - Team leave calendar and planning - Leave balance monitoring - Usage pattern analysis - Policy compliance tracking
Report Export and Sharing¶
Export Options¶
Most reports can be exported in multiple formats:
Available Formats: - CSV: For data analysis in Excel or other tools - Excel: Formatted spreadsheets with charts and summaries - PDF: Professional reports for presentations - API Data: Raw JSON data for system integration
Special Reports¶
Offset Reference Reports: - Track compensatory time off usage - Link CTO back to original overtime work - Monitor CTO expiration and utilization - Audit trail for comp time management
Custom Export Features: - Automated file naming with dates - Scheduled report generation - Email delivery of reports - Integration with external systems
Technical Implementation Details¶
For developers and system administrators
Report Categories and Endpoints¶
Timesheet Reports:
// Individual timelog reports
POST /api/v2/timelogs/{userId}/{startDate}/{endDate}
// Approver detailed task reports
POST /api/v2/timelogs/approverDetailedTaskReport
// Offset reference reports
POST /api/v2/timelogs/reportOffsetReferences
Deficiency Reports:
// Timelog deficiency tracking
POST /api/v2/users/timelogDeficiencyReport
// Deficiency snapshot by approver
POST /api/v2/users/getDeficiencySnapshotReportByApprover
Utilization Reports:
// Weekly utilization analysis
GET /api/v2/users/getUtilizationReportByWeek/{userId}/{yearMonth}/{reportTypes}/{cadetInclusion?}
// Project assignment reports
POST /api/v2/projects/getProjectAssignmentReport
// CTO utilization tracking
POST /api/v2/projects/cto_utilization
Financial Reports:
// Revenue forecast reports
POST /api/v2/revenue/forecastReport
// Project margin analysis
POST /api/v2/profits/projectMarginReport
POST /api/v2/profits/projectmarginassignedactualreport
POST /api/v2/profits/grossNetProfitReport
// PM dashboard reports
POST /api/v2/profits/pmDashboard/{reportGrouping}
// Project cost variance
POST /api/v2/projects/reports/project-cost-variance
Analytics Reports:
// Timelog creation analytics
POST /api/v2/analytics/timelogCreationTime
POST /api/v2/analytics/timelogCreationDayInWeek
POST /api/v2/analytics/timelogCreationDayInMonth
// API access analytics
POST /api/v2/analytics/apiAccessDateInMonth
POST /api/v2/analytics/apiAccessTimeOfDay
Leave Reports:
Permission System¶
Report Access Permissions: - Permission 1: Basic user access to own timelog reports - Permission 67: Access to deficiency and utilization reports - Permission 72: Access to all user data (super user reports) - Permission 103: Access to approver-specific reports - Permission 109: Access to revenue and financial reports - Permission 40: Access to project reports - Permission 93: Access to analytics reports - Permission 125: Access to own leave reports - Permission 126: Access to leave reports for others
Access Validation Pattern:
// Standard permission check pattern used across all reports
if (!hasPermission($this->authUser, $requiredPermission)) {
return respondAccessNotAllowed($this->title);
}
// Additional user context checks for sensitive data
if ($requestedUserId != $this->authUser['id'] && !hasPermission($this->authUser, 72)) {
return respondAccessNotAllowed('User Data Access');
}
Report Filter System¶
Filter Data Sources:
// Project utilization report filters
GET /api/v2/users/project-utilization-report-filters
// Returns available filter options:
{
"users": [...], // Active users
"projects": [...], // Active projects with clients
"businessUnits": [...], // All business units
"taskTypes": [...] // Active task types including leave types
}
Export Implementation¶
Export Service:
// Project cost variance export
POST /api/v2/projects/reports/exportProjectCostVariance/{extension}
// Supported formats:
// - csv: Comma-separated values
// - xlsx: Excel workbook format
// FileExportService handles format conversion
$fileExportService = new FileExportService();
return $fileExportService->exportToCsv($data, $filename);
Deficiency Calculation Logic¶
Deficiency Types: 1. Missing Timelogs: No entries for working days 2. Insufficient Hours: Below required daily/weekly hours 3. Unapproved Entries: Pending approval beyond deadlines 4. Rejected Entries: Requiring resubmission
Calculation Parameters:
// Deficiency report configuration
{
"includeOnlyUsersWithDeficiency": true,
"includeLwopAwolRejected": true,
"includeProjectsPmSm": true
}
Analytics Implementation¶
Timelog Creation Analytics:
// Analyze when users create timelogs
$creationData = DB::table('timelogs')
->select(
DB::raw('HOUR(created_at) as creation_hour'),
DB::raw('COUNT(*) as timelog_count'),
DB::raw('AVG(TIMESTAMPDIFF(HOUR, startTime, created_at)) as avg_delay_hours')
)
->whereBetween('created_at', [$startDate, $endDate])
->groupBy('creation_hour')
->orderBy('creation_hour')
->get();
Utilization Calculation¶
Weekly Utilization Formula:
$utilizationRate = ($actualHours / $expectedHours) * 100;
$billableRate = ($billableHours / $actualHours) * 100;
Factors Considered: - Working days in the week - Expected hours based on employment type - Actual hours from approved timelog entries - Billable vs non-billable hour classification
CTO Utilization Tracking¶
CTO Data Structure: - Total CTO hours available - CTO hours used in the period - Utilization rate calculation - Project and user breakdown - Expiration tracking
Standard Response Format¶
Success Response:
{
"header": {
"status": 200,
"title": "Report Name",
"description": "Data Successfully Retrieved"
},
"body": {
"data": [...],
"summary": {...},
"period": {
"start": "2024-01-01",
"end": "2024-01-31"
}
}
}
Performance Considerations¶
Optimization Strategies: - Real-time data queries for current information - Efficient database indexing for report queries - Permission-based data filtering - Bulk processing for large datasets - Caching for frequently accessed filter data
This reporting system is designed for enterprise-level monitoring and compliance with complex business rules, permission-based access control, and comprehensive audit capabilities specific to Stratpoint's operational requirements.