From aa92d66ff4d60b6fa669645285521e750df20234 Mon Sep 17 00:00:00 2001 From: Matt Young Date: Wed, 10 Sep 2025 18:44:43 -0500 Subject: [PATCH] Update one fee per entry - don't charge if an entry is for advancement only. --- app/Services/Invoice/InvoiceOneFeePerEntry.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Services/Invoice/InvoiceOneFeePerEntry.php b/app/Services/Invoice/InvoiceOneFeePerEntry.php index 6577546..afe8251 100644 --- a/app/Services/Invoice/InvoiceOneFeePerEntry.php +++ b/app/Services/Invoice/InvoiceOneFeePerEntry.php @@ -35,7 +35,10 @@ class InvoiceOneFeePerEntry implements InvoiceDataService /** @noinspection PhpArrayIndexImmediatelyRewrittenInspection */ $invoiceData['grandTotal'] = 0; - $entries = $school->entries()->with('audition')->orderBy('created_at', 'desc')->get()->groupBy('student_id'); + $entries = $school->entries()->where('for_seating', true) + ->with('audition') + ->orderBy('created_at', 'desc')->get() + ->groupBy('student_id'); foreach ($school->students as $student) { foreach ($entries[$student->id] ?? [] as $entry) { $entryFee = $entry->audition->entry_fee / 100;