only bill for students entered for seating.
This commit is contained in:
parent
834de902ac
commit
7347059d96
|
|
@ -35,7 +35,7 @@ class InvoiceOneFeePerStudent implements InvoiceDataService
|
||||||
/** @noinspection PhpArrayIndexImmediatelyRewrittenInspection */
|
/** @noinspection PhpArrayIndexImmediatelyRewrittenInspection */
|
||||||
$invoiceData['grandTotal'] = 0;
|
$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 ($school->students as $student) {
|
||||||
$firstEntryForStudent = true;
|
$firstEntryForStudent = true;
|
||||||
foreach ($entries[$student->id] ?? [] as $entry) {
|
foreach ($entries[$student->id] ?? [] as $entry) {
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class InvoiceOneFeePerStudentPerEvent implements InvoiceDataService
|
||||||
/** @noinspection PhpArrayIndexImmediatelyRewrittenInspection */
|
/** @noinspection PhpArrayIndexImmediatelyRewrittenInspection */
|
||||||
$invoiceData['grandTotal'] = 0;
|
$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 ($school->students as $student) {
|
||||||
$eventsEntered = [];
|
$eventsEntered = [];
|
||||||
foreach ($entries[$student->id] ?? [] as $entry) {
|
foreach ($entries[$student->id] ?? [] as $entry) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue