From 84c80b5cc073ed69af75d5d25e0d284390007d66 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sat, 17 Jul 2021 17:21:30 +0200 Subject: [PATCH] Add name to payment table in pdf --- app/Pdf/BillType.php | 2 +- tests/Feature/Pdf/GenerateTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Pdf/BillType.php b/app/Pdf/BillType.php index 9e977b09..a3a9bd42 100644 --- a/app/Pdf/BillType.php +++ b/app/Pdf/BillType.php @@ -61,7 +61,7 @@ class BillType extends Repository implements PdfRepository ->orderByRaw('nr, member_id')->whereNeedsBill()->get(); return $payments->mapWithKeys(function (Payment $payment) { - $key = "Beitrag für {$payment->nr} ({$payment->subscription->name})"; + $key = "Beitrag {$payment->nr} für {$payment->member->firstname} {$payment->member->lastname} ({$payment->subscription->name})"; return [$key => $this->number($payment->subscription->amount)]; })->toArray(); diff --git a/tests/Feature/Pdf/GenerateTest.php b/tests/Feature/Pdf/GenerateTest.php index d4186923..f648d1b9 100644 --- a/tests/Feature/Pdf/GenerateTest.php +++ b/tests/Feature/Pdf/GenerateTest.php @@ -72,7 +72,7 @@ class GenerateTest extends TestCase 'output' => [ 'Rechnung', '15.00', - 'Beitrag für 1995 (::subName::)', + 'Beitrag 1995 für ::firstname:: ::lastname:: (::subName::)', 'Familie ::lastname::\\\\::street::\\\\::zip:: ::location::', ], ],