mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 10:24:31 -04:00
Reports include deleted payments
This commit is contained in:
parent
93eb4c63cd
commit
05e5ae1167
@ -22,7 +22,7 @@ class ProfitAndLossReport extends AbstractReport
|
|||||||
|
|
||||||
$payments = Payment::scope()
|
$payments = Payment::scope()
|
||||||
->orderBy('payment_date', 'desc')
|
->orderBy('payment_date', 'desc')
|
||||||
->with('client.contacts')
|
->with('client.contacts', 'invoice')
|
||||||
->withArchived()
|
->withArchived()
|
||||||
->excludeFailed()
|
->excludeFailed()
|
||||||
->where('payment_date', '>=', $this->startDate)
|
->where('payment_date', '>=', $this->startDate)
|
||||||
@ -30,6 +30,10 @@ class ProfitAndLossReport extends AbstractReport
|
|||||||
|
|
||||||
foreach ($payments->get() as $payment) {
|
foreach ($payments->get() as $payment) {
|
||||||
$client = $payment->client;
|
$client = $payment->client;
|
||||||
|
$invoice = $payment->invoice;
|
||||||
|
if ($client->is_deleted || $invoice->is_deleted) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$this->data[] = [
|
$this->data[] = [
|
||||||
trans('texts.payment'),
|
trans('texts.payment'),
|
||||||
$client ? ($this->isExport ? $client->getDisplayName() : $client->present()->link) : '',
|
$client ? ($this->isExport ? $client->getDisplayName() : $client->present()->link) : '',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user