@extends('layouts.app') @section('title', __('accounting::lang.journal_entry')) @section('content') @include('accounting::layouts.nav') @lang( 'accounting::lang.journal_entry' ) - {{$journal->ref_no}} {!! Form::open(['url' => action('\Modules\Accounting\Http\Controllers\JournalEntryController@update', $journal->id), 'method' => 'PUT', 'id' => 'journal_add_form']) !!} @component('components.widget', ['class' => 'box-primary']) {!! Form::label('journal_date', __('accounting::lang.journal_date') . ':*') !!} {!! Form::text('journal_date', @format_datetime($journal->operation_date), ['class' => 'form-control datetimepicker', 'readonly', 'required']); !!} {!! Form::label('note', __('lang_v1.additional_notes')) !!} {!! Form::textarea('note', $journal->note, ['class' => 'form-control', 'rows' => 3]); !!} # @lang( 'accounting::lang.account' ) @lang( 'accounting::lang.debit' ) @lang( 'accounting::lang.credit' ) @for($i = 1; $i <= 10; $i++) @php $account_id = ''; $debit = ''; $credit = ''; $default_array = []; @endphp @if(isset($accounts_transactions[$i-1])) @php $account_id = $accounts_transactions[$i-1]['accounting_account_id']; $debit = ($accounts_transactions[$i-1]['type'] == 'debit') ? $accounts_transactions[$i-1]['amount'] : ''; $credit = ($accounts_transactions[$i-1]['type'] == 'credit') ? $accounts_transactions[$i-1]['amount'] : ''; $default_array = [$account_id => $accounts_transactions[$i-1]['account']['name']]; @endphp {!! Form::hidden('accounts_transactions_id[' . $i . ']', $accounts_transactions[$i-1]['id']); !!} @endif {{$i}} {!! Form::select('account_id[' . $i . ']', $default_array, $account_id, ['class' => 'form-control accounts-dropdown account_id', 'placeholder' => __('messages.please_select'), 'style' => 'width: 100%;']); !!} {!! Form::text('debit[' . $i . ']', $debit, ['class' => 'form-control input_number debit']); !!} {!! Form::text('credit[' . $i . ']', $credit, ['class' => 'form-control input_number credit']); !!} @endfor @lang( 'accounting::lang.total' ) @lang('messages.save') @endcomponent {!! Form::close() !!} @stop @section('javascript') @include('accounting::accounting.common_js') @endsection