Fixed bug in reconciliations that prevented it from working in linux and other OSes

Fixes #578
This commit is contained in:
Kostas Dizas
2018-11-02 13:58:43 +00:00
parent b0a7e98e4e
commit bf74ee7f83
3 changed files with 4 additions and 4 deletions

View File

@ -218,7 +218,7 @@ class Reconciliations extends Controller
$m::where('account_id', $account->id)->whereBetween('paid_at', [$started[0], $ended[0]])->each(function($item) use(&$transactions, $model) {
$item->model = $model;
if ((basename($model) == 'Invoice') || (basename($model) == 'Revenue')) {
if (($model == 'App\Models\Income\Invoice') || ($model == 'App\Models\Income\Revenue')) {
if ($item->invoice) {
$item->contact = $item->invoice->customer;
} else {
@ -294,7 +294,7 @@ class Reconciliations extends Controller
foreach ($transactions as $key => $value) {
$model = explode('_', $key);
if ((basename($model[1]) == 'Invoice') || (basename($model[1]) == 'Revenue')) {
if (($model[1] == 'App\Models\Income\Invoice') || ($model[1] == 'App\Models\Income\Revenue')) {
$income_total += $value;
} else {
$expense_total += $value;