diff --git a/resources/views/mail/production_report.blade.php b/resources/views/mail/production_report.blade.php index c05e8d7..a05a9e1 100644 --- a/resources/views/mail/production_report.blade.php +++ b/resources/views/mail/production_report.blade.php @@ -155,12 +155,23 @@ @foreach($tableData as $row) - @php $efficiency = (float) $row['efficiency']; if ($efficiency < 80) { $bgColor = '#ff4d4d'; - } - elseif ($efficiency < 95) { $bgColor = '#ffd633'; - } - else { $bgColor = '#4caf50'; - } @endphp + @php + $getEfficiencyColor = function ($value) { + $efficiency = (float) $value; + + if ($efficiency < 80) { + return '#ff4d4d'; + } elseif ($efficiency < 95) { + return '#ffd633'; + } else { + return '#4caf50'; + } + }; + + $dayEfficiencyColor = $getEfficiencyColor($row['dayShiftEfficiency']); + $nightEfficiencyColor = $getEfficiencyColor($row['nightShiftEfficiency']); + $efficiencyColor = $getEfficiencyColor($row['efficiency']); + @endphp {{ $row['no'] }} @@ -175,7 +186,10 @@ {{ $row['dayShiftActualQuantity'] }} - + {{-- + {{ $row['dayShiftEfficiency'] }} + --}} + {{ $row['dayShiftEfficiency'] }} @@ -187,7 +201,11 @@ {{ $row['nightShiftActualQuantity'] }} - + {{-- + {{ $row['nightShiftEfficiency'] }} + --}} + + {{ $row['nightShiftEfficiency'] }} @@ -198,7 +216,11 @@ {{ $row['productionQuantity'] }} - + {{-- + {{ $row['efficiency'] }} + --}} + + {{ $row['efficiency'] }}