Skip to content

Revenue Tracking Business Logic

The revenue tracking system manages project revenue calculations, forecasting, and financial reporting within the Stratpoint Timesheet Application. It tracks how much money projects generate and helps with business planning.

How Revenue Tracking Works

For Project Managers: 1. Monitor project revenue performance against forecasts 2. Track monthly revenue generation from team work 3. Adjust forecasts based on project changes 4. Generate reports for client billing and business analysis

For Finance Team: 1. Create revenue forecasts for business planning 2. Track actual vs projected revenue 3. Manage revenue adjustments and corrections 4. Generate financial reports for leadership

System Features: - Automatic revenue calculation from approved time entries - Monthly and annual revenue forecasting - Time & materials vs fixed price project tracking - Integration with NetSuite for accounting - Utilization factor adjustments for realistic projections

Revenue Calculation Models

Time & Materials Projects

Revenue based on hours worked by team members at agreed rates:

flowchart LR
    A[Team Hours] --> B[Billing Rates]
    B --> C[Monthly Revenue]
    C --> D[Apply Utilization Factor]
    D --> E[Final Revenue]

How T&M Revenue Works: - Team Assignments: Each person has allocation % and billing rate - Monthly Calculation: Hours × Rate × Allocation = Revenue - Utilization Factor: Adjusts for efficiency (usually 85-90%) - Pro-rating: Partial months calculated proportionally - Risk Adjustment: Probability of project completion applied

Fixed Price Projects

Revenue based on milestone completion or percentage of work done: - Milestone-Based: Revenue recognized when deliverables are completed - Percentage Completion: Revenue based on work progress - Contract Value: Total project value determines maximum revenue - Change Orders: Additional work can increase total revenue

Key Factors in Revenue Calculation

  • Billable vs Non-billable: Only billable work generates revenue
  • Team Allocation: Percentage of time dedicated to the project
  • Billing Rates: Different rates for different roles/seniority
  • Utilization Factor: Accounts for meetings, admin time, etc.
  • Project Risk: Probability of successful completion

Revenue Status Tracking

Revenue Lifecycle

stateDiagram-v2
    [*] --> Forecasted
    Forecasted --> Approved
    Approved --> Actual
    Actual --> [*]

What Each Status Means

  • Forecasted: System-generated projections based on team assignments and utilization
  • Approved: Management-reviewed and approved revenue estimates
  • Actual: Final revenue based on actual work completed and billed

Revenue Progression

  1. Forecasted: System automatically calculates expected revenue
  2. Management Review: Finance team reviews and adjusts forecasts
  3. Approved: Finalized forecasts used for business planning
  4. Actual Tracking: Real revenue tracked as work is completed
  5. Variance Analysis: Compare actual vs forecasted for future planning

Revenue Adjustments

Why Revenue Gets Adjusted

  • Contract Changes: Client adds or removes work scope
  • Rate Changes: Billing rate adjustments during project
  • Team Changes: Different team members with different rates
  • Project Risk: Adjusting probability of project completion
  • Currency Fluctuations: Foreign exchange impact on international projects

Types of Adjustments

  • Forecast Adjustments: Updating projections based on new information
  • Actual Corrections: Fixing errors in recorded revenue
  • Override Adjustments: Management decisions for special circumstances
  • Currency Adjustments: Foreign exchange rate changes

Adjustment Process

  1. Identify Need: Something changes that affects revenue
  2. Document Reason: Clear business justification required
  3. Apply Adjustment: Update revenue records with proper approval
  4. Track Changes: All adjustments logged for audit purposes
  5. Report Impact: Show variance from original projections

Milestone and Payment Tracking

How Milestones Work

For fixed-price projects, revenue is often tied to specific deliverables:

flowchart LR
    A[Work Complete] --> B[Client Approval]
    B --> C[Generate Invoice]
    C --> D[Payment Received]

Milestone Stages

  1. Planning: Milestone defined with deliverables and payment amount
  2. In Progress: Team working toward milestone completion
  3. Completed: Deliverables finished, ready for client review
  4. Approved: Client accepts deliverables
  5. Invoiced: Invoice sent to client
  6. Paid: Payment received

Milestone Information Tracked

  • Deliverable Description: What needs to be completed
  • Payment Amount: How much revenue this milestone generates
  • Due Date: When milestone should be completed
  • Approval Date: When client approved the deliverable
  • Invoice Details: Invoice number and billing information
  • Payment Status: Whether payment has been received

