From 2bf0292ca3e3713024a08c391bcec698701d0756 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sat, 17 Jul 2021 17:00:27 +0200 Subject: [PATCH] Fixed: Order payments in pdf by nr --- app/Pdf/BillType.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Pdf/BillType.php b/app/Pdf/BillType.php index c4986ad2..9e977b09 100644 --- a/app/Pdf/BillType.php +++ b/app/Pdf/BillType.php @@ -57,7 +57,8 @@ class BillType extends Repository implements PdfRepository public function getPositions(Collection $page): array { $memberIds = $page->pluck('id')->toArray(); - $payments = Payment::whereIn('member_id', $memberIds)->whereNeedsBill()->get(); + $payments = Payment::whereIn('member_id', $memberIds) + ->orderByRaw('nr, member_id')->whereNeedsBill()->get(); return $payments->mapWithKeys(function (Payment $payment) { $key = "Beitrag für {$payment->nr} ({$payment->subscription->name})";