@forelse ($tnas as $tna)
{{ $tna->id }} |
{{ $tna->buyer }} |
{{ str_replace(',', ' ', $tna->style) }} |
{{ str_replace(',', ' ', $tna->po) }} |
{{ $tna->item }} |
{{ $tna->qty_pcs }} |
{{ \Carbon\Carbon::parse($tna->po_receive_date)->format('d-M-y') ?? '' }} |
{{ \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
|
@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', 'etd', '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
{{ $date == 'N/A' ? 'N/A' : ($date ? \Carbon\Carbon::parse($date)->format('d-M-y') : '') }}
|
@endif
@endforeach
@endforeach
@empty
No TNA Found |
@endforelse