NTG TNA Dashboard

All Buyers @foreach ($buyerList as $buyer) {{ $buyer }} @endforeach
Total Qty

{{ number_format($totalQty) }}

Avg Lead Time

{{ round($totalLeadTime) }} Days

Avg Free Time

{{ round($avgOrderFreeTime) }} Days

@foreach ([ 'lab_dip_submission', 'fabric_booking', 'fit_sample_submission', 'print_strike_off_submission', 'bulk_accessories_booking', 'fit_comments', 'bulk_yarn_inhouse', 'bulk_accessories_inhouse', 'pp_sample_submission', 'bulk_fabric_knitting', 'pp_comments_receive', 'bulk_fabric_dyeing', 'bulk_fabric_delivery', 'pp_meeting', 'fabrics_and_accessories_inspection', 'size_set_making', 'pattern_correction', 'machines_layout', 'cutting', 'print_start', 'bulk_sewing_input', 'bulk_wash_start', 'bulk_finishing_start', 'bulk_cutting_close', 'print_close', 'bulk_sewing_close', 'bulk_wash_close', 'bulk_finishing_close', 'pre_final_inspection', 'final_inspection', 'ex_factory' ] as $task) @endforeach @foreach ([ 'lab_dip_submission', 'fabric_booking', 'fit_sample_submission', 'print_strike_off_submission', 'bulk_accessories_booking', 'fit_comments', 'bulk_yarn_inhouse', 'bulk_accessories_inhouse', 'pp_sample_submission', 'bulk_fabric_knitting', 'pp_comments_receive', 'bulk_fabric_dyeing', 'bulk_fabric_delivery', 'pp_meeting', 'fabrics_and_accessories_inspection', 'size_set_making', 'pattern_correction', 'machines_layout', 'cutting', 'print_start', 'bulk_sewing_input', 'bulk_wash_start', 'bulk_finishing_start', 'bulk_cutting_close', 'print_close', 'bulk_sewing_close', 'bulk_wash_close', 'bulk_finishing_close', 'pre_final_inspection', 'final_inspection', 'ex_factory' ] as $task) @endforeach @forelse ($tnas as $tna) @foreach ([ 'lab_dip_submission', 'fabric_booking', 'fit_sample_submission', 'print_strike_off_submission', 'bulk_accessories_booking', 'fit_comments', 'bulk_yarn_inhouse', 'bulk_accessories_inhouse', 'pp_sample_submission', 'bulk_fabric_knitting', 'pp_comments_receive', 'bulk_fabric_dyeing', 'bulk_fabric_delivery', 'pp_meeting', 'fabrics_and_accessories_inspection', 'size_set_making', 'pattern_correction', 'machines_layout', 'cutting', 'print_start', 'bulk_sewing_input', 'bulk_wash_start', 'bulk_finishing_start', 'bulk_cutting_close', 'print_close', 'bulk_sewing_close', 'bulk_wash_close', 'bulk_finishing_close', 'pre_final_inspection', 'final_inspection', 'ex_factory' ] as $task) @foreach (['plan', 'actual'] as $type) @php $date = $tna->{$task . '_' . $type}; $cellClass = ''; if ($date && $date != 'N/A') { $today = \Carbon\Carbon::now(); $cellDate = \Carbon\Carbon::parse($date); $diffDays = $today->diffInDays($cellDate, false); if ($type === 'plan' && empty($tna->{$task . '_actual'})) { if ($cellDate->isToday() || $cellDate->lt($today)) { $cellClass = 'bg-red'; } elseif ($diffDays <= 2) { $cellClass = 'bg-yellow'; } else { $cellClass = 'bg-light'; } } if ($type === 'actual' && $tna->{$task . '_plan'}) { $planDate = \Carbon\Carbon::parse($tna->{$task . '_plan'}); $actualDate = \Carbon\Carbon::parse($date); if ($cellDate->gt($planDate)) { $cellClass = 'text-danger font-weight-bold'; } if ($cellDate->gt($actualDate)) { $cellClass = 'bg-light'; } } } elseif ($date == 'N/A') { $date = 'N/A'; } @endphp @if ($type === 'actual' && empty($date)) @if ( $task == 'lab_dip_submission' || $task == 'fabric_booking' || $task == 'fit_sample_submission' || $task == 'print_strike_off_submission' || $task == 'bulk_accessories_booking' || $task == 'fit_comments' || $task == 'bulk_yarn_inhouse' || $task == 'bulk_accessories_inhouse' || $task == 'pp_sample_submission' || $task == 'bulk_fabric_knitting' || $task == 'pp_comments_receive' || $task == 'bulk_fabric_dyeing' || $task == 'bulk_fabric_delivery') @if (auth()->user()->role_id == 1 || auth()->user()->role_id == 3 || auth()->user()->role_id == 4) @else @endif @elseif ($task == 'fabrics_and_accessories_inspection') @if (auth()->user()->role_id == 1 || auth()->user()->role_id == 10008 || auth()->user()->role_id == 10009 || auth()->user()->role_id == 4) @else @endif @elseif ($task == 'size_set_making') @if (auth()->user()->role_id == 1 || auth()->user()->role_id == 10005 || auth()->user()->role_id == 4) @else @endif @elseif ($task == 'pattern_correction') @if (auth()->user()->role_id == 1 || auth()->user()->role_id == 10007 || auth()->user()->role_id == 10008 || auth()->user()->role_id == 4) @else @endif @elseif ($task == 'machines_layout') @if (auth()->user()->role_id == 1 || auth()->user()->role_id == 10006 || auth()->user()->role_id == 4) @else @endif @elseif ( $task == 'cutting' || $task == 'print_start' || $task == 'bulk_sewing_input' || $task == 'bulk_wash_start' || $task == 'bulk_finishing_start' || $task == 'bulk_cutting_close' || $task == 'print_close' || $task == 'bulk_sewing_close' || $task == 'bulk_wash_close' || $task == 'bulk_finishing_close') @if (auth()->user()->role_id == 1 || auth()->user()->role_id == 4 || auth()->user()->role_id == 5) @else @endif @elseif ($task == 'pre_final_inspection' || $task == 'final_inspection' || $task == 'ex_factory') @if (auth()->user()->role_id == 1 || auth()->user()->role_id == 10008 || auth()->user()->role_id == 4) @else @endif @elseif ($task == 'final_inspection' || $task == 'ex_factory') @if (auth()->user()->role_id == 1 || auth()->user()->role_id == 10005 || auth()->user()->role_id == 4) @else @endif @else @endif @else @endif @endforeach @endforeach @empty @endforelse
Action Buyer Style PO Number Item Qty (pcs) PO Receive Date Shipment/ETD Total Lead Time Order Free Time{{ ucwords(str_replace('_', ' ', $task)) }}
Plan Actual
{{ $tna->buyer }} {{ $tna->style }} {{ $tna->po }} {{ $tna->item }} {{ $tna->qty_pcs }} {{ $tna->po_receive_date ? \Carbon\Carbon::parse($tna->po_receive_date)->format('d-M-y') : '' }} {{ $tna->shipment_etd ? \Carbon\Carbon::parse($tna->shipment_etd)->format('d-M-y') : '' }} {{ $tna->total_lead_time }} @if ($tna->pp_meeting_actual == null) @php $today = \Carbon\Carbon::parse($tna->pp_meeting_plan); $shipment_etd = \Carbon\Carbon::parse($tna->shipment_etd); $diffDays = $today->diffInDays($shipment_etd, false); if ($diffDays > 0) { echo $diffDays; } else { echo '0'; } @endphp @else @php $today = \Carbon\Carbon::parse($tna->pp_meeting_plan); $shipment_etd = \Carbon\Carbon::parse($tna->pp_meeting_actual); $diffDays = $today->diffInDays($shipment_etd, false); if ($diffDays > 0) { echo $diffDays; } else { echo '0'; } @endphp @endif {{ $date == 'N/A' ? 'N/A' : ($date ? \Carbon\Carbon::parse($date)->format('d-M-y') : '') }}
No TNA Found
{{ $tnas->appends(request()->query())->links() }}