diff --git a/resources/views/banking/reconciliations/create.blade.php b/resources/views/banking/reconciliations/create.blade.php index b77a8d612..96db825e7 100644 --- a/resources/views/banking/reconciliations/create.blade.php +++ b/resources/views/banking/reconciliations/create.blade.php @@ -74,7 +74,7 @@ @date($item->paid_at) {{ $item->description }} {{ $item->contact->name }} - @if ($item->type == 'income') + @if ($item->isIncome()) @money($item->amount, $item->currency_code, true) N/A @else @@ -83,14 +83,15 @@ @endif
- {{ Form::checkbox($item->type . '_' . $item->id, $item->amount_for_account, $item->reconciled, [ + @php $type = $item->isIncome() ? 'income' : 'expense'; @endphp + {{ Form::checkbox($type . '_' . $item->id, $item->amount_for_account, $item->reconciled, [ 'data-field' => 'transactions', - 'v-model' => 'form.transactions.' . $item->type . '_' . $item->id, - 'id' => 'transaction-' . $item->id . '-'. $item->type, + 'v-model' => 'form.transactions.' . $type . '_' . $item->id, + 'id' => 'transaction-' . $item->id . '-'. $type, 'class' => 'custom-control-input', '@change' => 'onCalculate' ]) }} - +
diff --git a/resources/views/banking/reconciliations/edit.blade.php b/resources/views/banking/reconciliations/edit.blade.php index 3e1d2d1b1..260d13627 100644 --- a/resources/views/banking/reconciliations/edit.blade.php +++ b/resources/views/banking/reconciliations/edit.blade.php @@ -46,7 +46,7 @@ @date($item->paid_at) {{ $item->description }} {{ $item->contact->name }} - @if ($item->type == 'income') + @if ($item->isIncome()) @money($item->amount, $item->currency_code, true) N/A @else @@ -55,14 +55,15 @@ @endif
- {{ Form::checkbox($item->type . '_' . $item->id, $item->amount_for_account, $item->reconciled, [ + @php $type = $item->isIncome() ? 'income' : 'expense'; @endphp + {{ Form::checkbox($type . '_' . $item->id, $item->amount_for_account, $item->reconciled, [ 'data-field' => 'transactions', - 'v-model' => 'form.transactions.' . $item->type . '_' . $item->id, - 'id' => 'transaction-' . $item->id . '-'. $item->type, + 'v-model' => 'form.transactions.' . $type . '_' . $item->id, + 'id' => 'transaction-' . $item->id . '-'. $type, 'class' => 'custom-control-input', '@change' => 'onCalculate' ]) }} - +