tweak invoice

This commit is contained in:
Matt Young 2024-06-29 03:46:56 -05:00
parent 830b7362a4
commit cedb53b155
1 changed files with 43 additions and 37 deletions

View File

@ -2,43 +2,49 @@
<x-layout.app>
<x-slot:page_title>Invoice - {{ $school->name }}</x-slot:page_title>
@php( dump($invoiceData ))
<x-table.table class="mt-6">
<x-slot:title>Invoice</x-slot:title>
<thead>
<tr>
<x-table.th>Student Name</x-table.th>
<x-table.th>Audition</x-table.th>
<x-table.th>Entry Timestamp</x-table.th>
<x-table.th>Entry Fee</x-table.th>
<x-table.th>Late Fee</x-table.th>
</tr>
</thead>
<x-table.body>
@foreach($invoiceData['lines'] as $line)
<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">
<tr>
<x-table.th>Student Name</x-table.th>
<x-table.th>Audition</x-table.th>
<x-table.th>Entry Timestamp</x-table.th>
<x-table.th>Entry Fee</x-table.th>
<x-table.th>Late Fee</x-table.th>
</tr>
</thead>
<x-table.body>
@foreach($invoiceData['lines'] as $line)
<tr>
<x-table.td>{{ $line['student_name'] }}</x-table.td>
<x-table.td>{{ $line['audition'] }}</x-table.td>
<x-table.td>{{ $line['entry_timestamp']->setTimezone('America/Chicago')->format('m/d/Y g:i:s A') }}</x-table.td>
<x-table.td>${{ number_format($line['entry_fee'],2) }}</x-table.td>
<x-table.td>${{ number_format($line['late_fee'],2) }}</x-table.td>
</tr>
@endforeach
</x-table.body>
<tfoot class="sticky bottom-0 z-10">
<tr>
<x-table.td>{{ $line['student_name'] }}</x-table.td>
<x-table.td>{{ $line['audition'] }}</x-table.td>
<x-table.td>{{ $line['entry_timestamp']->setTimezone('America/Chicago')->format('m/d/Y g:i:s A') }}</x-table.td>
<x-table.td>${{ number_format($line['entry_fee'],2) }}</x-table.td>
<x-table.td>${{ number_format($line['late_fee'],2) }}</x-table.td>
<td colspan="2">
<x-table.th class="text-right">Totals</x-table.th>
<x-table.th>${{ number_format($invoiceData['linesTotal'],2) }}</x-table.th>
<x-table.th>${{ number_format($invoiceData['lateFeesTotal'],2) }}</x-table.th>
</tr>
@endforeach
</x-table.body>
<tfoot>
<tr>
<x-table.th colspan="3" class="text-right">Totals</x-table.th>
<x-table.th>${{ number_format($invoiceData['linesTotal'],2) }}</x-table.th>
<x-table.th>${{ number_format($invoiceData['lateFeesTotal'],2) }}</x-table.th>
</tr>
<tr>
<x-table.th colspan="4" class="text-right">School Fee</x-table.th>
<x-table.th >${{ number_format($invoiceData['schoolFeeTotal'],2) }}</x-table.th>
</tr>
<tr>
<x-table.th colspan="4" class="text-right">Grand Total</x-table.th>
<x-table.th >${{ number_format($invoiceData['grandTotal'],2) }}</x-table.th>
</tr>
</tfoot>
</x-table.table>
<tr>
<td colspan="3"></td>
<x-table.th class="text-right">Total Entry Fees</x-table.th>
<x-table.th>${{ number_format($invoiceData['linesTotal'] + $invoiceData['lateFeesTotal'], 2) }}</x-table.th>
</tr>
<tr>
<x-table.th colspan="4" class="text-right">School Fee</x-table.th>
<x-table.th >${{ number_format($invoiceData['schoolFeeTotal'],2) }}</x-table.th>
</tr>
<tr>
<x-table.th colspan="4" class="text-right">Grand Total</x-table.th>
<x-table.th >${{ number_format($invoiceData['grandTotal'],2) }}</x-table.th>
</tr>
</tfoot>
</x-table.table>
</div>
</x-layout.app>