22-05-2026 Optimierung der User und Admin Panels
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled

This commit is contained in:
Kevin Adametz 2026-05-22 11:18:59 +02:00
parent d2ba22c0cf
commit e8c47b7553
73 changed files with 10282 additions and 1546 deletions

View file

@ -102,10 +102,70 @@ test('admin opens generated legacy invoice pdf inline', function () {
LivewireVolt::test('admin.invoices.index')
->assertSee('Öffnen');
$this->get(route('admin.legacy-invoices.pdf', $invoice))
$response = $this->get(route('admin.legacy-invoices.pdf', $invoice));
$response
->assertSuccessful()
->assertHeader('content-type', 'application/pdf')
->assertHeader('content-disposition', 'inline; filename="Presseecho-RNr-PE-2003.pdf"');
expect($response->content())
->toContain('adametz.media')
->toContain('Rechnungsbetrag')
->toContain('/F2 21 Tf');
expect($invoice->refresh()->pdf_generated_at)->not->toBeNull();
});
test('admin opens legacy invoice pdf with stern layout for non media invoices', function () {
/** @var TestCase $this */
$invoice = LegacyInvoice::query()->create([
'legacy_portal' => 'businessportal24',
'legacy_id' => 2004,
'user_id' => null,
'legacy_user_id' => 504,
'number' => 'BP-2004',
'amount_cents' => 11900,
'total_cents' => 11900,
'status' => 'open',
'invoice_date' => now()->subMonth(),
'due_date' => now()->addDays(14),
'payment_method' => 'invoice',
'raw_snapshot' => [
'number' => 'BP-2004',
'is_media' => false,
'service_period_begin_date' => now()->subYear()->toDateString(),
'service_period_end_date' => now()->toDateString(),
],
'pdf_payload' => [
'invoice' => [
'is_media' => false,
'service_period_begin_date' => now()->subYear()->toDateString(),
'service_period_end_date' => now()->toDateString(),
],
'billing_address' => [
'name' => 'Stern Archiv GmbH',
'address' => 'Archivstrasse 2',
'postal_code' => '10719',
'city' => 'Berlin',
'country_name' => 'Deutschland',
],
'payment_option_translation' => [
'name' => 'Legacy Pressepaket',
],
],
'imported_at' => now(),
]);
$response = $this->get(route('admin.legacy-invoices.pdf', $invoice));
$response
->assertSuccessful()
->assertHeader('content-type', 'application/pdf')
->assertHeader('content-disposition', 'inline; filename="Businessportal24-RNr-BP-2004.pdf"');
expect($response->content())
->toContain('Stern Consulting GmbH')
->toContain('Hypo Vereinsbank')
->toContain('/F2 19 Tf');
});