@if(count($productStockData)>0) @php $bgColor = ''; $textColor = ''; @endphp @foreach($productStockData as $key => $row) @php $currentStock = getCurrentStock($row->id,''); @endphp @if(isset($row->exp_date)) @php $expiryDateTime = new DateTime($row->exp_date); $today = new DateTime(); $interval = $today->diff($expiryDateTime); $daysDifference = $interval->days; if ($daysDifference < 30) { $color = "red"; } @endphp @endif {!! $key + 1 !!} {!! $row->name !!} {!! convertDecimelPoint($row->mrp)??'' !!} {{-- {!! $row->batch??'N/A' !!}--}} {!! $currentStock??0 !!} {!! $row->exp_date?date('d-M-Y',strtotime($row->exp_date)) :'' !!} @if(!isset($row->product_short_list_id) && $row->product_short_list_id=='') @endif @endforeach @else No Data Available. @endif