@if(count($category)) @php $total_ton_dau = 0; $total_nhap = 0; $total_hoan = 0; $total_xuat_ban = 0; $total_hang_hong = 0; $total_ton_cuoi = 0; @endphp @foreach($category as $key => $item) {{--{{dd($item)}}--}} @if(count($item->history) < 1) @endif @if(count($item->history)) @foreach($item->history as $key1=>$item1) @if($key1 == 1) @endif @php $total_ton_dau += $item1->total_current_quantity; $total_nhap += $item1->nhap_kho; $total_hoan += $item1->hoan; $total_xuat_ban += ($item1->total_current_quantity+$item1->nhap_kho-$item1->ton_cuoi-$item1->xuat_kho-$item1->hang_hong); $total_hang_hong += $item1->hang_hong; $total_ton_cuoi += $item1->ton_cuoi; @endphp @endforeach @endif @endforeach @endif
TT TÊN THƯƠNG HIỆU SẢN PHẨM TỒN ĐẦU NHẬP HOÀN XUẤT BÁN HÀNG HỎNG TỒN CUỐI DỰ KIẾN HẾT GHI CHÚ
{{$key+1}} {{$item->name}}
{{$item1->product->name}} {{number_format($item1->total_current_quantity)}} {{number_format($item1->nhap_kho)}} {{number_format($item1->hoan)}} {{number_format($item1->total_current_quantity+$item1->nhap_kho-$item1->ton_cuoi-$item1->xuat_kho-$item1->hang_hong)}} {{number_format($item1->hang_hong)}} {{number_format($item1->ton_cuoi)}} {{($item1->total_current_quantity+$item1->nhap_kho-$item1->ton_cuoi-$item1->xuat_kho-$item1->hang_hong) > 0 ? round($item1->ton_cuoi/($item1->total_current_quantity+$item1->nhap_kho-$item1->ton_cuoi-$item1->xuat_kho-$item1->hang_hong)) : '' }}
TỔNG CỘNG {{number_format($total_ton_dau)}} {{number_format($total_nhap)}} {{number_format($total_hoan)}} {{number_format($total_xuat_ban)}} {{number_format($total_hang_hong)}} {{number_format($total_ton_cuoi)}} {{$total_xuat_ban >0? round($total_ton_cuoi/$total_xuat_ban) : ''}}