Fix: Set From long name in City solingen document
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2023-10-27 00:15:02 +02:00
parent bda8b9c293
commit 50d98c0335
3 changed files with 31 additions and 1 deletions

View File

@ -3,6 +3,7 @@
namespace App\Contribution\Documents;
use App\Contribution\Data\MemberData;
use App\Invoice\InvoiceSettings;
use Carbon\Carbon;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
@ -11,6 +12,8 @@ use Zoomyboy\Tex\Template;
class CitySolingenDocument extends ContributionDocument
{
public string $fromName;
/**
* @param Collection<int, MemberData> $members
*/
@ -22,6 +25,7 @@ class CitySolingenDocument extends ContributionDocument
public string $eventName,
public string $type = 'F',
) {
$this->fromName = app(InvoiceSettings::class)->from_long;
}
/**

View File

@ -92,7 +92,7 @@
\node[align=left,inner sep=0cm,anchor=west] at (options-2-4.west) {\tikz{\node[draw,very thick,rectangle,text height=0.5cm,text width=0.5cm,inner sep=0cm] (checkbox) at (0,0) {}; \draw[thick] (checkbox.south east) ++(0.2cm,0) -- (checkbox.south east -| options-2-4.south east);}};
\node[anchor=north west] (org) at ($(options.south west)+(0cm,-0.5cm)$) {\large{Veranstalter:}};
\draw (org.south east -| options-2-2.south west) -- (org.south east -| options-2-4.south east) node[formfill] {DPSG Stamm Silva Solingen Wald};
\draw (org.south east -| options-2-2.south west) -- (org.south east -| options-2-4.south east) node[formfill] {<<<$fromName>>>};
\node[anchor=north west] (title) at ($(org.south west)+(0cm,-0.5cm)$) {\large{Titel der Maßnahme:}};
\draw (title.south east -| options-2-2.south west) -- (title.south east -| options-2-4.south east) node[formfill] {<<<$eventName>>>};

View File

@ -7,6 +7,7 @@ use App\Contribution\Documents\RdpNrwDocument;
use App\Contribution\Documents\CitySolingenDocument;
use App\Country;
use App\Gender;
use App\Invoice\InvoiceSettings;
use App\Member\Member;
use Generator;
use Illuminate\Foundation\Testing\DatabaseTransactions;
@ -56,6 +57,31 @@ class StoreTest extends TestCase
Tex::assertCompiled($type, fn ($document) => $document->hasAllContent($bodyChecks));
}
public function testItCompilesGroupNameInSolingenDocument(): void
{
$this->withoutExceptionHandling()->login()->loginNami();
Tex::spy();
$member = Member::factory()->defaults()->for(Gender::factory())->create();
InvoiceSettings::fake([
'from_long' => 'Stamm BiPi',
]);
$this->call('GET', '/contribution-generate', [
'payload' => base64_encode(json_encode([
'country' => Country::factory()->create()->id,
'dateFrom' => '1991-06-15',
'dateUntil' => '1991-06-16',
'eventName' => 'Super tolles Lager',
'members' => [$member->id],
'type' => CitySolingenDocument::class,
'zipLocation' => '42777 SG',
])),
]);
Tex::assertCompiled(CitySolingenDocument::class, fn ($document) => $document->hasAllContent(['Stamm BiPi']));
}
public function testItCompilesContributionDocumentsViaApi(): void
{
$this->withoutExceptionHandling();