ranjith-dev #1112
@@ -249,6 +249,33 @@ class SendProductionReport extends Command
|
|||||||
$efficiency = 0;
|
$efficiency = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$dayShiftPlanQuan = ($totalTargetQuantity / 2);
|
||||||
|
|
||||||
|
$nightShiftPlanQuan = ($totalTargetQuantity / 2);
|
||||||
|
|
||||||
|
if (strtolower($line->type) == 'fg line') {
|
||||||
|
|
||||||
|
$dayproductionQuantity = \App\Models\QualityValidation::where('plant_id', $plant->id)
|
||||||
|
->where('line_id', $line->id)
|
||||||
|
->whereBetween('created_at', [
|
||||||
|
$startDate->copy()->setTime(8, 0, 0),
|
||||||
|
$endDate->copy()->setTime(19, 30, 0),
|
||||||
|
])
|
||||||
|
->count();
|
||||||
|
|
||||||
|
$nightproductionQuantity = \App\Models\QualityValidation::where('plant_id', $plant->id)
|
||||||
|
->where('line_id', $line->id)
|
||||||
|
->whereBetween('created_at', [
|
||||||
|
$startDate->copy()->setTime(19, 30, 0),
|
||||||
|
$endDate->copy()->addDay()->setTime(8, 0, 0),
|
||||||
|
])
|
||||||
|
->count();
|
||||||
|
}
|
||||||
|
|
||||||
|
$dayShiftEfficiency = $dayShiftPlanQuan > 0 ? ($dayproductionQuantity / $dayShiftPlanQuan) * 100 : 0;
|
||||||
|
|
||||||
|
$nightShiftEfficiency = $dayShiftPlanQuan > 0 ? ($nightproductionQuantity / $nightShiftPlanQuan) * 100 : 0;
|
||||||
|
|
||||||
$efficiency = round($efficiency, 2);
|
$efficiency = round($efficiency, 2);
|
||||||
|
|
||||||
$tableData[] = [
|
$tableData[] = [
|
||||||
@@ -257,6 +284,12 @@ class SendProductionReport extends Command
|
|||||||
'type' => $line->type,
|
'type' => $line->type,
|
||||||
'line' => $line->name,
|
'line' => $line->name,
|
||||||
'capacityQuantity' => floor($capacityQuan),
|
'capacityQuantity' => floor($capacityQuan),
|
||||||
|
'dayShiftPlanQuantity' => floor($dayShiftPlanQuan),
|
||||||
|
'dayShiftActualQuantity' => floor($dayShiftPlanQuan),
|
||||||
|
'dayShiftEfficiency' => floor($dayShiftEfficiency),
|
||||||
|
'nightShiftPlanQuantity' => floor($nightShiftPlanQuan),
|
||||||
|
'nightShiftActualQuantity' => floor($nightShiftPlanQuan),
|
||||||
|
'nightShiftEfficiency' => floor($nightShiftEfficiency),
|
||||||
'targetQuantity' => floor($totalTargetQuantity),
|
'targetQuantity' => floor($totalTargetQuantity),
|
||||||
'productionQuantity' => $productionQuantity,
|
'productionQuantity' => $productionQuantity,
|
||||||
'efficiency' => $efficiency . '%',
|
'efficiency' => $efficiency . '%',
|
||||||
|
|||||||
@@ -55,15 +55,26 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table> --}}
|
</table> --}}
|
||||||
|
|
||||||
<table style="table-layout: auto; width: 100%; border-collapse: collapse;">
|
{{-- <table style="table-layout: auto; width: 100%; border-collapse: collapse;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="text-align: center; border: 1px solid #444; padding: 8px; background: #f2f2f2;">No</th>
|
<th style="text-align: center; border: 1px solid #444; padding: 8px; background: #f2f2f2;">No</th>
|
||||||
<th style="text-align: center; border: 1px solid #444; padding: 8px; background: #f2f2f2; white-space: nowrap;">Plant</th>
|
<th style="text-align: center; border: 1px solid #444; padding: 8px; background: #f2f2f2; white-space: nowrap;">Plant</th>
|
||||||
<th style="text-align: center; border: 1px solid #444; padding: 8px; background: #f2f2f2; white-space: nowrap;">Line</th>
|
<th style="text-align: center; border: 1px solid #444; padding: 8px; background: #f2f2f2; white-space: nowrap;">Line</th>
|
||||||
<th style="text-align: center; border: 1px solid #444; padding: 8px; background: #f2f2f2;">Line Type</th>
|
<th style="text-align: center; border: 1px solid #444; padding: 8px; background: #f2f2f2;">Line Type</th> --}}
|
||||||
{{-- <th style="text-align: center; border: 1px solid #444; padding: 8px; background: #f2f2f2;">Capacity Quantity</th> --}}
|
{{-- <th style="text-align: center; border: 1px solid #444; padding: 8px; background: #f2f2f2;">Plan Quantity</th> --}}
|
||||||
<th style="text-align: center; border: 1px solid #444; padding: 8px; background: #f2f2f2;">Plan Quantity</th>
|
{{-- <th style="border:1px solid #ccc; padding:0; background:#f2f2f2; width:300px;">
|
||||||
|
<div style="text-align:center; padding:8px; border-bottom:1px solid #ccc;">
|
||||||
|
Plan Quantity
|
||||||
|
</div>
|
||||||
|
<table style="width:100%; border-collapse:collapse; table-layout:fixed;">
|
||||||
|
<tr>
|
||||||
|
<th style="width:33.33%; text-align:center; padding:8px; border-right:1px solid #ccc; background:#f2f2f2;">Day Shift</th>
|
||||||
|
<th style="width:33.33%; text-align:center; padding:8px; border-right:1px solid #ccc; background:#f2f2f2;">Plan Quantity</th>
|
||||||
|
<th style="width:33.33%; text-align:center; padding:8px; background:#f2f2f2;">Efficiency</th>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</th>
|
||||||
<th style="text-align: center; border: 1px solid #444; padding: 8px; background: #f2f2f2;">Actual Quantity</th>
|
<th style="text-align: center; border: 1px solid #444; padding: 8px; background: #f2f2f2;">Actual Quantity</th>
|
||||||
<th style="text-align: center; border: 1px solid #444; padding: 8px; background: #f2f2f2;">Plan Vs Actual Efficiency(%)</th>
|
<th style="text-align: center; border: 1px solid #444; padding: 8px; background: #f2f2f2;">Plan Vs Actual Efficiency(%)</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -72,7 +83,7 @@
|
|||||||
@foreach($tableData as $row)
|
@foreach($tableData as $row)
|
||||||
@php $efficiency = (float) $row['efficiency']; if ($efficiency < 80) { $bgColor = '#ff4d4d';
|
@php $efficiency = (float) $row['efficiency']; if ($efficiency < 80) { $bgColor = '#ff4d4d';
|
||||||
}
|
}
|
||||||
elseif ($efficiency < 99) { $bgColor = '#ffd633';
|
elseif ($efficiency < 95) { $bgColor = '#ffd633';
|
||||||
}
|
}
|
||||||
else { $bgColor = '#4caf50';
|
else { $bgColor = '#4caf50';
|
||||||
} @endphp
|
} @endphp
|
||||||
@@ -80,17 +91,26 @@
|
|||||||
<td style="border: 1px solid #444; padding: 8px; text-align: center;">{{ $row['no'] }}</td>
|
<td style="border: 1px solid #444; padding: 8px; text-align: center;">{{ $row['no'] }}</td>
|
||||||
<td style="border: 1px solid #444; padding: 8px; text-align: center; white-space: nowrap;">{{ $row['plant'] }}</td>
|
<td style="border: 1px solid #444; padding: 8px; text-align: center; white-space: nowrap;">{{ $row['plant'] }}</td>
|
||||||
<td style="border: 1px solid #444; padding: 8px; text-align: center; white-space: nowrap;">{{ $row['line'] }}</td>
|
<td style="border: 1px solid #444; padding: 8px; text-align: center; white-space: nowrap;">{{ $row['line'] }}</td>
|
||||||
<td style="border: 1px solid #444; padding: 8px; text-align: center;">{{ $row['type'] }}</td>
|
<td style="border: 1px solid #444; padding: 8px; text-align: center;">{{ $row['type'] }}</td> --}}
|
||||||
{{-- <td style="border: 1px solid #444; padding: 8px; text-align: center;">{{ $row['capacityQuantity'] }}</td> --}}
|
{{-- <td style="border: 1px solid #444; padding: 8px; text-align: center;">{{ $row['capacityQuantity'] }}</td> --}}
|
||||||
<td style="border: 1px solid #444; padding: 8px; text-align: center;">{{ $row['targetQuantity'] }}</td>
|
{{-- <td style="border: 1px solid #444; padding: 8px; text-align: center;">{{ $row['targetQuantity'] }}</td> --}}
|
||||||
<td style="border: 1px solid #444; padding: 8px; text-align: center;">{{ $row['productionQuantity'] }}</td>
|
{{-- <td style="border:1px solid #444; padding:0; width:300px;">
|
||||||
|
<table style="width:100%; border-collapse:collapse; table-layout:fixed;">
|
||||||
|
<tr>
|
||||||
|
<td style="width:33.33%; text-align:center; padding:8px; border-right:1px solid #444;">{{ $row['dayShift'] ?? '-' }}</td>
|
||||||
|
<td style="width:33.33%; text-align:center; padding:8px; border-right:1px solid #444;">{{ $row['targetQuantity'] }}</td>
|
||||||
|
<td style="width:33.33%; text-align:center; padding:8px;">{{ $row['planEfficiency'] ?? '-' }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
<td style="border: 1px solid #444; padding: 8px; text-align: center;">{{ $row['productionQuantity'] }}</td> --}}
|
||||||
{{-- <td style="border: 1px solid #444; padding: 8px; text-align: center;">{{ $row['efficiency'] }}</td> --}}
|
{{-- <td style="border: 1px solid #444; padding: 8px; text-align: center;">{{ $row['efficiency'] }}</td> --}}
|
||||||
<td style="
|
{{-- <td style="
|
||||||
border: 1px solid #444;
|
border: 1px solid #444;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background-color: {{ $bgColor }};
|
background-color: {{ $bgColor }};
|
||||||
color: {{ $efficiency < 80 || $efficiency >= 99 ? '#ffffff' : '#000000' }};
|
color: {{ $efficiency < 80 || $efficiency >= 95 ? '#ffffff' : '#000000' }};
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
">
|
">
|
||||||
{{ $row['efficiency'] }}
|
{{ $row['efficiency'] }}
|
||||||
@@ -98,6 +118,94 @@
|
|||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
|
</table> --}}
|
||||||
|
|
||||||
|
{{-- new logic --}}
|
||||||
|
|
||||||
|
<table style="width: 100%; border-collapse: collapse; table-layout: auto;">
|
||||||
|
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th rowspan="2" style="border:1px solid #444; padding:8px; background:#f2f2f2; vertical-align:middle;">No</th>
|
||||||
|
<th rowspan="2" style="border:1px solid #444; padding:8px; background:#f2f2f2; vertical-align:middle;">Plant</th>
|
||||||
|
<th rowspan="2" style="border:1px solid #444; padding:8px; background:#f2f2f2; vertical-align:middle;">Line</th>
|
||||||
|
<th rowspan="2" style="border:1px solid #444; padding:8px; background:#f2f2f2; vertical-align:middle;">Line Type</th>
|
||||||
|
|
||||||
|
<th colspan="3" style="border:1px solid #444; padding:8px; background:#f2f2f2; text-align:center;">
|
||||||
|
Day Shift
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<th colspan="3" style="border:1px solid #444; padding:8px; background:#f2f2f2; text-align:center;">
|
||||||
|
Night Shift
|
||||||
|
</th>
|
||||||
|
|
||||||
|
<th rowspan="2" style="border:1px solid #444; padding:8px; background:#f2f2f2; vertical-align:middle;">Plan Quantity</th>
|
||||||
|
<th rowspan="2" style="border:1px solid #444; padding:8px; background:#f2f2f2; vertical-align:middle;">Actual Quantity</th>
|
||||||
|
<th rowspan="2" style="border:1px solid #444; padding:8px; background:#f2f2f2; vertical-align:middle;">Plan Vs Actual Efficiency(%)</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th style="border:1px solid #444; padding:8px; background:#f2f2f2; text-align:center;">Plan Quantity</th>
|
||||||
|
<th style="border:1px solid #444; padding:8px; background:#f2f2f2; text-align:center;">Actual Quantity</th>
|
||||||
|
<th style="border:1px solid #444; padding:8px; background:#f2f2f2; text-align:center;">Plan Vs Actual Efficiency(%)</th>
|
||||||
|
<th style="border:1px solid #444; padding:8px; background:#f2f2f2; text-align:center;">Plan Quantity</th>
|
||||||
|
<th style="border:1px solid #444; padding:8px; background:#f2f2f2; text-align:center;">Actual Quantity</th>
|
||||||
|
<th style="border:1px solid #444; padding:8px; background:#f2f2f2; text-align:center;">Plan Vs Actual Efficiency(%)</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
@foreach($tableData as $row)
|
||||||
|
@php $efficiency = (float) $row['efficiency']; if ($efficiency < 80) { $bgColor = '#ff4d4d';
|
||||||
|
}
|
||||||
|
elseif ($efficiency < 95) { $bgColor = '#ffd633';
|
||||||
|
}
|
||||||
|
else { $bgColor = '#4caf50';
|
||||||
|
} @endphp
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td style="border: 1px solid #444; padding: 8px; text-align: center;">{{ $row['no'] }}</td>
|
||||||
|
<td style="border: 1px solid #444; padding: 8px; text-align: center; white-space: nowrap;">{{ $row['plant'] }}</td>
|
||||||
|
<td style="border: 1px solid #444; padding: 8px; text-align: center; white-space: nowrap;">{{ $row['line'] }}</td>
|
||||||
|
<td style="border: 1px solid #444; padding: 8px; text-align: center;">{{ $row['type'] }}</td>
|
||||||
|
<td style="text-align:center; border:1px solid #444; padding:8px;">
|
||||||
|
{{ $row['dayShiftPlanQuantity'] }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td style="text-align:center; border:1px solid #444; padding:8px;">
|
||||||
|
{{ $row['dayShiftActualQuantity'] }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td style="text-align:center; border:1px solid #444; padding:8px;">
|
||||||
|
{{ $row['dayShiftEfficiency'] }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td style="text-align:center; border:1px solid #444; padding:8px;">
|
||||||
|
{{ $row['nightShiftPlanQuantity'] }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td style="text-align:center; border:1px solid #444; padding:8px;">
|
||||||
|
{{ $row['nightShiftActualQuantity'] }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td style="text-align:center; border:1px solid #444; padding:8px;">
|
||||||
|
{{ $row['nightShiftEfficiency'] }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td style="text-align:center; border:1px solid #444; padding:8px;">
|
||||||
|
{{ $row['targetQuantity'] }}
|
||||||
|
</td>
|
||||||
|
<td style="text-align:center; border:1px solid #444; padding:8px;">
|
||||||
|
{{ $row['productionQuantity'] }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td style="text-align:center; border:1px solid #444; padding:8px;">
|
||||||
|
{{ $row['efficiency'] }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<p>{!! $wishes !!}</p>
|
<p>{!! $wishes !!}</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user