@extends('layouts.app') @php $locale = app()->getLocale(); $isRtl = $locale === 'ar'; $currency = \App\Models\Setting::currencyLabel($locale); $productsData = $products->map(fn ($p) => [ 'id' => $p->id, 'name' => $isRtl && $p->name_ar ? $p->name_ar : $p->name, 'price' => (float) $p->selling_price, ])->values(); $plansData = $plans->map(fn ($pl) => [ 'id' => $pl->id, 'name' => $isRtl && $pl->name_ar ? $pl->name_ar : $pl->name, 'price' => (float) $pl->price, ])->values(); $invoiceItems = $invoice->items->map(fn ($it) => [ 'product_id' => $it->product_id ?: '', 'membership_plan_id' => $it->membership_plan_id ?: '', 'description' => $it->description, 'quantity' => (int) $it->quantity, 'unit_price' => (float) $it->unit_price, ])->values()->toArray(); @endphp @section('title', $isRtl ? 'تعديل فاتورة' : 'Edit Invoice') @section('content')

{{ $isRtl ? 'تعديل فاتورة' : 'Edit Invoice' }}

{{ $invoice->invoice_number }}

@csrf @method('PUT') @if($errors->any())

{{ $isRtl ? 'يرجى تصحيح الأخطاء التالية:' : 'Please fix the following errors:' }}

    @foreach($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif

{{ $isRtl ? 'معلومات الفاتورة' : 'Invoice Details' }}

{{ $isRtl ? 'بنود الفاتورة' : 'Invoice Items' }}

{{ $isRtl ? 'أضف منتج/خطة أو أدخل وصفاً وسعراً' : 'Pick product/plan or enter a custom description and price' }}

{{ $isRtl ? 'المنتج' : 'Product' }} {{ $isRtl ? 'الخطة' : 'Plan' }} {{ $isRtl ? 'الوصف' : 'Description' }} * {{ $isRtl ? 'الكمية' : 'Qty' }} * {{ $isRtl ? 'سعر الوحدة' : 'Unit price' }} * {{ $isRtl ? 'الإجمالي' : 'Total' }} {{ $isRtl ? 'حذف' : 'Remove' }}
{{ $isRtl ? 'المجموع الفرعي' : 'Subtotal' }} {{ $currency }}
{{ $isRtl ? 'الخصم' : 'Discount' }} {{ $currency }}
{{ $isRtl ? 'الضريبة' : 'Tax' }} {{ $currency }}
{{ $isRtl ? 'الإجمالي' : 'Total' }} {{ $currency }}
{{ $isRtl ? 'المدفوع' : 'Paid' }} {{ number_format((float) $invoice->paid_amount, 2) }} {{ $currency }}
{{ $isRtl ? 'المتبقي (بعد الحفظ)' : 'Remaining (after save)' }} {{ $currency }}

{{ $isRtl ? 'ملاحظات وشروط' : 'Notes & Terms' }}

{{ $isRtl ? 'إلغاء' : 'Cancel' }}
@endsection