@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::class, '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', __('purchase.payment_note')) !!} {!! Form::textarea('note', $journal->note, ['class' => 'form-control', 'rows' => 3]); !!} # @lang( 'accounting::lang.account' ) @lang( 'accounting::lang.debit' ) @lang( 'accounting::lang.credit' ) @lang( 'purchase.business_location' ) @lang( 'purchase.payment_note' ) @php $row_count = count($accounts_transactions); @endphp @for($i = 1; $i <= $row_count; $i++) @php $account_id = ''; $debit = ''; $credit = ''; $default_array = []; $default_array1 = []; $rec_note = ''; @endphp @if(isset($accounts_transactions[$i-1])) @php $account_id = $accounts_transactions[$i-1]['accounting_account_id']; $location_id = $accounts_transactions[$i-1]['location_id']; $rec_note = $accounts_transactions[$i-1]['note']; $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'] ?? ""]; $default_array1 = [$location_id => $accounts_transactions[$i-1]['location']['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%;min-width:150px']); !!} {!! Form::text('debit[' . $i . ']', $debit, ['class' => 'form-control input_number debit','style' => 'width: 100%;min-width:100px']); !!} {!! Form::text('credit[' . $i . ']', $credit, ['class' => 'form-control input_number credit','style' => 'width: 100%;min-width:100px']); !!} {!! Form::select('location_id[' . $i . ']', $default_array1, $location_id, ['class' => 'form-control locations-dropdown location_id', 'placeholder' => __('messages.please_select'), 'style' => 'width: 100%;min-width:150px']); !!} {!! Form::text('rec_note[' . $i . ']', $rec_note, ['class' => 'form-control','style' => 'width: 100%;min-width:100px']); !!} @endfor @lang( 'accounting::lang.total' ) @lang('messages.add_row') @lang('messages.save') @endcomponent {!! Form::close() !!} @stop @section('javascript') @include('accounting::accounting.common_js') @section('javascript') @include('accounting::accounting.common_js') @endsection