Fix righe per quantità = 0

This commit is contained in:
Pek5892 2023-12-06 12:27:34 +01:00
parent 1dea0135da
commit 0a606fece8
3 changed files with 5 additions and 5 deletions

View File

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

View File

@ -213,8 +213,8 @@ 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();
if ($righe_ev->count() > 0) {
$perc_ev = $righe_ev->sum('qta') * 100 / $riga->qta;
if ($perc_ev > 0) {
echo '

View File

@ -434,8 +434,8 @@ echo '
<tr>
<td colspan="'.$colspan.'" class="text-right">
'.tr('Ricarico (_PRC_%)', [
'_PRC_' => numberFormat($preventivo->ricarico_percentuale),
'.tr('Ricarico (_PRC_)', [
'_PRC_' => ($preventivo->ricarico_percentuale != 0 ? numberFormat($preventivo->ricarico_percentuale). '%' : 'N.D.'),
]).':
</td>
</tr>';