Hour Balance Seems Wrong #
If a service contract’s hour balance appears incorrect — either too high or too low — this guide explains how the balance is calculated and how to audit it.
What DMSI Service Management Adds
Service contract hour tracking is entirely new to this extension. Core does not have hour-based contracts.
How Hour Balance Is Calculated #
The hour balance is not stored as a separate field. It is calculated on demand:
hours_remaining = allocated_hours - hours_used
hours_used = SUM of all time entries linked to this contract
The hours_used field on the contract record is updated synchronously every time a time entry is created. This means the balance is deducted immediately when staff log time — there is no batch process or delay.
Common Reasons for an Unexpected Balance #
Time Entries Logged to Wrong Contract #
If a staff member logged time against the wrong contract, the balance on both contracts will be off. Review the time entries linked to each contract and, if needed, ask the staff member to correct the contract association on the erroneous entries.
Allocated Hours Were Changed After Logging #
If an admin edited the contract’s allocated_hours field after time was already logged, the new balance reflects the updated allocation. The calculation is always allocated_hours - hours_used, so increasing allocated hours increases the remaining balance, and decreasing it reduces it.
Contract Was Renewed with Hour Rollover #
If the contract has been renewed with a rollover configuration, unused hours from the previous period may have been added to the new period’s allocation. This is the expected behavior but can appear as a higher-than-expected balance if not anticipated.
Auditing the Balance #
To verify the balance manually:
- Navigate to Services > Contracts and open the contract in question.
- Note the Allocated Hours and Hours Used fields on the contract record.
- Navigate to the Time Entries tab on the contract detail page.
- Sum the hours on all time entries.
- Compare the sum to the Hours Used field — they should match.
If they do not match, there may be a data consistency issue. Contact DMSI support with the contract number and the discrepancy details.
