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})";