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

فاتورة شراء: {{ $invoice->invoice_number }}

@if($invoice->can_edit) @can('purchase_invoices.update') تعديل @endcan @endif @can('purchase_invoices.print') طباعة PDF @endcan رجوع
@if(session('success')) @endif @if(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->supplier_invoice_number ?: '-' }}
المورد: {{ $invoice->supplier?->name_ar }}
المخزن: {{ $invoice->warehouse?->name_ar }}
تاريخ الفاتورة: {{ $invoice->invoice_date?->format('Y-m-d') }}
نوع السداد: {{ \App\Models\PurchaseInvoice::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->product?->name_ar ?? '-' }} {{ $item->description_ar ?: '-' }} {{ $item->unit?->name_ar ?? '-' }} {{ number_format((float)$item->quantity, 2) }} {{ number_format((float)$item->unit_cost, 2) }} {{ number_format((float)$item->discount_amount, 2) }} {{ number_format((float)$item->line_total, 2) }}
لا توجد بنود
المدفوعات
@forelse($invoice->supplierPayments as $payment) @empty @endforelse
رقم السداد الطريقة الحساب القيمة
{{ $payment->payment_number }} {{ $payment->payment_method }} {{ $payment->paymentAccount?->name_ar ?? '-' }} {{ number_format((float)$payment->amount, 2) }}
لا توجد مدفوعات
حركات المخزون المرتبطة
@forelse($invoice->stockMovements as $movement) @empty @endforelse
الصنف الاتجاه الكمية التاريخ
{{ $movement->product?->name_ar ?? '-' }} {{ $movement->movement_direction === 'in' ? 'وارد' : 'منصرف' }} {{ number_format((float)$movement->quantity, 2) }} {{ $movement->movement_date?->format('Y-m-d H:i') }}
لا توجد حركات مخزون
ملخص القيم
الإجمالي قبل الخصم{{ number_format((float)$invoice->subtotal_before_discount, 2) }}
خصم الفاتورة{{ number_format((float)$invoice->discount_amount, 2) }}
الضريبة{{ number_format((float)$invoice->tax_amount, 2) }}
المصاريف الإضافية{{ number_format((float)$invoice->additional_expenses_total, 2) }}
الإجمالي النهائي{{ number_format((float)$invoice->grand_total, 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