#96 Add total column to Invoices and Invoice Reports

This commit is contained in:
Nisse Lommerde 2025-02-10 15:48:59 -05:00
parent 20dd032b40
commit 5bec1fc3d8
2 changed files with 9 additions and 2 deletions

View File

@ -183,6 +183,11 @@ public static function table(Table $table): Table
}) })
->alignRight(), ->alignRight(),
TextColumn::make('total')
->money()
->alignRight()
->weight(FontWeight::Medium),
TextColumn::make('balance') TextColumn::make('balance')
->getStateUsing(fn (Invoice $record) => $record->remainingBalance()) ->getStateUsing(fn (Invoice $record) => $record->remainingBalance())
->money() ->money()

View File

@ -72,7 +72,7 @@
</div> </div>
<br> <br>
<div> <div>
${{number_format($invoiceReport->balance, 2)}} ${{number_format($invoiceReport->invoices->sum(fn ($invoice) => $invoice->remainingBalance()) , 2)}}
</div> </div>
</div> </div>
</div> </div>
@ -87,6 +87,7 @@
<th class="text-end">Subtotal</th> <th class="text-end">Subtotal</th>
<th class="text-end">GST/HST</th> <th class="text-end">GST/HST</th>
<th class="text-end">PST</th> <th class="text-end">PST</th>
<th class="text-end">Total</th>
<th class="text-end">Balance</th> <th class="text-end">Balance</th>
<th class="text-end">Status</th> <th class="text-end">Status</th>
</tr> </tr>
@ -107,7 +108,8 @@
@endif @endif
</td> </td>
<td class="text-end">{{!$invoice->has_pst ? '$'.number_format($invoice->pst_amount, 2) : '-'}}</td> <td class="text-end">{{$invoice->has_pst ? '$'.number_format($invoice->pst_amount, 2) : '-'}}</td>
<td class="text-end">${{number_format($invoice->total, 2)}}</td>
<td class="text-end">${{number_format($invoice->remainingBalance(), 2)}}</td> <td class="text-end">${{number_format($invoice->remainingBalance(), 2)}}</td>
<td class="text-end">{{$invoice->status->value}}</td> <td class="text-end">{{$invoice->status->value}}</td>
</tr> </tr>