Fix date range in profit/loss report
This commit is contained in:
parent
431ef3121e
commit
8a1142e696
1 changed files with 6 additions and 2 deletions
|
|
@ -23,7 +23,9 @@ class ProfitAndLossReport extends AbstractReport
|
|||
$payments = Payment::scope()
|
||||
->with('client.contacts')
|
||||
->withArchived()
|
||||
->excludeFailed();
|
||||
->excludeFailed()
|
||||
->where('payment_date', '>=', $this->startDate)
|
||||
->where('payment_date', '<=', $this->endDate);
|
||||
|
||||
foreach ($payments->get() as $payment) {
|
||||
$client = $payment->client;
|
||||
|
|
@ -42,7 +44,9 @@ class ProfitAndLossReport extends AbstractReport
|
|||
|
||||
$expenses = Expense::scope()
|
||||
->with('client.contacts')
|
||||
->withArchived();
|
||||
->withArchived()
|
||||
->where('expense_date', '>=', $this->startDate)
|
||||
->where('expense_date', '<=', $this->endDate);
|
||||
|
||||
foreach ($expenses->get() as $expense) {
|
||||
$client = $expense->client;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue