Management builds the monthly billing material (laskuaineisto) as a draft: done jobs are added as invoices of their own, combined when the customer, billing unit and reference allow it, and their billable hours are set per work type. Creating the material checks the jobs again, marks the approved hours and billable expenses billed, forms invoice lines with price and VAT snapshots and moves the jobs to "Lasku luotu". Fixed price jobs bill their quoted amount once. Billed hours keep their approval and billed expenses can no longer change. The Fennoa export and monthly fee lines come later. Co-Authored-By: Claude Opus 5.5 <[email protected]>
37 lines
815 B
PHP
37 lines
815 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Modules\Expenses\Application\Contracts;
|
|
|
|
use App\Modules\Expenses\Application\DTOs\ExpenseSummary;
|
|
|
|
/**
|
|
* Read side of expenses, newest first.
|
|
*/
|
|
interface ExpenseQueries
|
|
{
|
|
/**
|
|
* @return list<ExpenseSummary>
|
|
*/
|
|
public function forJob(int $jobId): array;
|
|
|
|
/**
|
|
* A user's own expenses in a month.
|
|
*
|
|
* @param string $month As Y-m.
|
|
* @return list<ExpenseSummary>
|
|
*/
|
|
public function forUserInMonth(int $userId, string $month): array;
|
|
|
|
public function find(int $id): ?ExpenseSummary;
|
|
|
|
/**
|
|
* The jobs' billable expenses that are not billed yet, oldest first.
|
|
*
|
|
* @param list<int> $jobIds
|
|
* @return list<ExpenseSummary>
|
|
*/
|
|
public function unbilledBillable(array $jobIds): array;
|
|
}
|