Add the expense reimbursements report

The expenses employees paid themselves in a period, by person with
kilometres and amounts, printable and as CSV for payroll.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-11-25 08:46:22 +02:00
co-authored by Claude Sonnet 5.5
parent 568871c9dc
commit 8079c272d2
21 changed files with 639 additions and 1 deletions
@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace App\Modules\Expenses\Application\Contracts;
use App\Modules\Expenses\Application\DTOs\ReimbursableExpense;
/**
* Expenses for management's reports, by the day spent (Y-m-d, both ends
* included).
*/
interface ExpenseReportQueries
{
/**
* Expenses the employees paid themselves, to be reimbursed outside
* this system, by user and day.
*
* @return list<ReimbursableExpense>
*/
public function employeePaidBetween(string $from, string $to): array;
/**
* Purchase costs (VAT 0) of every expense, by job id.
*
* @return array<int, int>
*/
public function costsByJobBetween(string $from, string $to): array;
}
@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace App\Modules\Expenses\Application\DTOs;
use App\Modules\Expenses\Domain\Enums\ExpenseCategory;
/**
* An expense an employee paid: on which job and day, what it was, the
* kilometres in tenths for mileage and the cost in cents (VAT 0).
*/
final readonly class ReimbursableExpense
{
public function __construct(
public int $id,
public int $userId,
public int $jobId,
public ExpenseCategory $category,
public string $spentOn,
public ?string $description,
public ?string $destination,
public ?string $purpose,
public ?int $kilometerTenths,
public int $costCents,
) {}
}