Fix righe ordini con quantità a 0

This commit is contained in:
Pek5892 2023-12-05 11:36:46 +01:00
parent 1f4fca3c6e
commit 967c6a28d6
1 changed files with 7 additions and 5 deletions

View File

@ -213,6 +213,7 @@ foreach ($righe as $riga) {
$evasione_bar['in_righe_interventi'] = 'warning';
$evasione_bar['or_righe_ordini'] = 'success';
foreach ($evasione_bar as $table => $color) {
if ($righe_ev->count() > 0) {
$righe_ev = $dbo->table($table)->where('original_id', $riga->id)->where('original_type', get_class($riga))->get();
$perc_ev = $righe_ev->sum('qta') * 100 / $riga->qta;
if ($perc_ev > 0) {
@ -220,6 +221,7 @@ foreach ($righe as $riga) {
<div class="progress-bar progress-bar-'.$color.'" style="width:'.$perc_ev.'%"></div>';
}
}
}
echo '
</div>
</td>';