All Lists finalized
This commit is contained in:
@@ -133,7 +133,6 @@ class DetailsController extends CommonController {
|
||||
|
||||
$participants = $this->eventParticipants->getForList($event, $request);
|
||||
$kitchenOverview = $this->eventParticipants->getKitchenOverview($event);
|
||||
|
||||
$html = view('pdfs.' . $listType, [
|
||||
'event' => $event->name,
|
||||
'eventStart' => $event->start_date,
|
||||
@@ -153,4 +152,22 @@ class DetailsController extends CommonController {
|
||||
'Content-Disposition' => 'attachment; filename="' . $listType .'.pdf"',
|
||||
]);
|
||||
}
|
||||
|
||||
public function downloadCsvList(string $eventId, string $listType, Request $request): Response
|
||||
{
|
||||
$event = $this->events->getByIdentifier($eventId);
|
||||
|
||||
$participants = $this->eventParticipants->getForList($event, $request);
|
||||
$kitchenOverview = $this->eventParticipants->getKitchenOverview($event);
|
||||
|
||||
$csv = view('csvs.' . $listType, [
|
||||
'event' => $event->name,
|
||||
'rows' => $participants,
|
||||
])->render();
|
||||
|
||||
return response($csv, 200, [
|
||||
'Content-Type' => 'text/csv; charset=UTF-8',
|
||||
'Content-Disposition' => 'attachment; filename="' . $listType . '.csv"',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ Route::middleware(IdentifyTenant::class)->group(function () {
|
||||
Route::get('/new', CreateController::class);
|
||||
Route::get('/details/{eventId}', DetailsController::class);
|
||||
Route::get('/details/{eventId}/pdf/{listType}', [DetailsController::class, 'downloadPdfList']);
|
||||
Route::get('/details/{eventId}/csv/{listType}', [DetailsController::class, 'downloadCsvList']);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -64,8 +64,10 @@ import {onMounted, reactive, ref} from "vue";
|
||||
<input type="button" value="Erste-Hilfe-Liste (PDF)" />
|
||||
</a><br/>
|
||||
|
||||
<input type="button" value="Teili-Liste (CSV)" /><br/>
|
||||
<input type="button" value="KSV-Daten (CSV)" /><br/>
|
||||
<a :href="'/event/details/' + props.data.event.identifier + '/csv/participant-list'">
|
||||
<input type="button" value="Teili-Liste (CSV)" />
|
||||
</a><br/>
|
||||
|
||||
<a :href="'/event/details/' + props.data.event.identifier + '/pdf/kitchen-list'">
|
||||
<input type="button" value="Küchenübersicht (PDF)" />
|
||||
</a><br/>
|
||||
@@ -74,8 +76,13 @@ import {onMounted, reactive, ref} from "vue";
|
||||
<input type="button" value="Beitragsliste (PDF)" />
|
||||
</a><br/>
|
||||
|
||||
<input type="button" value="Getränkeliste (PDF)" /><br/>
|
||||
<input type="button" value="Foto-Erlaubnis (PDF)" /><br/>
|
||||
<a :href="'/event/details/' + props.data.event.identifier + '/pdf/drinking-list'">
|
||||
<input type="button" value="Getränkeliste (PDF)" />
|
||||
</a><br/>
|
||||
|
||||
<a :href="'/event/details/' + props.data.event.identifier + '/pdf/photo-permission-list'">
|
||||
<input type="button" value="Foto-Erlaubnis (PDF)" />
|
||||
</a><br/>
|
||||
<input type="button" class="fix-button" value="Zahlungserinnerung senden" /><br/>
|
||||
<input type="button" class="deny-button" value="Letzte Mahnung senden" /><br/>
|
||||
<input type="button" value="Rundmail senden" /><br/>
|
||||
|
||||
@@ -51,8 +51,13 @@ class EventParticipantResource extends JsonResource
|
||||
'email_1' => $this->resource->email_1,
|
||||
'amountPaid' => ['value' => $this->resource->amount_paid, 'readable' => $this->resource->amount_paid?->toString() ?? '0,00 Euro'],
|
||||
'amountExpected' => ['value' => $this->resource->amount, 'readable' => $this->resource->amount?->toString() ?? '0,00 Euro'],
|
||||
'alcoholicsAllowed' => new Age($this->resource->birthday)->getAge() >= $event->alcoholics_age,
|
||||
'localGroupPostcode' => $this->resource->localGroup()->first()->postcode,
|
||||
'localGroupCity' => $this->resource->localGroup()->first()->city,
|
||||
'state' => config('postCode.map.' . $this->resource->postcode),
|
||||
'localGroupState' => config('postCode.map.' . $this->resource->localGroup()->first()->postcode),
|
||||
'birthday' => $this->resource->birthday->format('d.m.Y'),
|
||||
]
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
27413
config/postCode.php
Normal file
27413
config/postCode.php
Normal file
File diff suppressed because it is too large
Load Diff
11
resources/views/csvs/participant-list.blade.php
Normal file
11
resources/views/csvs/participant-list.blade.php
Normal file
@@ -0,0 +1,11 @@
|
||||
@php
|
||||
$rows = $rows ?? [];
|
||||
@endphp
|
||||
|
||||
"Name", "Vorname", "Geburtsdatum", "Postleitzahl (Privat), "Postleitzahl (Stamm)", "Wohnort (Privat)", "Wohnort (Stamm)", "Bundesland (Privat)", "Bundesland (Stamm)", "Alter", "Stamm", "Teilnahmegruppe", "Anreise", "Abreise", "Beitrag gezahlt", "Beitrag"
|
||||
@foreach($rows as $index => $row)
|
||||
"{{ $row['lastname']}}","{{ $row['firstname'] }}","{{ $row['birthday'] }}","{{ $row['postcode'] }}","{{ $row['localGroupPostcode'] }}","{{ $row['city'] }}","{{ $row['localGroupCity'] }}","{{ $row['state'] }}","{{ $row['localGroupState'] }}","{{ $row['age'] }}","{{ $row['localgroup'] }}","{{ $row['participationType'] }}","{{ $row['arrival'] }}","{{ $row['departure'] }}","{{ $row['amountPaid']['readable'] }}","{{ $row['amountExpected']['readable'] }}"
|
||||
@endforeach
|
||||
|
||||
|
||||
|
||||
82
resources/views/pdfs/drinking-list.blade.php
Normal file
82
resources/views/pdfs/drinking-list.blade.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
@page {
|
||||
margin: 15mm 10mm;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: DejaVu Sans, sans-serif;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 8mm;
|
||||
}
|
||||
|
||||
th, td {
|
||||
border: 1px solid #000;
|
||||
padding: 6px 8px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
td {
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
th {
|
||||
background: #f2f2f2;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.page-break {
|
||||
page-break-after: always;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@php
|
||||
$rows = $rows ?? [];
|
||||
$chunks = array_chunk($rows, 8);
|
||||
@endphp
|
||||
|
||||
@foreach($chunks as $chunk)
|
||||
<h1>Getränke-Liste {{$event}}</h1>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 2cm;">Name, Alter</th>
|
||||
<th style="width: 2cm;">Stamm</th>
|
||||
<th style="width: 3cm;">Softdrinks 1</th>
|
||||
<th style="width: 3cm;">Softdrinks 2</th>
|
||||
<th style="width: 3cm;">Softdrinks 3</th>
|
||||
<th style="width: 3cm;">Softdrinks 4</th>
|
||||
<th style="width: 3cm;">alk. Getränk 1</th>
|
||||
<th style="width: 3cm;">alk. Getränk 2</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($chunk as $index => $row)
|
||||
<tr>
|
||||
<td>{{ $row['lastname']}},<br />{{ $row['firstname'] }}<br /> {{$row['age'] ?? ''}} Jahre</td>
|
||||
<td>{{ $row['localgroup'] ?? '' }}</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td style="font-weight: bold; font-size: 12pt; text-align: center; vertical-align: middle;">{{ $row['alcoholicsAllowed'] ? '' : 'keine Abgabe' }}</td>
|
||||
<td style="font-weight: bold; font-size: 12pt; text-align: center; vertical-align: middle;">{{ $row['alcoholicsAllowed'] ? '' : 'keine Abgabe' }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@if(! $loop->last)
|
||||
@endif
|
||||
@endforeach
|
||||
</body>
|
||||
</html>
|
||||
83
resources/views/pdfs/photo-permission-list.blade.php
Normal file
83
resources/views/pdfs/photo-permission-list.blade.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<style>
|
||||
@page {
|
||||
margin: 15mm 10mm;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: DejaVu Sans, sans-serif;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 8mm;
|
||||
}
|
||||
|
||||
th, td {
|
||||
border: 1px solid #000;
|
||||
padding: 6px 8px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
td {
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
th {
|
||||
background: #f2f2f2;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.page-break {
|
||||
page-break-after: always;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@php
|
||||
$rows = $rows ?? [];
|
||||
$chunks = array_chunk($rows, 8);
|
||||
@endphp
|
||||
|
||||
@foreach($chunks as $chunk)
|
||||
<h1>Beitrags-Liste {{$event}}</h1>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 2cm;">Name, Alter</th>
|
||||
<th style="width: 2cm;">Stamm</th>
|
||||
<th style="width: 3.0cm;">Anreise<br />Abreise</th>
|
||||
<th style="width: 3.0cm;">Fotos<br />Printmedien</th>
|
||||
<th style="width: 3.0cm;">Fotos<br />Webseite</th>
|
||||
<th style="width: 3.0cm;">Fotos<br />Social Media</th>
|
||||
<th style="width: 3.0cm;">Fotos<br />Partnermailings</th>
|
||||
<th style="width: 3.0cm;">Fotos<br />Interne Zwecke</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($chunk as $index => $row)
|
||||
<tr>
|
||||
<td>{{ $row['lastname']}},<br />{{ $row['firstname'] }}<br /> {{$row['age'] ?? ''}} Jahre</td>
|
||||
<td>{{ $row['localgroup'] ?? '' }}</td>
|
||||
<td>{{ $row['arrival'] ?? '' }}<br />{{$row['departure']}}<br />{{$row['presenceDays']['real']}} Tage</td>
|
||||
<td style="text-align:center; vertical-align: middle; font-weight: bold;">{{ $row['foto_print'] ? 'Ja' : 'Nein' }}</td>
|
||||
<td style="text-align:center; vertical-align: middle; font-weight: bold;">{{ $row['foto_webseite'] ? 'Ja' : 'Nein' }}</td>
|
||||
<td style="text-align:center; vertical-align: middle; font-weight: bold;">{{ $row['foto_socialmedia'] ? 'Ja' : 'Nein' }}</td>
|
||||
<td style="text-align:center; vertical-align: middle; font-weight: bold;">{{ $row['foto_partner'] ? 'Ja' : 'Nein' }}</td>
|
||||
<td style="text-align:center; vertical-align: middle; font-weight: bold;">{{ $row['foto_intern'] ? 'Ja' : 'Nein' }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@if(! $loop->last)
|
||||
@endif
|
||||
@endforeach
|
||||
</body>
|
||||
</html>
|
||||
@@ -2,7 +2,64 @@
|
||||
|
||||
use Illuminate\Foundation\Inspiring;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
Artisan::command('inspire', function () {
|
||||
$this->comment(Inspiring::quote());
|
||||
})->purpose('Display an inspiring quote');
|
||||
|
||||
// ... existing code ...
|
||||
|
||||
Artisan::command('postcode:generate-config', function () {
|
||||
$csvPath = storage_path('app/PLZ-Liste.csv');
|
||||
$configPath = config_path('postCode.php');
|
||||
|
||||
if (! File::exists($csvPath)) {
|
||||
$this->error('CSV-Datei nicht gefunden: ' . $csvPath);
|
||||
return 1;
|
||||
}
|
||||
|
||||
$handle = fopen($csvPath, 'r');
|
||||
|
||||
if ($handle === false) {
|
||||
$this->error('CSV-Datei konnte nicht geöffnet werden.');
|
||||
return 1;
|
||||
}
|
||||
|
||||
$map = [];
|
||||
|
||||
$header = fgetcsv($handle, 0, ';');
|
||||
|
||||
while (($row = fgetcsv($handle, 0, ';')) !== false) {
|
||||
if (count($row) < 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$plz = trim($row[0]);
|
||||
$bundesland = trim($row[1]);
|
||||
|
||||
if ($plz === '' || $bundesland === '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$map[$plz] = $bundesland;
|
||||
}
|
||||
|
||||
fclose($handle);
|
||||
|
||||
ksort($map);
|
||||
|
||||
$content = "<?php\n\nreturn [\n 'map' => [\n";
|
||||
|
||||
foreach ($map as $plz => $bundesland) {
|
||||
$content .= " '" . addslashes($plz) . "' => '" . addslashes($bundesland) . "',\n";
|
||||
}
|
||||
|
||||
$content .= " ],\n];\n";
|
||||
|
||||
File::put($configPath, $content);
|
||||
|
||||
$this->info('Config erfolgreich generiert: ' . $configPath);
|
||||
|
||||
return 0;
|
||||
})->purpose('Generate config/postCode.php from storage/app/PLZ-Liste.csv');
|
||||
|
||||
Reference in New Issue
Block a user