@forelse ($tnas as $tna)
{{ $tna->id }} |
{{ $tna->buyer }} |
{{ $tna->style }} |
{{ $tna->po }} |
{{-- | --}}
{{ $tna->item }} |
{{-- {{ $tna->color }} | --}}
{{ $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','cutting', 'etd'] 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 actual date is empty and plane date have value then if plan date is today or past then bg color red else plan date before 2 days then bg color yellow else bg color light example: if plan date is 10-10-2021 and actual date is empty and today date is 10-10-2021 then bg color red if plan date is 8-10-2021 and actual date is empty then bg color yellow if plan date is 9-10-2021 and actual date is empty then bg color light
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 actual date and plan date both have value then check if actual date is date over then plan date then text front red and blod expample: if plan date is 10-10-2021 and actual date is 12-10-2021 then text front red and blod
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))
|
@else
{{-- {{ \Carbon\Carbon::parse($date)->format('d-M-y') ?? '' }} --}}
{{ $date == 'N/A' ? 'N/A' : ($date ? \Carbon\Carbon::parse($date)->format('d-M-y') : '') }}
|
@endif
@endforeach
@endforeach
@empty
No TNA Found |
@endforelse