{!! Form::open(['url' => action([\Modules\Repair\Http\Controllers\JobSheetController::class, 'updateProjectPayment'], [$payment->id]), 'method' => 'put', 'id' => 'edit_project_payment_form']) !!}

@lang('repair::lang.edit_project_payment') ({{$payment->jobSheet->job_sheet_no ?? ''}})

@lang('repair::lang.destination'):
• @lang('repair::lang.employee'): @lang('repair::lang.payroll_updated') (Automatically added as allowance in monthly payroll).
• @lang('repair::lang.supplier'): @lang('repair::lang.ledger_updated') (Automatically updates contact balance & ledger history).

{!! Form::label('assigned_to_type', __('repair::lang.recipient_type') . ':*') !!}
{!! Form::label('employee_id', __('repair::lang.select_employee') . ':*') !!} {!! Form::select('employee_id', $employees, ($payment->assigned_to_type === 'employee' ? $payment->assigned_to_id : null), ['class' => 'form-control select2', 'id' => 'edit_assigned_employee_id', 'style' => 'width: 100%;', 'placeholder' => __('messages.please_select')]) !!}
{!! Form::label('supplier_id', __('repair::lang.select_supplier') . ':*') !!} {!! Form::select('supplier_id', $suppliers, ($payment->assigned_to_type === 'supplier' ? $payment->assigned_to_id : null), ['class' => 'form-control select2', 'id' => 'edit_assigned_supplier_id', 'style' => 'width: 100%;', 'placeholder' => __('messages.please_select')]) !!}
{!! Form::label('amount', __('sale.amount') . ':*') !!}
{!! Form::text('amount', @num_format($payment->amount), ['class' => 'form-control input_number', 'required', 'placeholder' => __('sale.amount'), 'id' => 'edit_payment_amount']) !!}
{!! Form::label('payment_date', __('receipt.date') . ':*') !!}
{!! Form::text('payment_date', @format_date($payment->payment_date), ['class' => 'form-control', 'required', 'id' => 'edit_project_payment_date', 'readonly']) !!}
{!! Form::label('payment_status', __('sale.payment_status') . ':*') !!} {!! Form::select('payment_status', ['due' => __('lang_v1.due'), 'paid' => __('lang_v1.paid')], $payment->payment_status, ['class' => 'form-control select2', 'required', 'id' => 'edit_project_payment_status', 'style' => 'width: 100%;']) !!}
{!! Form::label('payment_method', __('lang_v1.payment_method') . ':') !!} {!! Form::select('payment_method', $payment_types, $payment->payment_method ?? 'cash', ['class' => 'form-control select2', 'id' => 'edit_project_payment_method', 'style' => 'width: 100%;']) !!}
@if(!empty($accounts))
{!! Form::label('account_id', __('lang_v1.payment_account') . ':') !!} {!! Form::select('account_id', $accounts, $payment->account_id, ['class' => 'form-control select2', 'style' => 'width: 100%;', 'placeholder' => __('messages.please_select')]) !!}
@endif
{!! Form::label('notes', __('brand.note') . ':') !!} {!! Form::textarea('notes', $payment->notes, ['class' => 'form-control', 'rows' => 3, 'placeholder' => 'Add notes or description for this work/part/payout']) !!}
{!! Form::close() !!}