only bill for students entered for seating.

This commit is contained in:
Matt Young 2025-11-05 06:40:39 -06:00
parent 834de902ac
commit 7347059d96
2 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ class InvoiceOneFeePerStudent 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) {
$firstEntryForStudent = true;
foreach ($entries[$student->id] ?? [] as $entry) {

View File

@ -35,7 +35,7 @@ class InvoiceOneFeePerStudentPerEvent 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) {
$eventsEntered = [];
foreach ($entries[$student->id] ?? [] as $entry) {