Move billing charge service::class methods into __get(), no functional changes

This commit is contained in:
2025-05-21 15:14:34 +10:00
parent 2b06eca080
commit 4b429cbf20
9 changed files with 49 additions and 81 deletions

View File

@@ -43,14 +43,14 @@
@if(($o->active || $o->isPending()) && (! $o->external_billing))
<tr>
<th>Billed</th>
<td>{{ $o->billing_interval_string }}</td>
<td>{{ $o->billing_interval_name }}</td>
</tr>
<tr>
<th>Amount</th>
@if($o->is_charge_overridden)
<td>@if($o->billing_charge < $o->charge_orig)<del>${{ number_format($o->charge_orig,2) }}</del> @endif${{ number_format($o->billing_charge,2) }}</td>
<td>@if($o->billing_charge < $o->billing_orig)<del>${{ number_format($o->billing_orig_taxed,2) }}</del> @endif${{ number_format($o->billing_charge_taxed,2) }}</td>
@else
<td>${{ number_format($o->billing_charge,2) }}</td>
<td>${{ number_format($o->billing_charge_taxed,2) }}</td>
@endif
</tr>
@if($o->isActive() && $o->invoiced_to)

View File

@@ -55,11 +55,11 @@
<tr>
<th>Billed</th>
<td>{{ $o->billing_interval_string }}</td>
<td>{{ $o->billing_interval_name }}</td>
<td>{{ $c->type->billing_interval_string }}</td>
<td>&nbsp;</td>
@if($p->exists)
<td>{{ $o->billing_interval_string }}</td>
<td>{{ $o->billing_interval_name }}</td>
<td>{{ $p->type->billing_interval_string }}</td>
<td>&nbsp;</td>
@endif
@@ -67,7 +67,7 @@
<tr>
<th>Billing Price</th>
<td @class(['text-danger'=>$o->is_charge_overridden])>${{ number_format($b=$o->billing_charge,2) }}</td>
<td @class(['text-danger'=>$o->is_charge_overridden])>${{ number_format($b=$o->billing_charge_taxed,2) }}</td>
<td @class(['text-danger'=>$o->is_cost_overridden])>${{ number_format($a=$o->billing_cost,2) }}</td>
<td>{!! markup($a,$b) !!}</td>
@if($p->exists)
@@ -81,14 +81,14 @@
<th>Monthly Price</th>
<td @class(['text-danger'=>$o->is_charge_overridden])>
@if($o->is_charge_overridden)
<abbr title="${{ number_format($b=$o->account->taxed($c->base_charge)*Invoice::billing_change($o->billing_interval,Invoice::BILL_MONTHLY),2) }}">${{ number_format($b=$o->billing_charge_normalised,2) }}
<abbr title="${{ number_format($b=$o->billing_orig_normalised_taxed,2) }}">${{ number_format($b=$o->billing_charge_normalised_taxed,2) }}
@else
${{ number_format($b=$o->billing_charge_normalised,2) }}
${{ number_format($b=$o->billing_charge_normalised_taxed,2) }}
@endif
</td>
<td @class(['text-danger'=>$o->is_cost_overridden])>
@if($o->is_cost_overridden)
<abbr title="${{ number_format($a=$o->account->taxed($c->base_cost)*Invoice::billing_change($o->billing_interval,Invoice::BILL_MONTHLY),2) }}">${{ number_format($b=$o->billing_cost_normalised,2) }}
<abbr title="${{ number_format($a=$o->account->taxed($c->base_cost)*Invoice::billing_change($c->billing_interval,Invoice::BILL_MONTHLY),2) }}">${{ number_format($b=$o->billing_cost_normalised,2) }}
@else
${{ number_format($a=$o->billing_cost_normalised,2) }}
@endif