Improve contribution Frankfurt

This commit is contained in:
Arwed Molitor 2024-03-12 13:52:10 +01:00
parent 58d7c5671f
commit fecd461aef
2 changed files with 11 additions and 3 deletions

View File

@ -4,13 +4,17 @@ namespace App\Contribution\Documents;
use App\Contribution\Data\MemberData;
use App\Country;
use App\Invoice\InvoiceSettings;
use Carbon\Carbon;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use Zoomyboy\Tex\Engine;
use Zoomyboy\Tex\Template;
class CityFrankfurtMainDocument extends ContributionDocument
{
public string $fromName;
/**
* @param Collection<int, Collection<int, MemberData>> $members
*/
@ -20,9 +24,11 @@ class CityFrankfurtMainDocument extends ContributionDocument
public string $zipLocation,
public ?Country $country,
public Collection $members,
public string $eventName,
public ?string $filename = '',
public string $type = 'F',
) {
$this->fromName = app(InvoiceSettings::class)->from_long;
}
/**
@ -36,6 +42,7 @@ class CityFrankfurtMainDocument extends ContributionDocument
zipLocation: $request['zipLocation'],
country: Country::where('id', $request['country'])->firstOrFail(),
members: MemberData::fromModels($request['members'])->chunk(15),
eventName: $request['eventName'],
);
}
@ -50,6 +57,7 @@ class CityFrankfurtMainDocument extends ContributionDocument
zipLocation: $request['zipLocation'],
country: Country::where('id', $request['country'])->firstOrFail(),
members: MemberData::fromApi($request['member_data'])->chunk(15),
eventName: $request['eventName'],
);
}
@ -96,7 +104,7 @@ class CityFrankfurtMainDocument extends ContributionDocument
public function basename(): string
{
return 'zuschuesse-frankfurt';
return 'zuschuesse-frankfurt-' . Str::slug($this->eventName);
}
public function view(): string

View File

@ -15,8 +15,8 @@
@foreach($members as $i => $chunk)
\begin{tikzpicture}[remember picture,overlay,yscale=-1]
%\node[anchor=base west, text width=205.3mm] at (52.9mm,31.0mm) {\bfseries{\large{}}}; %Feld: Jugendverband/-Gruppe
%\node[anchor=base west, text width=215.9mm] at (41.3mm,38.8mm) {\bfseries{\large{}}}; %Feld: Art der Maßnahme
\node[anchor=base west, text width=205.3mm] at (52.9mm,31.0mm) {\bfseries{\large{<<<!!$fromName!!>>>}}}; %Feld: Jugendverband/-Gruppe
\node[anchor=base west, text width=215.9mm] at (41.3mm,38.8mm) {\bfseries{\large{<<<!!$eventName!!>>>}}}; %Feld: Art der Maßnahme
\node[anchor=base west, text width=104.8mm] at (17.5mm,47.0mm) {\bfseries{\large{<<<!!$zipLocation!!>>>, <<<!!$countryName!!>>>}}};
\node[anchor=base west, text width=41.3mm, align=center] at (170.7mm,47.0mm) {\bfseries{\large{<<<!!$dateFromHuman()!!>>>}}};
\node[anchor=base west, text width=38.4mm, align=center] at (219.9mm,47.0mm) {\bfseries{\large{<<<!!$dateUntilHuman()!!>>>}}};