Revenue Reporting

Standard Revenue Reports

  • Forecast Reports: Projected revenue for upcoming periods
  • Actual vs Forecast: Compare projections with reality
  • Monthly Trends: Revenue patterns over time
  • Project Performance: Revenue by individual project
  • Business Unit Analysis: Revenue contribution by department

Key Revenue Metrics

  • Total Forecasted Revenue: Expected income for period
  • Actual Revenue: Money actually earned
  • Variance: Difference between forecast and actual
  • Monthly Breakdown: Revenue distribution across months
  • Project Contribution: Which projects generate most revenue

Business Intelligence Features

  • Trend Analysis: Revenue growth patterns
  • Resource Performance: Revenue generated per team member
  • Client Analysis: Revenue contribution by client
  • Utilization Impact: How team efficiency affects revenue
  • Risk Assessment: Projects at risk of revenue shortfall

Financial System Integration

NetSuite Accounting Integration

Revenue data automatically flows to the accounting system:

  • Unbilled Revenue: Work completed but not yet invoiced
  • Journal Entries: Automatic accounting entries for revenue recognition
  • Client Billing: Integration with invoice generation
  • Currency Handling: Foreign exchange rate management
  • Business Unit Allocation: Proper profit center assignment

Revenue Snapshots

  • Point-in-Time Capture: Save revenue state at specific dates
  • Change Tracking: Monitor how revenue forecasts evolve
  • Audit Trail: Complete history of revenue adjustments
  • Variance Analysis: Compare different forecast versions
  • Reporting: Historical revenue performance analysis

External Finance Data

  • Import Capabilities: Bring in external financial data
  • Reconciliation: Match timesheet revenue with finance systems
  • Variance Reports: Identify discrepancies between systems
  • Data Validation: Ensure consistency across financial systems

Technical Implementation Details

For developers and system administrators

Revenue Data Structure

Revenue Model (from database):

// Core revenue fields from Revenue model
'project_id' => 'Project assignment (required)',
'year' => 'Revenue year (required)',
'month' => 'Revenue month (required)',
'amount' => 'Revenue amount for period',
'status' => 'Revenue status (forecasted, approved, actual)',
'forecastedAmount' => 'Forecasted revenue amount',
'actualCalculatedAmount' => 'System-calculated actual revenue',
'actualAdjustedAmount' => 'Manually adjusted actual revenue',
'forex' => 'Foreign exchange data (JSON array)',
'totalAdjustments' => 'Total manual adjustments applied'

Time & Materials Calculation Logic

Implementation:

// Actual T&M revenue calculation from codebase
public static function getMonthlyForecasted_TimeMaterial($revStartDate, $revEndDate, $assignments, $utilizationFactor, $totalDaysInMonth, $probabilityOfClosingPercent)
{
    // Forecast Revenue = total of (Total Billable Hours for the Month * Allocation % * Bill Rate * Utilization Factor)
    // for all billable resources for the month, pro-rated if start/end date of the resource falls within the month

    $totalBillableAmountOfProject = 0;
    $items = [];

    foreach($assignments as $assignment){
        // Calculate billable hours based on allocation and pro-rating
        $billableHours = calculateBillableHoursForPeriod($assignment, $revStartDate, $revEndDate, $totalDaysInMonth);

        // Apply utilization factor
        $effectiveHours = $billableHours * $utilizationFactor;

        // Calculate revenue for this assignment
        $assignmentRevenue = $effectiveHours * $assignment['rate'] * $assignment['allocation'];

        $totalBillableAmountOfProject += $assignmentRevenue;

        $items[] = [
            'userId' => $assignment['user_id'],
            'hours' => $effectiveHours,
            'rate' => $assignment['rate'],
            'amount' => $assignmentRevenue
        ];
    }

    // Apply probability of closing percentage
    $adjustedAmount = $totalBillableAmountOfProject * ($probabilityOfClosingPercent / 100);

    return [
        'totalAmount' => $adjustedAmount,
        'baseAmount' => $totalBillableAmountOfProject,
        'items' => $items
    ];
}

Core API Endpoints

Revenue Management:

