@extends('backend.partials.master') @section('title') Customer Purchase Price @endsection @section('maincontent') @php // ЁЯСЙ рдЬрд░ route = view рдЕрд╕реЗрд▓ рддрд░ READ-ONLY mode $isView = request()->routeIs('CustomerSellingPrice.view'); @endphp @if($isView) View Customer Sale Price @else Customer Sale Price @endif {{-- тЭМ VIEW MODE рдордзреНрдпреЗ form submit рдирдХреЛ --}} @csrf {{-- ================= LOT NO ================= --}} Lot No {{-- ================= TABLE ================= --}} Sr Lot No Product Rate Expense Commission % @foreach($customers as $c) {{ $c->fname }} @endforeach @forelse($products as $productId => $items) @php $first = $items->first(); // common data @endphp {{ $loop->iteration }} {{ $first->lot_no }} {{ $first->product_name }} {{ number_format($first->rate, 2) }} {{ number_format($first->expense, 2) }} {{ number_format($first->commission_percent, 2) }}% @foreach($customers as $c) @php $price = $items->firstWhere('customer_id', $c->id); @endphp {{ $price ? number_format($price->sale_price, 2) : 'тАФ' }} @endforeach @empty No Data Found @endforelse {{-- ================= BUTTONS ================= --}} Back @endsection @push('scripts') @endpush