{!! Form::open([ 'url' => action('TransactionPaymentController@update', [$payment_line->id]), 'method' => 'put', 'id' => 'transaction_payment_add_form', 'files' => true, ]) !!} {!! Form::hidden( 'default_payment_accounts', !empty($transaction->location) ? $transaction->location->default_payment_accounts : '[]', ['id' => 'default_payment_accounts'], ) !!}

@lang('purchase.edit_payment')

@if (!empty($transaction->contact))
@if ($transaction->contact->type == 'supplier') @lang('purchase.supplier'): @else @lang('contact.customer'): @endif {{ $transaction->contact->full_name_with_business }}
@lang('business.business'): {{ $transaction->contact->supplier_business_name }}
@endif @if ($transaction->type != 'opening_balance')
@lang('purchase.ref_no'): {{ $transaction->ref_no }}
@if (!empty($transaction->location)) @lang('purchase.location'): {{ $transaction->location->name }} @endif
@lang('sale.total_amount'): {{ $transaction->final_total }}
@lang('purchase.payment_note'): @if (!empty($transaction->additional_notes)) {{ $transaction->additional_notes }} @else -- @endif
@endif
{!! Form::label('method', __('purchase.payment_method') . ':*') !!}
{!! Form::select('method', $payment_types, $payment_line->method, [ 'class' => 'form-control select2 payment_types_dropdown', 'required', 'style' => 'width:100%;', ]) !!}
{!! Form::label('paid_on', __('lang_v1.paid_on') . ':*') !!}
{!! Form::text('paid_on', @format_datetime($payment_line->paid_on), [ 'class' => 'form-control pyament_date', 'readonly', 'required', ]) !!}
Enter validate date.!
{!! Form::label('amount', __('sale.amount') . ':*') !!}
{!! Form::text('amount', @num_format($payment_line->amount), [ 'class' => 'form-control input_number payment_amount', 'required', 'placeholder' => 'Amount', ]) !!}
@php $pos_settings = !empty(session()->get('business.pos_settings')) ? json_decode(session()->get('business.pos_settings'), true) : []; $enable_cash_denomination_for_payment_methods = !empty($pos_settings['enable_cash_denomination_for_payment_methods']) ? $pos_settings['enable_cash_denomination_for_payment_methods'] : []; @endphp @if ( !empty($pos_settings['enable_cash_denomination_on']) && $pos_settings['enable_cash_denomination_on'] == 'all_screens')

@lang('lang_v1.cash_denominations') @if (!empty($pos_settings['cash_denominations'])) @php $total = 0; @endphp @foreach (explode(',', $pos_settings['cash_denominations']) as $dnm) @php $count = 0; $sub_total = 0; foreach ($payment_line->denominations as $d) { if ($d->amount == $dnm) { $count = $d->total_count; $sub_total = $d->total_count * $d->amount; $total += $sub_total; } } @endphp @endforeach
@lang('lang_v1.denomination')   @lang('lang_v1.count')   @lang('sale.subtotal')
{{ $dnm }} X {!! Form::number("denominations[$dnm]", $count, [ 'class' => 'form-control cash_denomination input-sm', 'min' => 0, 'data-denomination' => $dnm, 'style' => 'width: 100px; margin:auto;', ]) !!} = {{ @num_format($sub_total) }}
@lang('sale.total') {{ @num_format($total) }}

@lang('lang_v1.cash_denomination_error')

@else

@lang('lang_v1.denomination_add_help_text')

@endif
@endif
{!! Form::label('document', __('purchase.attach_document') . ':') !!} {!! Form::file('document', [ 'accept' => implode(',', array_keys(config('constants.document_upload_mimes_types'))), ]) !!}

@lang('lang_v1.previous_file_will_be_replaced') @includeIf('components.document_help_text')

@if (!empty($accounts)) {{--
{!! Form::label("account_id" , __('lang_v1.payment_account') . ':*') !!}
{!! Form::select("account_id", $accounts, !empty($payment_line->account_id) ? $payment_line->account_id : '' , ['class' => 'form-control select2', 'required', 'id' => "account_id", 'style' => 'width:100%;']); !!}
--}}
@endif
@include('transaction_payment.payment_type_details')
{!! Form::label('note', __('lang_v1.payment_note') . ':') !!} {!! Form::textarea('note', $payment_line->note, ['class' => 'form-control', 'rows' => 3]) !!}
{!! Form::close() !!}