@extends('layouts/layoutMaster') @section('title', 'Batch Material Requests') @section('vendor-style') @vite([ 'resources/assets/vendor/libs/datatables-bs5/datatables.bootstrap5.scss', 'resources/assets/vendor/libs/datatables-responsive-bs5/responsive.bootstrap5.scss', 'resources/assets/vendor/libs/datatables-buttons-bs5/buttons.bootstrap5.scss', 'resources/assets/vendor/libs/select2/select2.scss', 'resources/assets/vendor/libs/@form-validation/form-validation.scss', 'resources/assets/vendor/libs/animate-css/animate.scss', 'resources/assets/vendor/libs/sweetalert2/sweetalert2.scss' ]) @endsection @section('vendor-script') @vite([ 'resources/assets/vendor/libs/moment/moment.js', 'resources/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js', 'resources/assets/vendor/libs/select2/select2.js', 'resources/assets/vendor/libs/@form-validation/popular.js', 'resources/assets/vendor/libs/@form-validation/bootstrap5.js', 'resources/assets/vendor/libs/@form-validation/auto-focus.js', 'resources/assets/vendor/libs/cleavejs/cleave.js', 'resources/assets/vendor/libs/cleavejs/cleave-phone.js', 'resources/assets/vendor/libs/sweetalert2/sweetalert2.js' ]) @endsection @section('content')
{{-- {{ dd($batchMaterialReqNN) }} --}}

@foreach($batchMaterialReq as $item) @csrf @php $totalQty = \App\Models\MaterialInventor::where('material_id', $item->material_id) ->where('status', 'approved') ->sum('available_stock'); $stock = \App\Models\MaterialInventor::with('material')->where('material_id', $item->material_id) ->where('status', 'approved')->get(); // dd($stock); @endphp @if($item->total_kg < $totalQty) @else @endif @php $isDebited = \App\Models\MaterialInventor::where('material_id', $item->material_id) ->where('transction_type', 'dr')->where('batch_material_req_id',$item->id) ->exists(); @endphp {{-- --}} @if($isDebited) @else @endif @endforeach
Material Batch Order Batch Process Total KG Available Qty Action
{{ $item->material->name }} {{ $item->batchOrder->batch_no }} {{ $item->batchProcess->process_name ?? 'Packing Request' }} {{ $item->total_kg }}{{ $stock }}
{{-- --}} @endsection