{!! Form::open(['url' => action([\Modules\AccountingReports\Http\Controllers\DirectIncomeController::class, 'update'], [$direct_income->id]), 'method' => 'PUT', 'id' => 'direct_income_form', 'files' => true]) !!}

@lang('accounting-reports::lang.edit_direct_income')

{!! Form::label('name', __('accounting-reports::lang.income_name') . ':*') !!}
{!! Form::select('name', $income_names, $direct_income->name, ['class' => 'form-control select2', 'required', 'placeholder' => __('messages.please_select'), 'style' => 'width:100%', 'id' => 'income_name_select']) !!}

@lang('accounting-reports::lang.select_or_create_income_name') @lang('accounting-reports::lang.manage_income_names')

{!! Form::label('description', __('accounting-reports::lang.description') . ':') !!} {!! Form::textarea('description', $direct_income->description, ['class' => 'form-control', 'rows' => '3', 'placeholder' => __('accounting-reports::lang.description')]) !!}
{!! Form::label('amount', __('accounting-reports::lang.amount') . ':*') !!}
{!! Form::text('amount', @num_format($direct_income->amount), ['class' => 'form-control input_number', 'id' => 'amount', 'required']) !!}
{!! Form::label('income_date', __('accounting-reports::lang.income_date') . ':*') !!}
{!! Form::text('income_date', @format_date($direct_income->income_date), ['class' => 'form-control date-picker', 'required']) !!}
{!! Form::label('location_id', __('purchase.business_location') . ':') !!} {!! Form::select('location_id', $locations, $direct_income->location_id, ['class' => 'form-control select2', 'placeholder' => __('messages.please_select'), 'style' => 'width:100%']) !!}
{!! Form::label('account_id', __('account.account') . ':') !!} {!! Form::select('account_id', $accounts, $direct_income->account_id, ['class' => 'form-control select2', 'placeholder' => __('messages.please_select'), 'style' => 'width:100%']) !!}
{!! Form::label('reference_no', __('accounting-reports::lang.reference_no') . ':') !!} {!! Form::text('reference_no', $direct_income->reference_no, ['class' => 'form-control', 'placeholder' => __('accounting-reports::lang.reference_no')]) !!}
{!! Form::label('document', __('purchase.attach_document') . ':') !!} {!! Form::file('document', ['class' => 'form-control', 'accept' => 'image/*,.pdf,.doc,.docx,.xls,.xlsx']) !!} @if($direct_income->document)

@lang('lang_v1.view_uploaded_document')

@endif

@lang('lang_v1.max_file_size_10mb')


@lang('purchase.add_payment')

{!! Form::label('payment_amount', __('sale.amount') . ':') !!}
{!! Form::text('payment_amount', @num_format($direct_income->payment_amount ?? 0), ['class' => 'form-control input_number payment-amount', 'placeholder' => __('sale.amount')]) !!}
{!! Form::label('received_on', __('lang_v1.received_on') . ':') !!}
{!! Form::text('received_on', $direct_income->received_on ? @format_datetime($direct_income->received_on) : @format_datetime('now'), ['class' => 'form-control received_on']) !!}
{!! Form::label('payment_method', __('lang_v1.payment_method') . ':') !!}
{!! Form::select('payment_method', $payment_types, $direct_income->payment_method ?? 'cash', ['class' => 'form-control select2', 'style' => 'width:100%']) !!}
@if(!empty($payment_accounts))
{!! Form::label('payment_account_id', __('lang_v1.payment_account') . ':') !!}
{!! Form::select('payment_account_id', $payment_accounts, $direct_income->payment_account_id, ['class' => 'form-control select2 account-dropdown', 'placeholder' => __('messages.please_select'), 'style' => 'width:100%', 'id' => 'payment_account_id']) !!}
@endif
{!! Form::label('payment_note', __('sale.payment_note') . ':') !!} {!! Form::textarea('payment_note', $direct_income->payment_note, ['class' => 'form-control', 'rows' => '2', 'placeholder' => __('sale.payment_note')]) !!}
@lang('purchase.payment_due'): {{@num_format(0)}}
{!! Form::close() !!}