@extends('layouts.admin') @push('styles') @endpush @section('content') Product Recipe & Costing Update Recipe List @csrf @method('PUT') Product: Select Product @foreach($products as $v) product_id==$v->product_id)?'selected':''}} >{{$v->product_name}}-({{$v->product_code}}) @endforeach @error('product_id') {{ $message }} @enderror Production Qty: {{$recipe->unit_name}} Sl Ingredients Unit Last Price Quantity Amount Action 1 Select Ingredient @foreach($ingredients as $v) @php $lastPrice = Helper::lastPrice(['product_id' => $v->id]); if(empty($lastPrice)){ $lastPrice = Helper::lastPrice2(['id' => $v->id]); } @endphp {{$v->product_name}}-({{$v->product_code}}) @endforeach Add Loading... @if(!empty($resDetails)) @php $sl=1; $total_amt = 0; $total_Qty = 0; $ingredient['ingredient'] = []; @endphp @foreach($resDetails as $v) @php $product_id = $v->ingredient_id; $quantity = $v->quantity; $price = $v->rate; $total = $v->amount; $total = number_format($total, 3, '.', ''); $unit_name = $v->unit_name; $pname = $v->product_name; $unitid = $v->unitid; $prod_qty = $v->prod_qty; $total_amt = $total_amt + $total; $total_Qty = $total_Qty + $quantity; $ingredient['ingredient'][$product_id] = [ 'product_id' => $product_id, 'quantity' => $quantity, 'price' => $price, 'total' => $total, 'unit_name' => $unit_name, 'pname' => $pname, 'unitid' => $unitid, ]; @endphp {{$sl++}} {{$pname}} {{$unit_name}} {{$price}} {{$quantity}} {{$total}} Edit Delete @endforeach @php session(['ingredient' => $ingredient]); Request::session()->save(); @endphp Total: {{$total_amt}} @php $perKgCost = $total_amt/$prod_qty; $perKgCost = number_format($perKgCost, 3, '.', ''); @endphp Per Kg Cost: {{ $perKgCost }} @endif Note: {{$recipe->details}} @endsection @push('scripts') @endpush
{{$recipe->unit_name}}