Creating Participation refunds

This commit is contained in:
2026-09-03 21:23:26 +02:00
parent 9c4c28e566
commit 6a183d6498
55 changed files with 3985 additions and 42 deletions
@@ -2,8 +2,7 @@
namespace App\Domains\Admin\Controllers;
use App\Domains\ParticipantInvoice\ParticipantInvoiceTokens;
use App\Models\DocumentTemplate;
use App\Models\DocumentTypeCatalog;
use App\Providers\DocumentTemplateRenderProvider;
use App\Providers\PdfGenerateAndDownloadProvider;
use App\Scopes\CommonController;
@@ -17,10 +16,16 @@ class DocumentTemplatesPreviewController extends CommonController
{
public function __invoke(Request $request): Response
{
$documentType = (string) $request->input('type', DocumentTypeCatalog::default());
if (!DocumentTypeCatalog::has($documentType)) {
abort(422, 'Unbekannte Dokumentart.');
}
$html = new DocumentTemplateRenderProvider(
DocumentTemplate::TYPE_PARTICIPANT_INVOICE,
$documentType,
(array) $request->input('blocks', []),
)->render(ParticipantInvoiceTokens::sample());
)->render(DocumentTypeCatalog::sampleTokens($documentType));
return response(PdfGenerateAndDownloadProvider::fromHtml($html, 'portrait'), 200, [
'Content-Type' => 'application/pdf',