// Revenue forecast report
POST /api/v2/revenue/forecastReport
{
    "startYearMonth": "2024-01",
    "endYearMonth": "2024-12",
    "utilizationFactor": 0.85,
    "mainGroupField": "business_unit",
    "selectBusinessUnit": "1,2,3",
    "selectProject": "10,20,30",
    "considerCoca": true
}

// Revenue override
POST /api/v2/revenue/overrideAmount
{
    "revenueId": 123,
    "overrideAmount": "150000.00",
    "reason": "Client contract amendment",
    "effectiveDate": "2024-03-01"
}

Business Unit Reports:

// BU contribution analysis
POST /api/v2/revenue/buContributionReport
POST /api/v2/revenue/buContributionMarginReport/byBu
POST /api/v2/revenue/buContributionMarginReport/allBu
POST /api/v2/revenue/buContributionMarginReport/revenuePerResource

// Account consolidated revenue
POST /api/v2/revenue/accountConsolidatedRevenue

Revenue Adjustment System

RevenueAdjustment Model:

// Revenue adjustment tracking
'revenue_id' => 'Parent revenue record ID',
'adjustment_amount' => 'Adjustment value (positive or negative)',
'adjustment_type' => 'Type of adjustment (forecast, actual, override)',
'reason' => 'Business justification for adjustment',
'created_by' => 'User who made the adjustment',
'approval_status' => 'Adjustment approval status'

Payment Milestone Integration

PaymentMilestone Model Structure:

// Actual payment milestone fields
'project_id' => 'Project assignment',
'due_date' => 'Milestone due date',
'start_date' => 'Milestone start date',
'milestone' => 'Milestone description',
'amount_rate' => 'Milestone amount in project currency',
'amount_rate_php' => 'Milestone amount in PHP',
'status' => 'Milestone status',
'approval_date' => 'Client approval date',
'billing_date' => 'Invoice generation date',
'date_paid' => 'Payment received date',
'invoice_number' => 'Generated invoice number',
'po_number' => 'Client purchase order number'

NetSuite Integration

Export Functionality:

// NetSuite export endpoints
POST /api/v2/revenue/exportNetSuiteUnbilledRevenueJE
POST /api/v2/revenue/exportNetSuiteUnbilledRevenueJEIntraco

Export Process: 1. Calculate unbilled revenue based on approved time entries 2. Generate NetSuite-compatible journal entry format 3. Include project, client, and business unit classifications 4. Handle foreign exchange conversions 5. Export to CSV/Excel for NetSuite import

Revenue Snapshot System

Snapshot Functionality:

// Revenue snapshot endpoints
GET /api/v2/revenue/saveSnapShotRevenueChanges/{snapShotDate?}/{projectId?}
POST /api/v2/revenue/getSnapshotReport

Snapshot Capabilities: - Capture revenue state at specific points in time - Track revenue changes between periods - Audit trail for revenue adjustments - Variance analysis reporting

Finance Data Integration

External Finance Import:

// Finance revenue import endpoints
POST /api/v2/revenue/importFinanceRevenueReport/{reportType}
POST /api/v2/revenue/getFinanceRevenueReport

Import Process: 1. Import external finance revenue data via CSV 2. Reconcile with timesheet-calculated revenue 3. Identify and report variances 4. Generate reconciliation reports

Revenue Calculation Factors

Key Variables: - Utilization Factor: Efficiency percentage applied to billable hours - Probability of Closing: Risk factor for project completion - Allocation Percentage: Resource dedication to specific projects - Billing Rates: Project-specific or role-based rates - Foreign Exchange: Currency conversion for international projects

Validation Rules

Business Parameters:

// Actual validation from RevenueController
'startYearMonth' => 'required|date_format:Y-m',
'endYearMonth' => 'required|date_format:Y-m|after_or_equal:startYearMonth',
'utilizationFactor' => 'required|numeric|min:0',
'mainGroupField' => 'required|in:company_booking,business_unit,netsuite_project,client'

Permission System

Revenue Management Permissions: - Permission 109: Can view revenue reports and data - Permission 110: Can modify revenue adjustments (implied) - Permission 111: Can approve revenue forecasts (implied)

Access Validation:

// Actual permission check from RevenueController
if(!hasPermission($this->authUser, 109)) {
    return respondAccessNotAllowed($this->title);
}

This revenue tracking system is designed for enterprise financial management with complex project structures, multiple business units, and comprehensive integration with external financial systems specific to Stratpoint's operational requirements.