Merge pull request #585 from kostasdizas/issue578

Fixed bug in reconciliations that prevented it from working in linux and other OSes
This commit is contained in:
Cüneyt Şentürk 2018-11-02 18:17:10 +03:00 committed by GitHub
commit 0083171a99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -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) { $m::where('account_id', $account->id)->whereBetween('paid_at', [$started[0], $ended[0]])->each(function($item) use(&$transactions, $model) {
$item->model = $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) { if ($item->invoice) {
$item->contact = $item->invoice->customer; $item->contact = $item->invoice->customer;
} else { } else {
@ -293,7 +293,7 @@ class Reconciliations extends Controller
foreach ($transactions as $key => $value) { foreach ($transactions as $key => $value) {
$model = explode('_', $key); $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; $income_total += $value;
} else { } else {
$expense_total += $value; $expense_total += $value;

View File

@ -62,7 +62,7 @@
<td>{{ Date::parse($item->paid_at)->format($date_format) }}</td> <td>{{ Date::parse($item->paid_at)->format($date_format) }}</td>
<td>{{ $item->description }}</td> <td>{{ $item->description }}</td>
<td>@if (!empty($item->contact)) {{ $item->contact->name }} @else {{ trans('general.na') }}@endif</td> <td>@if (!empty($item->contact)) {{ $item->contact->name }} @else {{ trans('general.na') }}@endif</td>
@if ((basename($item->model) == 'Invoice') || (basename($item->model) == 'Revenue')) @if (($item->model == 'App\Models\Income\Invoice') || ($item->model == 'App\Models\Income\Revenue'))
<td class="text-right">@money($item->amount, $item->currency_code, true)</td> <td class="text-right">@money($item->amount, $item->currency_code, true)</td>
<td>&nbsp;</td> <td>&nbsp;</td>
@else @else

View File

@ -41,7 +41,7 @@
<td>{{ Date::parse($item->paid_at)->format($date_format) }}</td> <td>{{ Date::parse($item->paid_at)->format($date_format) }}</td>
<td>{{ $item->description }}</td> <td>{{ $item->description }}</td>
<td>@if (!empty($item->contact)) {{ $item->contact->name }} @else {{ trans('general.na') }}@endif</td> <td>@if (!empty($item->contact)) {{ $item->contact->name }} @else {{ trans('general.na') }}@endif</td>
@if ((basename($item->model) == 'Invoice') || (basename($item->model) == 'Revenue')) @if (($item->model == 'App\Models\Income\Invoice') || ($item->model == 'App\Models\Income\Revenue'))
<td class="text-right">@money($item->amount, $item->currency_code, true)</td> <td class="text-right">@money($item->amount, $item->currency_code, true)</td>
<td>&nbsp;</td> <td>&nbsp;</td>
@else @else