@extends('admin.layouts.master') @section('title', 'تفاصيل فاتورة البيع') @section('content')

فاتورة بيع: {{ $invoice->invoice_number }}

@if($invoice->can_edit) @can('sales_invoices.update') تعديل @endcan @endif @can('sales_invoices.print') طباعة PDF @endcan رجوع
@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif
الإجمالي

{{ number_format((float)$invoice->grand_total, 2) }}

المدفوع

{{ number_format((float)$invoice->paid_amount, 2) }}

المتبقي

{{ number_format((float)$invoice->remaining_amount, 2) }}

الحالة

{!! $invoice->status_badge !!}

بيانات الفاتورة
رقم الفاتورة: {{ $invoice->invoice_number }}
العميل: {{ $invoice->customer?->name_ar }}
المخزن: {{ $invoice->warehouse?->name_ar }}
تاريخ الفاتورة: {{ $invoice->invoice_date?->format('Y-m-d') }}
نوع السداد: {{ \App\Models\SalesInvoice::PAYMENT_TERMS[$invoice->payment_terms] ?? '-' }}
الاستحقاق: {{ $invoice->due_date?->format('Y-m-d') ?? '-' }}
أنشئ بواسطة: {{ $invoice->creator?->name ?? '-' }}
اعتمد بواسطة: {{ $invoice->poster?->name ?? '-' }}
@if($invoice->notes_ar)
ملاحظات: {{ $invoice->notes_ar }}
@endif
بنود الفاتورة
@forelse($invoice->items as $item) @empty @endforelse
# النوع الوصف الصنف / الخدمة الوحدة الكمية سعر الوحدة خصم الإجمالي
{{ $loop->iteration }} {{ $item->line_type === 'service' ? 'خدمة' : 'صنف' }} {{ $item->description_ar }} {{ $item->line_type === 'service' ? ($item->serviceType?->name_ar ?? '-') : ($item->product?->name_ar ?? '-') }} {{ $item->unit?->name_ar ?? '-' }} {{ number_format((float)$item->quantity, 2) }} {{ number_format((float)$item->unit_price, 2) }} {{ number_format((float)$item->discount_amount, 2) }} {{ number_format((float)$item->line_total, 2) }}
لا توجد بنود
طرق السداد المسجلة
@forelse($invoice->customerPayments as $pay) @empty @endforelse
رقم السداد الطريقة الحساب القيمة
{{ $pay->payment_number }} {{ $pay->payment_method }} {{ $pay->paymentAccount?->name_ar ?? '-' }} {{ number_format((float)$pay->amount, 2) }}
لا توجد سدادات
سجل العمليات
@forelse($activities as $log) @empty @endforelse
الحدث الوصف المنفذ التاريخ
{{ $log->event_name }} {{ $log->description_ar }} {{ $log->causer?->name ?? '-' }} {{ $log->created_at?->format('Y-m-d H:i') }}
لا يوجد سجل عمليات
@endsection