item relationships added to document models in reports.

This commit is contained in:
Cihan Şentürk 2023-09-25 11:36:16 +03:00 committed by GitHub
parent bbc85909c4
commit d80843f152
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 8 deletions

View File

@ -46,7 +46,7 @@ class ExpenseSummary extends Report
break;
default:
// Bills
$bills = $this->applyFilters(Document::bill()->with('recurring', 'transactions')->accrued(), ['date_field' => 'issued_at'])->get();
$bills = $this->applyFilters(Document::bill()->with('recurring', 'transactions', 'items')->accrued(), ['date_field' => 'issued_at'])->get();
Recurring::reflect($bills, 'issued_at');
$this->setTotals($bills, 'issued_at', false, 'expense');

View File

@ -64,7 +64,7 @@ class IncomeExpenseSummary extends Report
break;
default:
// Invoices
$invoices = $this->applyFilters(Document::invoice()->with('recurring', 'transactions')->accrued(), ['date_field' => 'issued_at'])->get();
$invoices = $this->applyFilters(Document::invoice()->with('recurring', 'transactions', 'items')->accrued(), ['date_field' => 'issued_at'])->get();
Recurring::reflect($invoices, 'issued_at');
$this->setTotals($invoices, 'issued_at', false, 'income');
@ -74,7 +74,7 @@ class IncomeExpenseSummary extends Report
$this->setTotals($incomes, 'paid_at', false, 'income');
// Bills
$bills = $this->applyFilters(Document::bill()->with('recurring', 'transactions')->accrued(), ['date_field' => 'issued_at'])->get();
$bills = $this->applyFilters(Document::bill()->with('recurring', 'transactions', 'items')->accrued(), ['date_field' => 'issued_at'])->get();
Recurring::reflect($bills, 'issued_at');
$this->setTotals($bills, 'issued_at', false, 'expense');

View File

@ -46,7 +46,7 @@ class IncomeSummary extends Report
break;
default:
// Invoices
$invoices = $this->applyFilters(Document::invoice()->with('recurring', 'transactions')->accrued(), ['date_field' => 'issued_at'])->get();
$invoices = $this->applyFilters(Document::invoice()->with('recurring', 'transactions', 'items')->accrued(), ['date_field' => 'issued_at'])->get();
Recurring::reflect($invoices, 'issued_at');
$this->setTotals($invoices, 'issued_at', false, 'income');

View File

@ -54,7 +54,7 @@ class ProfitLoss extends Report
break;
default:
// Invoices
$invoices = $this->applyFilters(Document::invoice()->with('recurring', 'totals', 'transactions')->accrued(), ['date_field' => 'issued_at'])->get();
$invoices = $this->applyFilters(Document::invoice()->with('recurring', 'totals', 'transactions', 'items')->accrued(), ['date_field' => 'issued_at'])->get();
Recurring::reflect($invoices, 'issued_at');
$this->setTotals($invoices, 'issued_at', false, 'income', false);
@ -64,7 +64,7 @@ class ProfitLoss extends Report
$this->setTotals($incomes, 'paid_at', false, 'income', false);
// Bills
$bills = $this->applyFilters(Document::bill()->with('recurring', 'totals', 'transactions')->accrued(), ['date_field' => 'issued_at'])->get();
$bills = $this->applyFilters(Document::bill()->with('recurring', 'totals', 'transactions', 'items')->accrued(), ['date_field' => 'issued_at'])->get();
Recurring::reflect($bills, 'issued_at');
$this->setTotals($bills, 'issued_at', false, 'expense', false);

View File

@ -57,12 +57,12 @@ class TaxSummary extends Report
break;
default:
// Invoices
$invoices = $this->applyFilters(Document::invoice()->with('recurring', 'totals', 'transactions')->accrued(), ['date_field' => 'issued_at'])->get();
$invoices = $this->applyFilters(Document::invoice()->with('recurring', 'totals', 'transactions', 'items')->accrued(), ['date_field' => 'issued_at'])->get();
Recurring::reflect($invoices, 'issued_at');
$this->setTotals($invoices, 'issued_at');
// Bills
$bills = $this->applyFilters(Document::bill()->with('recurring', 'totals', 'transactions')->accrued(), ['date_field' => 'issued_at'])->get();
$bills = $this->applyFilters(Document::bill()->with('recurring', 'totals', 'transactions', 'items')->accrued(), ['date_field' => 'issued_at'])->get();
Recurring::reflect($bills, 'issued_at');
$this->setTotals($bills, 'issued_at');