Invoice rendering for service, and unit testing for Invoice Item quantity

This commit is contained in:
Deon George
2020-02-06 18:31:43 +09:00
parent 5f5d114f42
commit ebd4367975
14 changed files with 541 additions and 236 deletions

View File

@@ -1,11 +1,10 @@
<div class="card">
<!-- @todo -->
@if($o->service->isPending())
<div class="ribbon-wrapper ribbon-lg">
<div class="ribbon bg-warning">
Pending
<div class="ribbon-wrapper ribbon-lg">
<div class="ribbon bg-warning">
Pending
</div>
</div>
</div>
@endif
<div class="card-header bg-gray-dark">

View File

@@ -2,38 +2,53 @@
<div class="card-header bg-light">
<h3 class="card-title">Service Information</h3>
</div>
<div class="card-body bg-light">
<table class="table table-sm">
<tr>
<th>Status</th>
<td>{{ $o->status }}</td>
<td>{!! $o->status_html !!}</td>
</tr>
@if ($o->active)
@if ($o->active or $o->isPending())
<tr>
<th>Billed</th>
<td>{{ $o->billing_period }}</td>
</tr>
<tr>
<th>Invoiced To</th>
<td>{{ $o->invoice_to->format('Y-m-d') }}</td>
</tr>
<tr>
<th>Paid Until</th>
<td>{{ $o->paid_to->format('Y-m-d') }}</td>
</tr>
@if($o->active)
<tr>
<th>Invoiced To</th>
<td>{{ $o->invoice_to->format('Y-m-d') }}</td>
</tr>
<tr>
<th>Paid Until</th>
<td>{{ $o->paid_to->format('Y-m-d') }}</td>
</tr>
@endif
<tr>
<th>Next Invoice</th>
<td>{{ $o->invoice_next->format('Y-m-d') }}</td>
</tr>
<tr>
<th>Estimated Invoice</th>
<td>${{ number_format($o->billing_price,2) }}</td>
</tr>
<tr>
<th>Next Estimated Invoice</th>
<td>${{ number_format($o->next_invoice_items()->sum('total'),2) }} <sup>*</sup></td>
</tr>
<tr>
<th>Payment Method</th>
<td>@if ($o->autopay)Direct Debit @else Invoice @endif</td>
</tr>
@else
<tr>
<th>Cancelled</th>
<td>{!! $o->date_end ? $o->date_end->format('Y-m-d') : $o->paid_to->format('Y-m-d').'<sup>*</sup>' !!}</td>
</tr>
@endif
<tr>
<th>Payment Method</th>
<td>@if ($o->autopay)Direct Debit @else Invoice @endif</td>
</tr>
</table>
</div>
@if($o->active OR $o->isPending())
<div class="card-footer sm">
<strong><sup>*</sup>NOTE:</strong> Estimated Invoice does not include any setup, connection nor all current billing cycle usage charges.
</div>
@endif
</div>