@extends('backend.partials.master') @section('title') Customer Purchase Price @endsection @section('maincontent') @php // 👉 जर route = view असेल तर READ-ONLY mode $isView = request()->routeIs('CustomerSalePrice.view'); @endphp

@if($isView) View Customer Purchase Price @else Customer Purchase Price @endif

{{-- ❌ VIEW MODE मध्ये form submit नको --}}
@csrf {{-- ================= LOT NO ================= --}}
{{-- ================= TABLE ================= --}}
@foreach($customers as $c) @endforeach @forelse($products as $productId => $items) @php $first = $items->first(); // common data @endphp {{-- 🔹 Customer-wise price --}} @foreach($customers as $c) @php $price = $items->firstWhere('customer_id', $c->id); @endphp @endforeach @empty @endforelse
Sr No Lot No Product Rate Expense Commission %{{ $c->fname }}
{{ $loop->iteration }} {{ $first->lot_no }} {{ $first->product_name }} {{ number_format($first->rate, 2) }} {{ number_format($first->expense, 2) }} {{ number_format($first->commission_percent, 2) }}% {{ $price ? number_format($price->sale_price, 2) : '—' }}
No Data Found
{{-- ================= BUTTONS ================= --}}
@endsection @push('scripts') @endpush