Move billing cost service::class methods into __get(), fixed some incorrect displays of costs
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
<td>{{ $o->product->name }}</td>
|
||||
<td>{{ $o->supplierid }}</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">{{ number_format($o->billing_cost_normalised_taxed,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>
|
||||
</tr>
|
||||
|
@@ -48,7 +48,7 @@
|
||||
<tr>
|
||||
<th>Amount</th>
|
||||
@if($o->is_charge_overridden)
|
||||
<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>
|
||||
<td>@if($o->billing_charge < $o->billing_charge_orig)<del>${{ number_format($o->billing_charge_orig_taxed,2) }}</del> @endif${{ number_format($o->billing_charge_taxed,2) }}</td>
|
||||
@else
|
||||
<td>${{ number_format($o->billing_charge_taxed,2) }}</td>
|
||||
@endif
|
||||
|
@@ -16,6 +16,7 @@
|
||||
<th> </th>
|
||||
@endif
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th>Client</th>
|
||||
@@ -32,13 +33,14 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Product</th>
|
||||
<td><a href="{{ url('a/product/details',$o->product_id) }}">#{{ $o->product_id }}: {{ $o->product->name }}</a></td>
|
||||
<td><a href="{{ url('a/product/details',$c->id) }}">#{{ $c->supplied->id }}: {{ $c->supplied->name_long }}</a></td>
|
||||
@if($p->exists)
|
||||
<th> </th>
|
||||
<td class="text-center" colspan="2">#{{ $p->supplied->id }}: {{ $p->supplied->name_long }}</td>
|
||||
@endif
|
||||
<td><a href="{{ route('product',['pdo'=>$o->product_id]) }}">#{{ $o->product_id }}: {{ $o->product->name }}</a></td>
|
||||
<td><a href="{{ route('supplier.product.type',['id'=>$c->supplied->id,'spo'=>$c->supplied->supplier_detail_id,'type'=>$c->supplied->category]) }}">#{{ $c->supplied->id }}: {{ $c->supplied->name_long }}</a></td>
|
||||
<td>{{ $c->category_name }}</td>
|
||||
@if($p->exists)
|
||||
<th><a href="{{ route('product',['pdo'=>$p->id]) }}">#{{ $p->id }}: {{ $p->name }}</a></th>
|
||||
<td class="text-center"><a href="{{ route('supplier.product.type',['id'=>$p->supplied->id,'spo'=>$p->supplied->supplier_detail_id,'type'=>$p->supplied->category]) }}">#{{ $p->supplied->id }}: {{ $p->supplied->name_long }}</a></td>
|
||||
<td> </td>
|
||||
@endif
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@@ -68,7 +70,7 @@
|
||||
<tr>
|
||||
<th>Billing Price</th>
|
||||
<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 @class(['text-danger'=>$o->is_cost_overridden])>${{ number_format($a=$o->billing_cost_taxed,2) }}</td>
|
||||
<td>{!! markup($a,$b) !!}</td>
|
||||
@if($p->exists)
|
||||
<td @if($o->is_charge_overridden)class="text-danger"@endif>${{ number_format($b=$o->account->taxed($p->base_charge),2) }}</td>
|
||||
@@ -81,22 +83,22 @@
|
||||
<th>Monthly Price</th>
|
||||
<td @class(['text-danger'=>$o->is_charge_overridden])>
|
||||
@if($o->is_charge_overridden)
|
||||
<abbr title="${{ number_format($b=$o->billing_orig_normalised_taxed,2) }}">${{ number_format($b=$o->billing_charge_normalised_taxed,2) }}
|
||||
<abbr title="${{ number_format($o->billing_charge_orig_normalised_taxed,2) }}">${{ number_format($b=$o->billing_charge_normalised_taxed,2) }}
|
||||
@else
|
||||
${{ 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($c->billing_interval,Invoice::BILL_MONTHLY),2) }}">${{ number_format($b=$o->billing_cost_normalised,2) }}
|
||||
<abbr title="${{ number_format($o->billing_cost_orig_normalised_taxed,2) }}">${{ number_format($a=$o->billing_cost_normalised_taxed,2) }}
|
||||
@else
|
||||
${{ number_format($a=$o->billing_cost_normalised,2) }}
|
||||
${{ number_format($a=$o->billing_cost_normalised_taxed,2) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{!! markup($a,$b) !!}</td>
|
||||
@if($p->exists)
|
||||
<td @if($o->is_charge_overridden) class="text-danger" @endif>${{ number_format($b=$o->account->taxed($p->base_charge)*Invoice::billing_change($o->billing_interval,Invoice::BILL_MONTHLY),2) }}</td>
|
||||
<td>${{ number_format($a=$o->account->taxed($p->base_cost)*Invoice::billing_change($o->billing_interval,Invoice::BILL_MONTHLY),2) }}</td>
|
||||
<td @class(['text-danger'=>$o->is_charge_overridden])>${{ number_format($b=$o->account->taxed($p->base_charge)*Invoice::billing_change($o->billing_interval,Invoice::BILL_MONTHLY),2) }}</td>
|
||||
<td @class(['text-danger'=>$o->is_cost_overridden])>${{ number_format($a=$o->account->taxed($p->base_cost)*Invoice::billing_change($o->billing_interval,Invoice::BILL_MONTHLY),2) }}</td>
|
||||
<td>{!! markup($a,$b) !!}</td>
|
||||
@endif
|
||||
</tr>
|
||||
@@ -133,11 +135,14 @@
|
||||
<td>${{ number_format($o->billing_charge_to($o->contract_end),2) }} (<small>{{ $o->paid_to?->format('Y-m-d') }}</small>)</td>
|
||||
<td>${{ number_format($o->billing_cost_to($o->contract_end),2) }} (<small>{{ $o->invoiced_to?->format('Y-m-d') }}</small>)</td>
|
||||
<td>{{ $o->contract_end->format('Y-m-d') }}<br><small>({{ $o->contract_end->diffForHumans(now(),CarbonInterface::DIFF_RELATIVE_TO_OTHER,FALSE,2) }} today)</small></td>
|
||||
|
||||
@else
|
||||
<td colspan="2" class="text-center">Not on contract</td>
|
||||
<td> </td>
|
||||
@endif
|
||||
|
||||
@if($p->exists)
|
||||
<td colspan="3"> </td>
|
||||
@endif
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
Reference in New Issue
Block a user