Optimise Service model

This commit is contained in:
2024-07-07 15:02:02 +10:00
parent b4f3db04fc
commit 0d9dbafcf1
10 changed files with 153 additions and 242 deletions

View File

@@ -1,3 +1,4 @@
<!-- $o=Service::class -->
<table class="table table-sm" id="svc_bill_hist">
<thead>
<tr>

View File

@@ -20,7 +20,7 @@
</tr>
<tr>
<th>Status</th>
<td>{!! $o->status_html !!}</td>
<td>@include('theme.backend.adminlte.service.widget.status')</td>
</tr>
@if ($o->order_status == 'ORDER-SENT')
<tr>
@@ -47,7 +47,7 @@
</tr>
<tr>
<th>Amount</th>
@if($o->isChargeOverriden())
@if($o->isChargeOverridden())
<td>@if ($o->billing_charge < $o->charge_orig)<del>${{ number_format($o->charge_orig,2) }}</del> @endif${{ number_format($o->billing_charge,2) }}</td>
@else
<td>${{ number_format($o->billing_charge,2) }}</td>

View File

@@ -61,11 +61,11 @@
<tr>
<th>Billing Price</th>
<td @if($o->isChargeOverriden())class="text-danger"@endif>${{ number_format($b=$o->billing_charge,2) }}</td>
<td @if($o->isChargeOverridden())class="text-danger"@endif>${{ number_format($b=$o->billing_charge,2) }}</td>
<td>${{ number_format($a=$o->account->taxed($c->base_cost),2) }}</td>
<td>{!! markup($a,$b) !!}</td>
@if ($p->exists)
<td @if($o->isChargeOverriden())class="text-danger"@endif>${{ number_format($b=$o->account->taxed($p->base_charge),2) }}</td>
<td @if($o->isChargeOverridden())class="text-danger"@endif>${{ number_format($b=$o->account->taxed($p->base_charge),2) }}</td>
<td>${{ number_format($a=$o->account->taxed($p->base_cost),2) }}</td>
<td>{!! markup($a,$b) !!}</td>
@endif
@@ -73,7 +73,7 @@
<tr>
<th>Monthly Price</th>
<td @if($x=$o->isChargeOverriden()) class="text-danger" @endif>
<td @if($x=$o->isChargeOverridden()) class="text-danger" @endif>
@if($x)
<abbr title="${{ number_format($b=$o->account->taxed($c->base_charge)*\App\Models\Invoice::billing_change($o->billing_interval,\App\Models\Invoice::BILL_MONTHLY),2) }}">${{ number_format($b=$o->billing_monthly_price,2) }}
@else
@@ -83,7 +83,7 @@
<td>${{ number_format($a=$o->account->taxed($c->base_cost)*\App\Models\Invoice::billing_change($o->billing_interval,\App\Models\Invoice::BILL_MONTHLY),2) }}</td>
<td>{!! markup($a,$b) !!}</td>
@if ($p->exists)
<td @if($x=$o->isChargeOverriden()) class="text-danger" @endif>${{ number_format($b=$o->account->taxed($p->base_charge)*\App\Models\Invoice::billing_change($o->billing_interval,\App\Models\Invoice::BILL_MONTHLY),2) }}</td>
<td @if($x=$o->isChargeOverridden()) class="text-danger" @endif>${{ number_format($b=$o->account->taxed($p->base_charge)*\App\Models\Invoice::billing_change($o->billing_interval,\App\Models\Invoice::BILL_MONTHLY),2) }}</td>
<td>${{ number_format($a=$o->account->taxed($p->base_cost)*\App\Models\Invoice::billing_change($o->billing_interval,\App\Models\Invoice::BILL_MONTHLY),2) }}</td>
<td>{!! markup($a,$b) !!}</td>
@endif

View File

@@ -0,0 +1,12 @@
<!-- $o=Service::class -->
<span class="badge @if($o->isPending())badge-warning @else
@switch ($o->status)
@case('ACTIVE')
badge-success
@break;
@case('INACTIVE')
badge-danger
@break;
@endswitch
@endif
">{{ $o->status }}</span>