Invoicing Feature Complete #8

Merged
okorpheus merged 7 commits from invoicing into master 2024-06-29 15:27:15 +00:00
3 changed files with 23 additions and 10 deletions
Showing only changes of commit 9dd2c2d823 - Show all commits

View File

@ -21,9 +21,15 @@ class AuditionSettings extends Controller
'organizerName' => ['required'],
'organizerEmail' => ['required', 'email'],
'registrationCode' => ['required'],
'late_fee' => ['nullable', 'numeric'],
'school_fee' => ['nullable', 'numeric'],
'fee_structure' => ['required', 'in:oneFeePerEntry,oneFeePerStudent'], // Options should align with the boot method of InvoiceDataServiceProvider
'late_fee' => ['nullable', 'numeric', 'min:0'],
'school_fee' => ['nullable', 'numeric', 'min:0'],
]);
// Store currency values as cents
$validData['late_fee'] = $validData['late_fee'] * 100;
$validData['school_fee'] = $validData['school_fee'] * 100;
// TODO implement olympic scoring
foreach ($validData as $key => $value) {
Settings::set($key, $value);

View File

@ -42,12 +42,19 @@
<x-form.select name="fee_structure" colspan="6">
<x-slot:label>Fee Structure</x-slot:label>
<option>One fee per entry</option>
<option>One fee per student</option>
{{-- Values should be one of the options in the boot method InvoiceDataServiceProvider --}}
<option value="oneFeePerEntry">One fee per entry</option>
<option value="oneFeePerStudent">One fee per student - one late fee per student if any of their entries are late</option>
</x-form.select>
<x-form.field label_text="Late Fee" name="late_fee" colspan="3" :value="auditionSetting('late_fee')"/>
<x-form.field label_text="School Membership Fee" name="school_fee" colspan="3" :value="auditionSetting('school_fee')"/>
<x-form.field label_text="Late Fee"
name="late_fee"
colspan="3"
:value="number_format(auditionSetting('late_fee') / 100,2) "/>
<x-form.field label_text="School Membership Fee"
name="school_fee"
colspan="3"
:value="number_format(auditionSetting('school_fee') / 100,2)"/>
</x-form.body-grid>
</x-layout.page-section>

View File

@ -2,9 +2,9 @@
<x-layout.app>
<x-slot:page_title>Invoice - {{ $school->name }}</x-slot:page_title>
<div class="relative max-h-96 overflow-y-auto">
<x-table.table class="my-6 pb-6 border-collapse">
<thead class="sticky top-0 z-10">
<div class="">
<x-table.table class="">
<thead class="">
<tr>
<x-table.th>Student Name</x-table.th>
<x-table.th>Audition</x-table.th>
@ -24,7 +24,7 @@
</tr>
@endforeach
</x-table.body>
<tfoot class="sticky bottom-0 z-10">
<tfoot class="">
<tr>
<td colspan="2">
<x-table.th class="text-right">Totals</x-table.th>