Fixed: Order payments in pdf by nr

This commit is contained in:
philipp lang 2021-07-17 17:00:27 +02:00
parent 3b94e12ea0
commit 2bf0292ca3
1 changed files with 2 additions and 1 deletions

View File

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