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

@@ -47,7 +47,7 @@
<td>{{ $oo->registrar_ns }}</td>
<td>@if ($oo->service->is_billed) {{ $oo->service->invoice_next->format('Y-m-d') }}@else - @endif</td>
<td>@if (! $oo->service->external_billing)${{ number_format($oo->service->next_invoice_items()->sum('total'),2) }}@else - @endif</td>
<td>{{ $oo->service->billing_interval_string }}</td>
<td>{{ $oo->service->billing_interval_name }}</td>
</tr>
@endforeach
</tbody>

View File

@@ -51,7 +51,7 @@
<td class="text-right">{{ number_format($oo->accounts ?: 0) }}</td>
<td>@if ($oo->service->is_billed) {{ $oo->service->invoice_next->format('Y-m-d') }} @else - @endif</td>
<td>@if (! $oo->service->external_billing)${{ number_format($oo->service->next_invoice_items()->sum('total'),2) }}@else - @endif</td>
<td>{{ $oo->service->billing_interval_string }}</td>
<td>{{ $oo->service->billing_interval_name }}</td>
</tr>
@endforeach
</tbody>

View File

@@ -45,7 +45,7 @@
<td>{{ $oo->service->product->supplier->name }}</td>
<td>@if ($oo->service->is_billed) {{ $oo->service->invoice_next->format('Y-m-d') }}@else - @endif</td>
<td>@if (! $oo->service->external_billing)${{ number_format($oo->service->next_invoice_items()->sum('total'),2) }}@else - @endif</td>
<td>{{ $oo->service->billing_interval_string }}</td>
<td>{{ $oo->service->billing_interval_name }}</td>
</tr>
@endforeach
</tbody>

View File

@@ -40,7 +40,7 @@
<td>{{ $o->name }}</td>
<td>{{ $o->product->name }}</td>
<td>{{ $o->supplierid }}</td>
<td class="text-right">{{ number_format($o->billing_charge_normalised,2) }}</td>
<td class="text-right">{{ number_format($o->billing_charge_normalised_taxed,2) }}</td>
<td class="text-right">{{ number_format($o->billing_cost_normalised,2) }}</td>
<td class="text-right">{{ $o->product->hasUsage() ? number_format($o->type->usage_summary(0)->sum()/1000,1) : '-' }}</td>
<td>{{ $o->product->supplier->name }}</td>

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