More Product Model optimisation

This commit is contained in:
2023-05-05 15:48:24 +10:00
parent 96f799f535
commit 820ff2be00
37 changed files with 161 additions and 592 deletions

View File

@@ -27,13 +27,14 @@
<tr>
<th>Setup</th>
@if ($s->exists)
<td>${{ number_format($a=\App\Models\Tax::tax_calc($s->setup_cost,$o->account->taxes),2) }}</td>
<td>${{ number_format($b=\App\Models\Tax::tax_calc($p->setup_charge,$o->account->taxes),2) }}</td>
<td>${{ number_format($a=$o->account->taxed($s->setup_cost),2) }}</td>
<td>${{ number_format($b=$o->account->taxed($p->setup_charge),2) }}</td>
<td>{!! markup($a,$b) !!}</td>
@else
<td>-</td>
@endif
</tr>
{{--
<tr>
<th>Billed</th>
@if ($s->exists)
@@ -47,7 +48,7 @@
<tr>
<th>Billing Price</th>
@if ($s->exists)
<td>${{ number_format($a=\App\Models\Tax::tax_calc($s->base_cost*\App\Models\Invoice::billing_change($s->billing_interval,$p->billing_interval),$o->account->taxes),2) }}</td>
<td>${{ number_format($a=$o->account->taxed($s->base_cost*\App\Models\Invoice::billing_change($s->billing_interval,$p->billing_interval)),2) }}</td>
@endif
<td>${{ number_format($b=$o->billing_charge,2) }}</td>
@if ($s->exists)
@@ -57,9 +58,9 @@
<tr>
<th>Monthly Price</th>
@if ($s->exists)
<td>${{ number_format($a=\App\Models\Tax::tax_calc($s->base_cost*\App\Models\Invoice::billing_change($s->billing_interval,1),$o->account->taxes),2) }}</td>
<td>${{ number_format($a=$o->account->taxed($s->base_cost*\App\Models\Invoice::billing_change($s->billing_interval,1)),2) }}</td>
@endif
<td @if($x=$o->isChargeOverriden()) class="text-danger" @endif>${{ number_format($b=($x ? $p->base_charge_taxable : $o->billing_monthly_price),2) }}</td>
<td @if($x=$o->isChargeOverriden()) class="text-danger" @endif>${{ number_format($b=($x ? $o->account->taxed($p->base_charge) : $o->billing_monthly_price),2) }}</td>
@if ($s->exists)
<td>{!! markup($a,$b) !!}</td>
@endif
@@ -77,12 +78,13 @@
<tr>
<th>Min Price</th>
@if ($s->exists)
<td>${{ number_format($a=\App\Models\Tax::tax_calc($s->min_cost,$o->account->taxes),2) }}</td>
<td>${{ number_format($b=\App\Models\Tax::tax_calc($p->getMinChargeAttribute($o->billing_interval),$o->account->taxes),2) }}</td>
<td>${{ number_format($a=$o->account->taxed($s->min_cost),2) }}</td>
<td>${{ number_format($b=$o->account->taxed($p->getMinChargeAttribute($o->billing_interval)),2) }}</td>
<td>{!! markup($a,$b) !!}</td>
@else
<td>-</td>
@endif
</tr>
--}}
</tbody>
</table>