Add the profitability report and the internal hourly cost

Profitability by job and service unit from a period's hours, expenses
and the created billing materials of its months. Hours are costed at one
internal hourly cost, set on the price list maintenance page; a job of
several service units is shared evenly between them.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-11-25 08:50:30 +02:00
co-authored by Claude Sonnet 5.5
parent 8079c272d2
commit 8aa62c8e02
31 changed files with 1110 additions and 1 deletions
@@ -4,6 +4,7 @@ namespace App\Modules\Reports\Presentation\Http\Controllers;
use App\Modules\Reports\Domain\Exceptions\InvalidReportPeriod;
use App\Modules\Reports\Presentation\Csv\HoursCsv;
use App\Modules\Reports\Presentation\Csv\ProfitabilityCsv;
use App\Modules\Reports\Presentation\Csv\ReimbursementsCsv;
use App\Modules\Reports\Presentation\Csv\ReportCsv;
use App\Modules\Reports\Presentation\Csv\SalesCsv;
@@ -21,7 +22,7 @@ use Symfony\Component\HttpFoundation\StreamedResponse;
class DownloadReport
{
/** The reports that have a CSV, by their URL key. */
public const array REPORTS = ['hours', 'unbilled', 'sales', 'reimbursements'];
public const array REPORTS = ['hours', 'unbilled', 'profitability', 'sales', 'reimbursements'];
public function __invoke(string $report, Request $request): StreamedResponse
{
@@ -75,6 +76,7 @@ class DownloadReport
return match ($report) {
'hours' => app(HoursCsv::class),
'unbilled' => app(UnbilledCsv::class),
'profitability' => app(ProfitabilityCsv::class),
'sales' => app(SalesCsv::class),
'reimbursements' => app(ReimbursementsCsv::class),
default => abort(404),