Update one fee per entry - don't charge if an entry is for advancement only.
This commit is contained in:
parent
4f46328026
commit
aa92d66ff4
|
|
@ -35,7 +35,10 @@ class InvoiceOneFeePerEntry 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) {
|
||||||
foreach ($entries[$student->id] ?? [] as $entry) {
|
foreach ($entries[$student->id] ?? [] as $entry) {
|
||||||
$entryFee = $entry->audition->entry_fee / 100;
|
$entryFee = $entry->audition->entry_fee / 100;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue