@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(); $defaultItems = [ ['product_id' => '', 'membership_plan_id' => '', 'description' => '', 'quantity' => 1, 'unit_price' => 0], ]; @endphp @section('title', $isRtl ? 'فاتورة جديدة' : 'New Invoice') @section('content')

{{ $isRtl ? 'إنشاء فاتورة' : 'Create Invoice' }}

{{ $isRtl ? 'إنشاء فاتورة مبيعات/اشتراك/خدمة' : 'Create a sale/subscription/service invoice' }}

@csrf @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 ? 'ملاحظات وشروط' : 'Notes & Terms' }}

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