@extends('layouts.master') @section('css') @endsection @section('title') {{ __('home.recentquotation') }} @endsection @section('page-header') @endsection @section('content') @if (count($errors) > 0)
خطأ
@endif
@php $avtData = App\Models\Avt::find(1); $avtSaleRate = $avtData ? $avtData->AVT : 0.15; // تحميل أصناف كل عروض الصفحة في استعلام واحد $pageItems = App\Models\offer_price_to_customer_items::whereIn('order_id', $data->pluck('id')) ->get()->groupBy('order_id'); @endphp @foreach ($data as $product) @endforeach
{{ __('home.Invoice_no') }} {{ __('home.clietName') }} {{ __('home.date') }} {{ __('home.branch') }} {{ __('home.total') }} {{ __('home.operations') }}
{{ $product->id }} {{ $product->customer->name }} {{ $product->created_at->format('Y-m-d') }} {{ $product->branch->name }} @php // الحساب الموحد (نفس الشاشة والطباعة و PDF) $totalWithTax = \App\Support\QuotationTotals::calculate( $pageItems->get($product->id, collect()), $product->discount ?? 0, $avtSaleRate )['grand_total']; @endphp {{ number_format($totalWithTax, 2) }}
@csrf
{{ $data->links() }}
@endsection @section('js') @endsection