@section('title', $isEditMode ? __('admin.Edit_purchase_invoice') : __('admin.Add_a_purchase_invoice'))

{{ __('admin.Purchases') }}

@error('supplier_id') {{ $message }} @enderror
@error('date') {{ $message }} @enderror
@foreach ($items as $index => $item) @endforeach
# {{ __('admin.product_name') }} {{ __('admin.quantity') }} {{ __('admin.cost_price') }} {{ __('admin.sell_price') }} {{ __('admin.subtotal') }}
{{ $index + 1 }} @error('items.' . $index . '.product_name') {{ $message }} @enderror @error('items.' . $index . '.quantity') {{ $message }} @enderror @error('items.' . $index . '.cost_price') {{ $message }} @enderror @error('items.' . $index . '.sell_price') {{ $message }} @enderror @php $costPrice = is_numeric($item['cost_price'] ?? 0) ? floatval($item['cost_price']) : 0; $quantity = is_numeric($item['quantity'] ?? 0) ? intval($item['quantity']) : 0; $subtotal = $costPrice * $quantity; @endphp
الدفع
@error('bank_account_id') {{ $message }} @enderror
@error('payment_amount') {{ $message }} @enderror
المدفوع: {{ number_format($payment_amount, 2) }}
المتبقي: {{ number_format($remaining, 2) }}
@error('notes') {{ $message }} @enderror
@push('css') @endpush @push('js') @endpush