@extends('layouts.app') @section('title', 'الفواتير') @section('content')

الفواتير والاستخدام

ملخص استخدام الخدمة والفواتير

@if(!isset($store) || !$store)

يرجى ربط متجرك أولاً لعرض معلومات الفواتير

@else

الاشتراك الحالي

@if(isset($subscription) && $subscription)
الحالة {{ $subscription->status === 'active' ? 'نشط' : $subscription->status }}
الخطة {{ $subscription->plan_name ?? 'غير محدد' }}
تاريخ البدء {{ $subscription->started_at?->format('Y-m-d') ?? '-' }}
تاريخ الانتهاء {{ $subscription->expires_at?->format('Y-m-d') ?? '-' }}
@if($subscription->price)
السعر {{ number_format($subscription->price, 2) }} ر.س
@endif
@else

لا يوجد اشتراك نشط حالياً

اختيار خطة
@endif

استخدام هذا الشهر

@if(isset($usage) && $usage->isNotEmpty())
@foreach($usage as $item)
@switch($item->resource_type) @case('call') المكالمات @break @case('whatsapp') رسائل واتساب @break @case('transcript') نسخ النصوص @break @case('summary') تلخيص ذكي @break @default {{ $item->resource_type }} @endswitch
{{ number_format($item->total) }} @if($item->total_cost) {{ number_format($item->total_cost, 2) }} ر.س @endif
@endforeach
@else

لا يوجد استخدام مسجل لهذا الشهر

@endif

ملخص الاستخدام التراكمي

@if(isset($usage) && $usage->isNotEmpty()) @php $totalCost = $usage->sum('total_cost'); @endphp

إجمالي تكلفة الاستخدام هذا الشهر

{{ number_format($totalCost, 2) }} ر.س

@if(isset($subscription) && $subscription)

باقي من خطة الاشتراك

{{ $subscription->price ? number_format(max(0, $subscription->price - $totalCost), 2) : '-' }} ر.س

@endif
@else

لا توجد بيانات استخدام متاحة

@endif
@endif
@endsection