@extends('master') @section('content') @if(session('success')) @endif @if(session('error')) @endif @if(session('verification_alert')) @endif
@if (auth()->user()->level=="user_mikro" || auth()->user()->level == "super_admin")

Item Stock - Microbiology

biotech
@foreach($stokmikro->unique('item_code') as $item) @endforeach
Last Usage Catalog No Item Code Item Description UOM Total Stock View
@php $lastUsage = $lastUsageMikro[$item->item_code] ?? null; @endphp {!! $lastUsage ? \Carbon\Carbon::parse($lastUsage)->format('d-m-Y H:i') : 'Not Yet Usage' !!} {{ $item->catalog_no }} {{ $item->item_code }} {{ $item->item_description }} {{ $item->uom }} {{ $stokmikro->where('item_code', $item->item_code)->sum('quantity') }}
@php $hasWarning = collect($stokmikro) ->where('item_code', $item->item_code) ->where('quantity', '>', 0) ->contains(function($detail) { $daysToED = \Carbon\Carbon::now()->diffInDays(\Carbon\Carbon::parse($detail->exp_date), false); return $daysToED < 60; // Ini akan menangkap baik yang mendekati ED maupun yang sudah ED }); @endphp @if($hasWarning) warning @endif
@php $groupedStok = collect($stokmikro) ->where('item_code', $item->item_code) ->where('quantity', '>', 0) ->groupBy(function($item) { return $item->item_code . '-' . $item->lot_number; }) ->map(function ($group) { return [ 'item_code' => $group->first()->item_code, 'item_description' => $group->first()->item_description, 'lot_number' => $group->first()->lot_number, 'exp_date' => $group->first()->exp_date, 'total_quantity' => $group->sum('quantity'), 'id' => $group->first()->id, 'barcode' => $group->first()->barcode ]; }); @endphp @foreach($groupedStok as $group) @endforeach
Item Code Item Description Lot Number Exp Date Quantity ({{ $item->uom }}) Notes
{{ $group['item_code'] }} {{ $group['item_description'] }} {{ $group['lot_number'] }} {{ \Carbon\Carbon::parse($group['exp_date'])->format('d-m-Y') }} @if(\Carbon\Carbon::parse($group['exp_date'])->diffInDays(\Carbon\Carbon::now()) < 60) warning @endif {{ $group['total_quantity'] }} @php $daysToED = \Carbon\Carbon::now()->diffInDays(\Carbon\Carbon::parse($group['exp_date']), false); @endphp @if($group['total_quantity'] > 0 && $daysToED < 60) @if($daysToED < 0) @else {{ $daysToED }} hari sebelum ED @endif @endif
@endif @if (auth()->user()->level=="user_cpo" || auth()->user()->level == "super_admin")

Item Stock - Chemical & FO

science
@foreach($stokcpo->unique('item_code') as $item) @endforeach
Last Usage Catalog No Item Code Item Description UOM Total Stock View
@php $lastUsage = $lastUsageCPO[$item->item_code] ?? null; @endphp {!! $lastUsage ? \Carbon\Carbon::parse($lastUsage)->format('d-m-Y H:i') : 'Not Yet Usage' !!} {{ $item->catalog_no }} {{ $item->item_code }} {{ $item->item_description }} {{ $item->uom }} {{ $stokcpo->where('item_code', $item->item_code)->sum('quantity') }}
@php $hasWarning = collect($stokcpo) ->where('item_code', $item->item_code) ->where('quantity', '>', 0) ->contains(function($detail) { $daysToED = \Carbon\Carbon::now()->diffInDays(\Carbon\Carbon::parse($detail->exp_date), false); return $daysToED < 60; // Ini akan menangkap baik yang mendekati ED maupun yang sudah ED }); @endphp @if($hasWarning) warning @endif
@php $groupedStok = collect($stokcpo) ->where('item_code', $item->item_code) ->where('quantity', '>', 0) ->groupBy(function($item) { return $item->item_code . '-' . $item->lot_number; }) ->map(function ($group) { return [ 'item_code' => $group->first()->item_code, 'item_description' => $group->first()->item_description, 'lot_number' => $group->first()->lot_number, 'exp_date' => $group->first()->exp_date, 'total_quantity' => $group->sum('quantity'), 'id' => $group->first()->id, 'barcode' => $group->first()->barcode ]; }); @endphp @foreach($groupedStok as $group) @endforeach
Item Code Item Description Lot Number Exp Date Quantity ({{ $item->uom }}) Notes
{{ $group['item_code'] }} {{ $group['item_description'] }} {{ $group['lot_number'] }} {{ \Carbon\Carbon::parse($group['exp_date'])->format('d-m-Y') }} @if(\Carbon\Carbon::parse($group['exp_date'])->diffInDays(\Carbon\Carbon::now()) < 60) warning @endif {{ $group['total_quantity'] }} @php $daysToED = \Carbon\Carbon::now()->diffInDays(\Carbon\Carbon::parse($group['exp_date']), false); @endphp @if($group['total_quantity'] > 0 && $daysToED < 60) @if($daysToED < 0) @else {{ $daysToED }} hari sebelum ED @endif @endif
@endif @if (auth()->user()->level=="user_ci" || auth()->user()->level == "super_admin")

Item Stock - Chem Instrument

fax
@foreach($stokci->unique('item_code') as $item) @endforeach
Last Usage Catalog No Item Code Item Description UOM Total Stock View
@php $lastUsage = $lastUsageCI[$item->item_code] ?? null; @endphp {!! $lastUsage ? \Carbon\Carbon::parse($lastUsage)->format('d-m-Y H:i') : 'Not Yet Usage' !!} {{ $item->catalog_no }} {{ $item->item_code }} {{ $item->item_description }} {{ $item->uom }} {{ $stokci->where('item_code', $item->item_code)->sum('quantity') }}
@php $hasWarning = collect($stokci) ->where('item_code', $item->item_code) ->where('quantity', '>', 0) ->contains(function($detail) { $daysToED = \Carbon\Carbon::now()->diffInDays(\Carbon\Carbon::parse($detail->exp_date), false); return $daysToED < 60; // Ini akan menangkap baik yang mendekati ED maupun yang sudah ED }); @endphp @if($hasWarning) warning @endif
@php $groupedStok = collect($stokci) ->where('item_code', $item->item_code) ->where('quantity', '>', 0) ->groupBy(function($item) { return $item->item_code . '-' . $item->lot_number; }) ->map(function ($group) { return [ 'item_code' => $group->first()->item_code, 'item_description' => $group->first()->item_description, 'lot_number' => $group->first()->lot_number, 'exp_date' => $group->first()->exp_date, 'total_quantity' => $group->sum('quantity'), 'id' => $group->first()->id, 'barcode' => $group->first()->barcode ]; }); @endphp @foreach($groupedStok as $group) @endforeach
Item Code Item Description Lot Number Exp Date Quantity ({{ $item->uom }}) Notes
{{ $group['item_code'] }} {{ $group['item_description'] }} {{ $group['lot_number'] }} {{ \Carbon\Carbon::parse($group['exp_date'])->format('d-m-Y') }} @if(\Carbon\Carbon::parse($group['exp_date'])->diffInDays(\Carbon\Carbon::now()) < 60) warning @endif {{ $group['total_quantity'] }} @php $daysToED = \Carbon\Carbon::now()->diffInDays(\Carbon\Carbon::parse($group['exp_date']), false); @endphp @if($group['total_quantity'] > 0 && $daysToED < 60) @if($daysToED < 0) @else {{ $daysToED }} hari sebelum ED @endif @endif
@endif @push('scripts') @endpush @endsection