@extends('layouts.master') @section('title', 'Simplified Tax Invoice') @section('css') @endsection @section('content')
{{-- ===== HEADER ===== --}}

فاتورة ضريبية مبسطة
Simplified Tax Invoice

{{-- ===== BASIC INFO ===== --}}

Invoice No / رقم الفاتورة: {{ $sub->invoice_no }}

Date / التاريخ: {{ $sub->created_at->format('Y-m-d') }}

VAT Number / الرقم الضريبي: 314133750400003

العضو: {{ $sub->member->name ?? '—' }}

Branch / الفرع: {{ $sub->branch->name ?? '—' }}

Status / الحالة: @if ($sub->status === 'approved') معتمد ✅ @elseif($sub->status === 'rejected') مرفوض ❌ @else تحت المراجعة @endif

{{-- ===== DATES ===== --}}

📅 بداية الاشتراك: {{ $sub->start_date->format('Y-m-d') }}

⏳ نهاية الاشتراك: {{ $sub->end_date->format('Y-m-d') }}

{{-- ===== ITEMS TABLE ===== --}} @php $base_price = $sub->price; // السعر الأساسي $extra_discount = $sub->discount; // الخصم الإضافي فقط $tax = $sub->tax; // الضريبة المحفوظة $total = $sub->total; // الإجمالي النهائي $net_amount = $total - $tax; // الصافي قبل الضريبة (الحقيقي) @endphp
الوصف / Description الكمية / Qty السعر الأساسي / Base Price الخصم الإضافي / Extra Discount الصافي قبل الضريبة / Net Before VAT الضريبة / VAT (15%) الإجمالي / Total
{{ $sub->item_name }} 1 {{ number_format($base_price, 2) }} {{ number_format($extra_discount, 2) }} {{ number_format($net_amount, 2) }} {{ number_format($tax, 2) }} {{ number_format($total, 2) }}
{{-- ===== PAYMENTS ===== --}} @php $payments = is_array($sub->payment_methods) ? $sub->payment_methods : json_decode($sub->payment_methods, true); @endphp @if (!empty($payments))
💳 تفاصيل الدفع / Payment Details
@foreach ($payments as $p) @php $method = \App\Models\PaymentMethod::find($p['method_id'] ?? null); @endphp @endforeach
طريقة الدفع / Method المبلغ / Amount
{{ $method->name_ar ?? '—' }} {{ number_format($p['amount'] ?? 0, 2) }}
@endif {{-- ===== TOTAL ===== --}}
الإجمالي شامل الضريبة / Total incl. VAT
{{ number_format($sub->total, 2) }}
{{-- ===== FOOTER ===== --}}
@endsection @section('js') @endsection