1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

fixes for check data

This commit is contained in:
David Bomba 2020-11-19 14:52:22 +11:00
parent 78ba574236
commit e7376aa42b

View File

@ -321,7 +321,7 @@ class CheckData extends Command
Client::withTrashed()->cursor()->each(function ($client) use ($wrong_paid_to_dates, $credit_total_applied) {
$total_invoice_payments = 0;
foreach ($client->invoices->where('is_deleted', false) as $invoice) {
foreach ($client->invoices->where('is_deleted', false)->where('status_id', '>', 1) as $invoice) {
$total_amount = $invoice->payments->whereNull('deleted_at')->sum('pivot.amount');
$total_refund = $invoice->payments->whereNull('deleted_at')->sum('pivot.refunded');