Merge pull request 'changed logic and colour update logic based on efficiency in production report.' (#1091) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #1091
This commit was merged in pull request #1091.
This commit is contained in:
@@ -241,7 +241,7 @@ class SendProductionReport extends Command
|
||||
}
|
||||
|
||||
if ($totalTargetQuantity > 0) {
|
||||
$efficiency = ($totalTargetQuantity / $productionQuantity) * 100;
|
||||
$efficiency = ($productionQuantity / $totalTargetQuantity) * 100;
|
||||
} else {
|
||||
$efficiency = 0;
|
||||
}
|
||||
|
||||
@@ -70,6 +70,12 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($tableData as $row)
|
||||
@php $efficiency = (float) $row['efficiency']; if ($efficiency < 80) { $bgColor = '#ff4d4d';
|
||||
}
|
||||
elseif ($efficiency < 99) { $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>
|
||||
@@ -78,7 +84,17 @@
|
||||
{{-- <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['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="
|
||||
border: 1px solid #444;
|
||||
padding: 8px;
|
||||
text-align: center;
|
||||
background-color: {{ $bgColor }};
|
||||
color: {{ $efficiency < 80 || $efficiency >= 99 ? '#ffffff' : '#000000' }};
|
||||
font-weight: bold;
|
||||
">
|
||||
{{ $row['efficiency'] }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user