mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 10:44:29 -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()
|
||||
->orderBy('payment_date', 'desc')
|
||||
->with('client.contacts')
|
||||
->with('client.contacts', 'invoice')
|
||||
->withArchived()
|
||||
->excludeFailed()
|
||||
->where('payment_date', '>=', $this->startDate)
|
||||
@ -30,6 +30,10 @@ class ProfitAndLossReport extends AbstractReport
|
||||
|
||||
foreach ($payments->get() as $payment) {
|
||||
$client = $payment->client;
|
||||
$invoice = $payment->invoice;
|
||||
if ($client->is_deleted || $invoice->is_deleted) {
|
||||
continue;
|
||||
}
|
||||
$this->data[] = [
|
||||
trans('texts.payment'),
|
||||
$client ? ($this->isExport ? $client->getDisplayName() : $client->present()->link) : '',
|
||||
|
Loading…
x
Reference in New Issue
Block a user