updated reports

This commit is contained in:
denisdulici
2020-01-18 13:11:19 +03:00
parent 78ede398f2
commit ead2256589
9 changed files with 27 additions and 26 deletions

View File

@ -7,7 +7,9 @@ use App\Events\Common\ReportFilterApplying;
use App\Events\Common\ReportGroupApplying;
use App\Events\Common\ReportGroupShowing;
use App\Exports\Common\Reports as Export;
use App\Models\Banking\Transaction;
use App\Models\Common\Report as Model;
use App\Models\Sale\Invoice;
use App\Traits\Charts;
use App\Traits\DateTime;
use App\Utilities\Chartjs;
@ -317,7 +319,7 @@ abstract class Report
$this->totals[$table][$date] += $amount;
} else {
$type = (($item->getTable() == 'invoices') || (($item->getTable() == 'transactions') && ($item->type == 'income'))) ? 'income' : 'expense';
$type = (($item instanceof Invoice) || (($item instanceof Transaction) && ($item->type == 'income'))) ? 'income' : 'expense';
if ($type == 'income') {
$this->rows[$table][$item->$id_field][$date] += $amount;