@extends('layouts.master') @section('css') @endsection @section('title') {{ __('home.print') }} - {{ __('reports.sales') }} @stop @section('content')
{{ $Namear ?? '' }}

{{ $describtionar ?? '' }}

{{ $STar ?? '' }}

{{ $Taxar ?? '' }}

@php $logo = camplogo ?? ''; @endphp logo
{{ $Nameen ?? '' }}

{{ $describtionen ?? '' }}

{{ $STen ?? '' }}

{{ $Taxen ?? '' }}

المبيعات   Sales
{{ __('report.fromdate') }}: {{ $start[0] ?? '' }} {{ __('report.todate') }}: {{ $end[0] ?? '' }}
@php $totalPriceAll = 0; $totalAddedValueAll = 0; $totalDiscountAll = 0; $totalPriceAfterDiscountAll = 0; $avt = App\Models\Avt::find(1); $taxRate = $avt ? $avt->AVT : 0.15; @endphp
@foreach ($Invoices as $product) @php $currentInvoicePrice = ($product->cashamount + $product->bankamount + $product->Bank_transfer + $product->creaditamount); $invoiceDiscount = 0; $discound_return_sales = App\Models\return_sales::where('invoice_id', $product->id)->sum('discountvalue'); $discount_sales = App\Models\sales::where('invoice_id', $product->id)->sum('Discount_Value'); $invoiceDiscount += $discound_return_sales; $invoiceDiscount += $discount_sales; $invoiceDiscount += $product->discount == 0 ? $product->discountOnInvoice : ($product->discount - $discount_sales - $discound_return_sales); $priceBeforeTax = $currentInvoicePrice / (1 + $taxRate); $taxAmount = $currentInvoicePrice - $priceBeforeTax; $totalPriceAll += $currentInvoicePrice; $totalDiscountAll += $invoiceDiscount; $totalAddedValueAll += $taxAmount; $totalPriceAfterDiscountAll += $priceBeforeTax; $paymentMethod = match($product->Pay) { 'Cash' => __('report.cash'), 'Shabka' => __('report.shabka'), 'Credit' => __('report.credit'), 'Bank_transfer' => __('home.Bank_transfer'), default => __('home.Partition of the amount'), }; @endphp @endforeach
{{ __('home.Invoice_no') }} {{ __('home.date') }} {{ __('home.clietName') }} {{ __('home.paymentmethod') }} {{ __('home.total') }} {{ __('home.discount') }} {{ __('home.totalafterdiscount') }} {{ __('home.avt') }} {{ __('home.totalwithTax') }}
{{ $product->id }} {{ $product->created_at }} {{ $product->customer->name ?? 'N/A' }} {{ $paymentMethod }} {{ number_format($priceBeforeTax + $invoiceDiscount, 2) }} {{ number_format($invoiceDiscount, 2) }} {{ number_format($priceBeforeTax, 2) }} {{ number_format($taxAmount, 2) }} {{ number_format($currentInvoicePrice, 2) }}
@endsection @section('js') @endsection