@extends('backend.partials.master') @section('title') Customer Sale Price {{ !empty($old) ? 'Edit' : 'Create' }} @endsection @section('maincontent') @php $groupedProducts = !empty($old) ? $old->groupBy('product_id') : collect(); @endphp

{{ !empty($old) ? 'Edit' : 'Create' }} Customer Sale Price

@csrf @if(!empty($old)) @method('PUT') @endif
@error('lot_no') {{ $message }} @enderror
@foreach($customers as $customer) @endforeach @if(!empty($old)) @foreach($groupedProducts as $pIndex => $items) @php $first = $items->first(); // product common data @endphp {{-- Customer-wise prices --}} @foreach($customers as $cIndex => $customer) @php $row = DB::table('customer_selling_prices') ->where('product_id',$first->product_id) ->where('customer_id', $customer->id) ->first(); @endphp @endforeach @endforeach @endif
Sr No Lot No Product Purchase Price Expense Commission % {{ $customer->fname }}
{{ $loop->iteration }} {{ $first->lot_no }} {{ $first->product_name }} {{ number_format($first->rate, 2) }}
Cancel
@endsection @push('scripts') @endpush