@extends('layouts.master') @section('css') @endsection @section('title') {{__('home.print')}} @stop @section('content')


{{ $Nameen ?? '' }}

{{ $describtionen ?? '' }}

{{ $STen ?? '' }}

{{ $Taxen ?? '' }}

@php $logo = $camplogo ?? 'logo.png'; @endphp logo

{{ $Namear ?? '' }}

{{ $describtionar ?? '' }}

{{ $STar ?? '' }}

{{ $Taxar ?? '' }}

@php // جلب نسبة الضريبة $avt_data = App\Models\Avt::find(1); $saleavt = $avt_data->AVT ?? 0.15; $grandTotalBeforeTax = 0; $grandTotalTax = 0; $i = 0; @endphp

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

الفترة من: {{ $start }} إلى: {{ $end }}

@foreach($Invoices as $invoiceId => $items) @php $i++; // حساب إجمالي الكميات لهذه الفاتورة $invoiceQty = $items->sum('return_quantity'); // حساب الخصم (خصم الصنف + خصم الفاتورة) $invoiceDiscount = $items->sum('discountvalue') + $items->sum('discountoninvoice'); // تطبيق المعادلة: (السعر * الكمية) - الخصم = الصافي قبل الضريبة $subTotalBeforeTax = $items->sum(function($item) { return ($item->return_Unit_Price * $item->return_quantity) - ($item->discountvalue + $item->discountoninvoice); }); $taxAmount = $subTotalBeforeTax * $saleavt; $totalWithTax = $subTotalBeforeTax + $taxAmount; // تجميع الإجماليات النهائية للتقرير $grandTotalBeforeTax += $subTotalBeforeTax; $grandTotalTax += $taxAmount; @endphp @endforeach
# {{__('report.date')}} {{__('report.invoiceNo')}} {{__('home.quantity')}} {{__('home.price')}} (صافي) {{__('home.addedValue')}} {{__('home.discount')}} {{__('home.total')}}
{{ $i }} {{ $items->first()->created_at->format('Y-m-d') }} {{ $invoiceId }} {{ number_format($invoiceQty, 0) }} {{ number_format($subTotalBeforeTax, 2) }} {{ number_format($taxAmount, 2) }} {{ number_format($invoiceDiscount, 2) }} {{ number_format($totalWithTax, 2) }}
{{__('report.totalpricewithoudtax')}} {{ number_format($grandTotalBeforeTax, 2) }}
{{__('report.totaltax')}} {{ number_format($grandTotalTax, 2) }}
{{__('report.totalallprice')}} {{ number_format($grandTotalBeforeTax + $grandTotalTax, 2) }}
@endsection @section('js') @endsection