@use('App\Services\Date') @extends('companyuser::layouts.master') @section('title', __('purchases::bill_returns.create_new')) @section('extra-styles') @endsection @section('breadcrumb') @endsection @section('content')
@csrf
@if (!isset($currentFiscalYearId))
@lang('superadmin::Dashboard.Please set your ')   @lang('settings::general_settings.accounting settings')   @lang('superadmin::Dashboard.to start adding accounting transactions')
@endif
{{-- @include('companyuser::errors.all') --}} @include('companyuser::errors.operation-locked') @include('companyuser::errors.lists')
@error('code') @enderror
(@lang('optional'))
@error('supplier_invoice_reference_number') @enderror
( @lang('optional') )
@error('description')

{{ $message }}

@enderror
@error('supplier') @enderror
@error('payment_date') @enderror @error('current_fiscal_year_id') @enderror
@error('cost_center_id')

{{ $message }}

@enderror @if(isFeatureActive(Modules\Settings\Enums\FeaturesEnum::INVENTORY))

{{ __('validation.change_warning', ['field' => __('products::cost_center.Cost Center')]) }}

@endif
@php // Replicate the original select logic: if (old('payment_term')) { $oldPaymentTermId = old('payment_term'); } elseif ($billReturn) { $oldPaymentTermId = $billReturn->payment_term_id ?? null; } elseif (old('payment_account') && old('payment_account') !== '1') { $oldPaymentTermId = 'cash'; } else { $oldPaymentTermId = null; } @endphp
@error('payment_term') @enderror

@lang('purchases::bill_returns.Supplier Details'):

@lang('purchases::bill_returns.Phone'):
@lang('purchases::bill_returns.Email'):
@lang('purchases::bill_returns.Outstanding Balance'):

@lang('sales::invoices.validate_minimum_quantity_message')

@error('products.*')

{!! $message !!}

@enderror @error('products')

{!! $message !!}

@enderror
@if ($customFields->count())
@foreach ($customFields as $key => $field)
@if ($field['type'] == 'checkbox') @else @endif
@endforeach
@endif
@error('terms') @enderror
@error('notes') @enderror
@if ($billReturn) {{-- -------------- popup for displaying bill deleted products ------------------- --}} @endif
@include('purchases::warning-modal')
@endsection @section('extra_scripts') @include('purchases::scripts.get_products_script') @endsection