@extends('layouts.master') @section('title', 'عرض اشتراك') @section('content')
{{-- HEADER --}}

عرض اشتراك رقم {{ $sub->invoice_no ?? '—' }}

طباعة
{{-- BASIC INFO --}}
تفاصيل الاشتراك
الفرع: {{ $sub->branch->name ?? '—' }}
العضو: {{ $sub->member->name ?? '—' }}
مسجّل الاشتراك: {{ $sub->creator->name ?? '—' }}
نوع الاشتراك: {{ $sub->subscription_type === 'service' ? 'خدمة' : 'عرض' }}
رقم الاعتماد: {{ $sub->verification_code ?? '—' }}
الحالة: @php $statusMap = [ 'approved' => ['success', 'معتمد'], 'under_review' => ['warning', 'تحت المراجعة'], 'rejected' => ['danger', 'مرفوض'], 'new' => ['secondary', 'جديد'], ]; [$cls, $txt] = $statusMap[$sub->status] ?? ['secondary', '—']; @endphp {{ $txt }}
{{-- ITEM DETAILS --}}
تفاصيل العنصر
@php $net = ($sub->price ?? 0) - ($sub->discount ?? 0); @endphp
العنصر السعر الخصم الصافي الضريبة الإجمالي
{{ $sub->item_name ?? '—' }} {{ number_format($sub->price ?? 0, 2) }} {{ number_format($sub->discount ?? 0, 2) }} {{ number_format($net, 2) }} {{ number_format($sub->tax ?? 0, 2) }} {{ number_format($sub->total ?? 0, 2) }}
{{-- PAYMENT METHODS --}} @php $payments = is_array($sub->payment_methods) ? $sub->payment_methods : json_decode($sub->payment_methods, true); $payments = collect($payments); $paymentMethods = \App\Models\PaymentMethod::where('active', 1)->get()->keyBy('id'); @endphp @if ($payments->isNotEmpty())
تفاصيل الدفع
@foreach ($payments as $p) @php $methodId = $p['method_id'] ?? null; $method = $methodId ? $paymentMethods[$methodId] ?? null : null; @endphp @endforeach
طريقة الدفع المبلغ
{{ $method ? (app()->getLocale() === 'ar' ? $method->name_ar : $method->name_en) : '—' }} {{ number_format($p['amount'] ?? 0, 2) }}
@endif {{-- PERIOD --}}
تاريخ البداية: {{ optional($sub->start_date)->format('Y-m-d') ?? '—' }}
تاريخ الانتهاء: {{ optional($sub->end_date)->format('Y-m-d') ?? '—' }}
@endsection