@extends('layouts.master') @section('css') @endsection @section('content')
{{ Nameen ?? '' }}

{{ describtionen ?? '' }}

{{ STen ?? '' }}

{{ Taxen ?? '' }}

{{ Namear ?? '' }}

{{ describtionar ?? '' }}

{{ STar ?? '' }}

{{ Taxar ?? '' }}

تقرير مرتجع المشتريات

تاريخ الإصدار {{ date('Y-m-d H:i') }}
بداية الفترة {{ $start_at ?? 'غير محدد' }}
نهاية الفترة {{ $end_at ?? date('Y-m-d') }}
@if (isset($Invoices) && count($Invoices) > 0) @php $grandTotalBeforeTax = 0; $grandTotalTax = 0; $grandTotalFinal = 0; @endphp @foreach ($Invoices as $invoice) @php $totalprice = 0; $totalTaxAmount = 0; $discount = $invoice->discount ?? 0; $products = App\Models\orderDetails::where('order_owner', $invoice->orderId)->where('returns_purchase', '!=', 0)->get(); @endphp
رقم الفاتورة {{ $invoice->orderId }}
المورد {{ optional($invoice->supllier)->name ?? '—' }}
@foreach ($products as $product) @php $lineBase = $product->returns_purchase * $product->purchasingـprice; $lineTax = $product->returns_purchase * $product->Added_Value; $totalprice += $lineBase; $totalTaxAmount += $lineTax; @endphp @endforeach
المنتج الكمية المرتجعة سعر الشراء الضريبة الإجمالي
{{ optional($product->productData)->product_name }} {{ $product->returns_purchase }} {{ number_format($product->purchasingـprice, 2) }} {{ number_format($product->Added_Value, 2) }} {{ number_format($lineBase + $lineTax, 2) }}
@php $totalTax = round($totalTaxAmount, 2); $invoiceGrandTotal = ($totalprice - $discount) + $totalTax; $grandTotalBeforeTax += ($totalprice - $discount); $grandTotalTax += $totalTax; $grandTotalFinal += $invoiceGrandTotal; @endphp
الإجمالي قبل الضريبة{{ number_format($totalprice - $discount, 2) }}
إجمالي الضريبة{{ number_format($totalTax, 2) }}
الإجمالي النهائي{{ number_format($invoiceGrandTotal, 2) }}
@endforeach

ملخص المرتجعات الشامل

الإجمالي قبل الضريبة
{{ number_format($grandTotalBeforeTax, 2) }}
إجمالي الضريبة
{{ number_format($grandTotalTax, 2) }}
الإجمالي النهائي
{{ number_format($grandTotalFinal, 2) }}
@else
لا توجد بيانات مرتجعات خلال الفترة المحددة
@endif
@endsection @section('js') @endsection