diff --git a/app/Http/Controllers/Banking/Reconciliations.php b/app/Http/Controllers/Banking/Reconciliations.php index c1192fa3b..d19c68968 100644 --- a/app/Http/Controllers/Banking/Reconciliations.php +++ b/app/Http/Controllers/Banking/Reconciliations.php @@ -217,7 +217,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 { @@ -293,7 +293,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; diff --git a/resources/views/banking/reconciliations/create.blade.php b/resources/views/banking/reconciliations/create.blade.php index a54b26c7b..3fa92d86b 100644 --- a/resources/views/banking/reconciliations/create.blade.php +++ b/resources/views/banking/reconciliations/create.blade.php @@ -62,7 +62,7 @@ {{ Date::parse($item->paid_at)->format($date_format) }} {{ $item->description }} @if (!empty($item->contact)) {{ $item->contact->name }} @else {{ trans('general.na') }}@endif - @if ((basename($item->model) == 'Invoice') || (basename($item->model) == 'Revenue')) + @if (($item->model == 'App\Models\Income\Invoice') || ($item->model == 'App\Models\Income\Revenue')) @money($item->amount, $item->currency_code, true)   @else diff --git a/resources/views/banking/reconciliations/edit.blade.php b/resources/views/banking/reconciliations/edit.blade.php index 73f9a7f43..c5934fb12 100644 --- a/resources/views/banking/reconciliations/edit.blade.php +++ b/resources/views/banking/reconciliations/edit.blade.php @@ -41,7 +41,7 @@ {{ Date::parse($item->paid_at)->format($date_format) }} {{ $item->description }} @if (!empty($item->contact)) {{ $item->contact->name }} @else {{ trans('general.na') }}@endif - @if ((basename($item->model) == 'Invoice') || (basename($item->model) == 'Revenue')) + @if (($item->model == 'App\Models\Income\Invoice') || ($item->model == 'App\Models\Income\Revenue')) @money($item->amount, $item->currency_code, true)   @else