2021-12-24 01:14:01 +00:00
|
|
|
<!-- $o = Service::class -->
|
2020-02-18 11:35:20 +00:00
|
|
|
<table class="table table-sm">
|
2021-12-24 01:14:01 +00:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th> </th>
|
2022-04-22 04:41:18 +00:00
|
|
|
<th>{{ ($s=$o->supplied)->supplier_detail->supplier->name }}</th>
|
2021-12-24 01:14:01 +00:00
|
|
|
<th>Us</th>
|
|
|
|
<th> </th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
<tbody>
|
2020-02-18 11:35:20 +00:00
|
|
|
<tr>
|
2021-12-24 01:14:01 +00:00
|
|
|
<th>Product</th>
|
2022-04-22 04:41:18 +00:00
|
|
|
<td>#{{ $s->id }}: {{ $s->name }}</td>
|
2021-12-24 01:14:01 +00:00
|
|
|
<td>#{{ $o->product->id }}: {{ $o->product->name }}</td>
|
|
|
|
<td>{{ $s->type }}</td>
|
2020-02-19 12:37:45 +00:00
|
|
|
</tr>
|
2021-12-24 01:14:01 +00:00
|
|
|
<tr>
|
|
|
|
<th>Setup</th>
|
|
|
|
<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($o->product->setup_charge,$o->account->taxes),2) }}</td>
|
2022-04-22 04:41:18 +00:00
|
|
|
<td>{!! markup($a,$b) !!}</td>
|
2021-12-24 01:14:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Billed</th>
|
|
|
|
<td>{{ $s->billing_interval_string }}</td>
|
2022-04-22 04:41:18 +00:00
|
|
|
<td>{{ $o->billing_interval_string }}</td>
|
2021-12-24 01:14:01 +00:00
|
|
|
<td> </td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2022-04-22 04:41:18 +00:00
|
|
|
<th>Billing Price</th>
|
2021-12-24 01:14:01 +00:00
|
|
|
<td>${{ number_format($a=\App\Models\Tax::tax_calc($s->base_cost*\App\Models\Invoice::billing_change($s->billing_interval,$o->product->billing_interval),$o->account->taxes),2) }}</td>
|
2022-04-22 04:41:18 +00:00
|
|
|
<td>${{ number_format($b=$o->billing_charge,2) }}</td>
|
|
|
|
<td>{!! markup($a,$b) !!}</td>
|
2021-12-24 01:14:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2022-04-22 04:41:18 +00:00
|
|
|
<th>Monthly Price</th>
|
2021-12-24 01:14:01 +00:00
|
|
|
<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>
|
2022-04-22 04:41:18 +00:00
|
|
|
<td>${{ number_format($b=$o->billing_monthly_price,2) }}</td>
|
|
|
|
<td>{!! markup($a,$b) !!}</td>
|
2021-12-24 01:14:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Contract</th>
|
|
|
|
<td>{{ $s->contract_term }} months</td>
|
2022-04-22 04:41:18 +00:00
|
|
|
<td>{{ $o->contract_term }} months</td>
|
2021-12-24 01:14:01 +00:00
|
|
|
<td> </td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2022-04-22 04:41:18 +00:00
|
|
|
<th>Min Price</th>
|
2021-12-24 01:14:01 +00:00
|
|
|
<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($o->product->getMinChargeAttribute($o->billing_interval),$o->account->taxes),2) }}</td>
|
2022-04-22 04:41:18 +00:00
|
|
|
<td>{!! markup($a,$b) !!}</td>
|
2021-12-24 01:14:01 +00:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
2022-04-22 04:41:18 +00:00
|
|
|
</table>
|
|
|
|
|
|
|
|
@php
|
|
|
|
function markup($a,$b) {
|
|
|
|
return ($a > $b)
|
|
|
|
? sprintf('<span class="badge bg-danger>">(%3.1f%%)</span>',$a ? ($b-$a)/($b ?: 1)*100 : 100)
|
|
|
|
: sprintf('<span class="badge">%3.1f%%</span>',$a ? ($b-$a)/($b ?: 1)*100 : ($b ? 100: 0));
|
|
|
|
}
|
|
|
|
@endphp
|