improved performance
This commit is contained in:
@ -30,7 +30,7 @@ class ExpenseSummary extends Report
|
||||
|
||||
public function setData()
|
||||
{
|
||||
$transactions = $this->applyFilters(Transaction::expense()->isNotTransfer(), ['date_field' => 'paid_at']);
|
||||
$transactions = $this->applyFilters(Transaction::with('recurring')->expense()->isNotTransfer(), ['date_field' => 'paid_at']);
|
||||
|
||||
switch ($this->model->settings->basis) {
|
||||
case 'cash':
|
||||
@ -41,7 +41,7 @@ class ExpenseSummary extends Report
|
||||
break;
|
||||
default:
|
||||
// Bills
|
||||
$bills = $this->applyFilters(Bill::accrued(), ['date_field' => 'billed_at'])->get();
|
||||
$bills = $this->applyFilters(Bill::with(['recurring', 'transactions'])->accrued(), ['date_field' => 'billed_at'])->get();
|
||||
Recurring::reflect($bills, 'billed_at');
|
||||
$this->setTotals($bills, 'billed_at');
|
||||
|
||||
|
Reference in New Issue
Block a user