diff --git a/include/common/importa.php b/include/common/importa.php index b4780ec88..8af3f8982 100755 --- a/include/common/importa.php +++ b/include/common/importa.php @@ -258,6 +258,19 @@ if (in_array($final_module['name'], ['Fatture di vendita', 'Fatture di acquisto' '; } +$has_serial = 0; +if (!empty($options['serials'])) { + foreach ($righe as $riga) { + if (!empty($riga['abilita_serial'])) { + $serials = $riga->serials ?: 0; + + if (!empty($serials)) { + $has_serial = 1; + } + } + } +} + // Righe del documento echo '
@@ -279,7 +292,7 @@ echo ' '.tr('Q.tà da evadere').' '.tr('Subtot.').''; -if (!empty($options['serials'])) { +if (!empty($has_serial)) { echo ' '.tr('Seriali').''; } @@ -322,6 +335,19 @@ foreach ($righe as $i => $riga) { echo ' '.nl2br($descrizione); + if ($riga->isArticolo() && !empty($riga->abilita_serial)) { + $serials = $riga->serials; + $mancanti = abs($riga->qta) - count($serials); + + if (!empty($mancanti)) { + echo ' +
'.tr('_NUM_ serial mancanti', [ + '_NUM_' => $mancanti, + ]).''; + } + } + + echo ' '; @@ -343,7 +369,7 @@ foreach ($righe as $i => $riga) { '; // Seriali - if (!empty($options['serials'])) { + if (!empty($has_serial)) { echo ' ';