@extends('layouts.app') @section('title', __('expense.add_expense')) @section('content')

@lang('expense.add_expense')

{!! Form::open(['url' => action([\App\Http\Controllers\ExpenseController::class, 'store']), 'method' => 'post', 'id' => 'add_expense_form', 'files' => true ]) !!}
@if(count($business_locations) == 1) @php $default_location = current(array_keys($business_locations->toArray())) @endphp @else @php $default_location = null; @endphp @endif
{!! Form::label('location_id', __('purchase.business_location').':*') !!} {!! Form::select('location_id', $business_locations, $default_location, ['class' => 'form-control select2', 'placeholder' => __('messages.please_select'), 'required'], $bl_attributes); !!}
{!! Form::label('expense_category_id', __('expense.expense_category').':') !!} {!! Form::select('expense_category_id', $expense_categories, null, ['class' => 'form-control select2', 'placeholder' => __('messages.please_select')]); !!}
{!! Form::label('expense_sub_category_id', __('product.sub_category') . ':') !!} {!! Form::select('expense_sub_category_id', [], null, ['placeholder' => __('messages.please_select'), 'class' => 'form-control select2']); !!}
{!! Form::label('ref_no', __('purchase.ref_no').':') !!} {!! Form::text('ref_no', null, ['class' => 'form-control']); !!}

@lang('lang_v1.leave_empty_to_autogenerate')

{!! Form::label('transaction_date', __('messages.date') . ':*') !!}
{!! Form::text('transaction_date', @format_datetime('now'), ['class' => 'form-control', 'readonly', 'required', 'id' => 'expense_transaction_date']); !!}
{!! Form::label('expense_for', __('expense.expense_for').':') !!} @show_tooltip(__('tooltip.expense_for')) {!! Form::select('expense_for', $users, null, ['class' => 'form-control select2', 'placeholder' => __('messages.please_select')]); !!}
{!! Form::label('contact_id', __('lang_v1.expense_for_contact').':') !!} {!! Form::select('contact_id', $contacts, null, ['class' => 'form-control select2', 'placeholder' => __('messages.please_select')]); !!}
{!! Form::label('document', __('purchase.attach_document') . ':') !!} {!! Form::file('document', ['id' => 'upload_document', 'accept' => implode(',', array_keys(config('constants.document_upload_mimes_types')))]); !!}

@lang('purchase.max_file_size', ['size' => (config('constants.document_size_limit') / 1000000)]) @includeIf('components.document_help_text')

{!! Form::label('tax_id', __('product.applicable_tax') . ':' ) !!}
{!! Form::select('tax_id', $taxes['tax_rates'], null, ['class' => 'form-control'], $taxes['attributes']); !!}
{!! Form::label('final_total', __('sale.total_amount') . ':*') !!} {!! Form::text('final_total', null, ['class' => 'form-control input_number', 'placeholder' => __('sale.total_amount'), 'required']); !!}
{!! Form::label('additional_notes', __('expense.expense_note') . ':') !!} {!! Form::textarea('additional_notes', null, ['class' => 'form-control', 'rows' => 3]); !!}

@show_tooltip(__('lang_v1.is_refund_help'))
@include('expense.recur_expense_form_part') @component('components.widget', ['class' => 'box-solid', 'id' => "payment_rows_div", 'title' => __('purchase.add_payment')])
@include('sale_pos.partials.payment_row_form', ['row_index' => 0, 'show_date' => true])
@lang('purchase.payment_due'): {{@num_format(0)}}
@endcomponent
{!! Form::close() !!}
@endsection @section('javascript') @endsection