close #738 Fixed: Reconciliations listing incomes incorrectly

This commit is contained in:
cuneytsenturk 2019-02-04 13:01:51 +03:00
parent d29343a85f
commit 03fd7f5ddd
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 (($model == 'App\Models\Income\Invoice') || ($model == 'App\Models\Income\Revenue')) {
if (($model == 'App\Models\Income\InvoicePayment') || ($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 (($model[1] == 'App\Models\Income\Invoice') || ($model[1] == 'App\Models\Income\Revenue')) {
if (($model[1] == 'App\Models\Income\InvoicePayment') || ($model[1] == 'App\Models\Income\Revenue')) {
$income_total += $value;
} else {
$expense_total += $value;

View File

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

View File

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