@extends('layouts.admin') @section('title', trans('general.title.edit', ['type' => trans_choice('general.reconciliations', 1)])) @section('content')
{!! Form::model($reconciliation, [ 'id' => 'reconciliation', 'method' => 'PATCH', 'route' => ['reconciliations.update', $reconciliation->id], '@submit.prevent' => 'onSubmit', '@keydown' => 'form.errors.clear($event.target.name)', 'role' => 'form', 'class' => 'form-loading-button mb-0', 'novalidate' => true ]) !!}

{{ trans_choice('general.transactions', 2) }}

{{ Form::hidden('account_id', $account->id) }} {{ Form::hidden('currency_code', $currency->code, ['id' => 'currency_code']) }} {{ Form::hidden('opening_balance', $opening_balance, ['id' => 'opening_balance']) }} {{ Form::hidden('closing_balance', $reconciliation->closing_balance, ['id' => 'closing_balance']) }} {{ Form::hidden('started_at', $reconciliation->started_at) }} {{ Form::hidden('ended_at', $reconciliation->ended_at) }} {{ Form::hidden('reconcile', $reconciliation->reconcile, ['id' => 'hidden-reconcile']) }}
@foreach($transactions as $item) @if ($item->isIncome()) @else @endif @endforeach
{{ trans('general.date') }} {{ trans('general.description') }} {{ trans_choice('general.contacts', 1) }} {{ trans('reconciliations.deposit') }} {{ trans('reconciliations.withdrawal') }} {{ trans('general.clear') }}
@date($item->paid_at) {{ $item->description }} {{ $item->contact->name }}@money($item->amount, $item->currency_code, true) N/AN/A @money($item->amount, $item->currency_code, true)
@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.' . $type . '_' . $item->id, 'id' => 'transaction-' . $item->id . '-'. $type, 'class' => 'custom-control-input', '@change' => 'onCalculate' ]) }}
@if ($transactions->count())
{{ trans('reconciliations.opening_balance') }}: @money($opening_balance, $account->currency_code, true)
{{ trans('reconciliations.closing_balance') }}:
{{ Form::moneyGroup('closing_balance_total', '', '', ['disabled' => true, 'row-input' => 'true', 'v-model' => 'totals.closing_balance', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money banking-price-text'], 0.00, 'text-right disabled-money') }}
{{ trans('reconciliations.cleared_amount') }}:
{{ Form::moneyGroup('cleared_amount_total', '', '', ['disabled' => true, 'row-input' => 'true', 'v-model' => 'totals.cleared_amount', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money banking-price-text'], 0.00, 'text-right disabled-money') }}
{{ trans('general.difference') }}:
{{ Form::moneyGroup('difference_total', '', '', ['disabled' => true, 'row-input' => 'true', 'v-model' => 'totals.difference', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money banking-price-text'], 0.00, 'text-right disabled-money') }}
@endif
@can('update-banking-reconciliations') @endcan {!! Form::close() !!}
@endsection @push('scripts_start') @endpush