Add an editable menu name and reserve billing material numbers on creation

- Company details get an optional "Valikon nimi", shown at the left of the
  main menu; it falls back to the application name when empty.
- A billing material gets its running number (billing_exports.number) only
  when it is created, so discarded drafts leave no gaps. Drafts have no
  number; existing created materials are numbered by the migration, and the
  CSV file name uses the number.
- TaskAssigneeMigrationTest rolls back from its own migration onward instead
  of assuming it is the last one.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
2026-11-24 19:41:57 +02:00
co-authored by Claude Sonnet 5.5
parent 48030e7689
commit 7d7b72989d
25 changed files with 195 additions and 23 deletions
@@ -118,16 +118,19 @@ it('rejects billable hours that are not quarters of an hour', function (string $
it('locks the material once it is created', function () {
$export = draft();
$export->addJob(new DraftJob(1, 10, null, null));
$export->finalize([1 => [InvoiceLine::fixedPrice(1, 'Työ', 1000, 2550)]], 2, new DateTimeImmutable('2026-11-24 12:00'));
expect($export->number())->toBeNull();
$export->finalize([1 => [InvoiceLine::fixedPrice(1, 'Työ', 1000, 2550)]], 7, 2, new DateTimeImmutable('2026-11-24 12:00'));
expect($export->status())->toBe(ExportStatus::Created)
->and($export->number())->toBe(7)
->and($export->invoices()[0]->totals()->netCents)->toBe(1000);
$export->addJob(new DraftJob(2, 10, null, null));
})->throws(ExportNotDraft::class);
it('does not create an empty material', function () {
draft()->finalize([], 1, new DateTimeImmutable);
draft()->finalize([], 1, 1, new DateTimeImmutable);
})->throws(ExportEmpty::class);
it('prices hours by the quarter and rounds half up', function () {