@extends('layouts.master') @section('css') @endsection @section('title') {{ __('report.product_sales') }} @endsection @section('page-header') @endsection @section('content') {{-- عرض الأخطاء --}} @if ($errors->any()) @endif {{-- رسائل التنبيه --}} @if (session()->has('notfountreturnproduct')) @endif
@csrf
{{-- تاريخ البداية --}}
{{-- تاريخ النهاية --}}
{{-- الفرع --}}

{{-- جدول النتائج --}} @if (isset($products))
@php $i = 0; $totaladdedvalue = 0; $totalprice = 0; $totaldiscount = 0; $avt = App\Models\Avt::find(1); $saleavt = $avt ? $avt->AVT : 0; $productId = 0; @endphp @foreach ($products as $invoice) @php $i++; $productId = optional($invoice->productData)->id; $subTotal = ($invoice->Unit_Price * $invoice->quantity) - $invoice->Discount_Value; $addedVal = $subTotal * $saleavt; $totaladdedvalue += $addedVal; $totalprice += $subTotal; $totaldiscount += $invoice->Discount_Value; @endphp @endforeach
# {{ __('report.invoiceNo') }} {{ __('home.productNo') }} {{ __('home.product') }} {{ __('report.date') }} {{ __('home.quantity') }} {{ __('home.price') }} {{ __('home.discount') }} {{ __('home.priceafterDiscount') }} {{ __('home.addedValue') }} {{ __('home.total') }}
{{ $i }} {{ $invoice->invoice_id }} {{ optional($invoice->productData)->Product_Code }} {{ optional($invoice->productData)->product_name }} {{ $invoice->created_at }} {{ $invoice->quantity }} {{ $invoice->Unit_Price * $invoice->quantity }} {{ $invoice->Discount_Value }} {{ $subTotal }} {{ round($addedVal, 2) }} {{ round($subTotal + $addedVal, 2) }}
{{-- جدول المجاميع الإجمالية --}}
{{ __('home.the amount') }} {{ $totalprice }}
{{ __('home.discount') }} {{ $totaldiscount }}
{{ __('home.addedValue') }} {{ round($totaladdedvalue, 2) }}
{{ __('home.total') }} {{ round($totaladdedvalue + $totalprice, 2) }}
@if ($products->count() > 0 && isset($branch_Id, $start_at, $end_at)) @endif @endif
@endsection @section('js') @endsection