Performance workarounds as a result of 1bba21 - need to work on with()
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">Active Services</span>
|
||||
<!-- @todo This should count of inactive services too -->
|
||||
<span class="info-box-number">{{ $o->services->count() }} <small>/{{ $o->services->count() }}</small></span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -28,7 +29,7 @@
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">Account Balance</span>
|
||||
<span class="info-box-number"><small>$</small> {{ number_format($o->invoices_due->sum('due'),2) }}</span>
|
||||
<span class="info-box-number"><small>$</small> {{ number_format(($x=$o->invoices()->with(['items.taxes','paymentitems.payment','account'])->get()->where('due','>',0))->sum('due'),2) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -39,7 +40,7 @@
|
||||
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">Invoices Due</span>
|
||||
<span class="info-box-number">{{ $o->invoices_due->count() }}</span>
|
||||
<span class="info-box-number">{{ $x->count() }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user