1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-16 19:40:44 +01:00

Aggiunto avviso nel caso di righe con quantità a 0.

This commit is contained in:
Pek5892 2024-02-23 14:40:08 +01:00
parent f1f3e553a7
commit 4633113022
6 changed files with 70 additions and 10 deletions

View File

@ -68,6 +68,21 @@ if ($dir == 'entrata') {
} }
} }
$righe = $ddt->getRighe();
$righe_vuote = false;
foreach ($righe as $riga) {
if ($riga->qta == 0) {
$righe_vuote = true;
}
}
if ($righe_vuote) {
echo '
<div class="alert alert-warning" id="righe-vuote">
<i class="fa fa-warning"></i> '.tr("Nel ddt sono presenti delle righe con quantità a 0.").'</b>
</div>';
}
?> ?>
<form action="" method="post" id="edit-form"> <form action="" method="post" id="edit-form">
<input type="hidden" name="backto" value="record-edit"> <input type="hidden" name="backto" value="record-edit">

View File

@ -72,6 +72,12 @@ foreach ($righe as $riga) {
$mancanti = 0; $mancanti = 0;
} }
} }
// Imposto sfondo rosso alle righe con quantità a 0
if ($riga->qta == 0) {
$extra = 'class="danger"';
}
echo ' echo '
<tr data-id="'.$riga->id.'" data-type="'.get_class($riga).'"> <tr data-id="'.$riga->id.'" data-type="'.get_class($riga).'">
<td class="text-center">'; <td class="text-center">';

View File

@ -166,12 +166,12 @@ if ($dir == 'entrata') {
$numero_previsto = verifica_numero_fattura($fattura); $numero_previsto = verifica_numero_fattura($fattura);
if (!empty($numero_previsto)) { if (!empty($numero_previsto)) {
echo ' echo '
<div class="alert alert-warning"> <div class="alert alert-warning">
<i class="fa fa-warning"></i> '.tr("E' assente una fattura di vendita di numero _NUM_ in data precedente o corrispondente a _DATE_: si potrebbero verificare dei problemi con la numerazione corrente delle fatture", [ <i class="fa fa-warning"></i> '.tr("E' assente una fattura di vendita di numero _NUM_ in data precedente o corrispondente a _DATE_: si potrebbero verificare dei problemi con la numerazione corrente delle fatture", [
'_DATE_' => dateFormat($fattura->data), '_DATE_' => dateFormat($fattura->data),
'_NUM_' => '"'.$numero_previsto.'"', '_NUM_' => '"'.$numero_previsto.'"',
]).'.</b> ]).'.</b>
</div>'; </div>';
} }
// Verifica la data dell'intervento rispetto alla data della fattura // Verifica la data dell'intervento rispetto alla data della fattura
@ -191,12 +191,27 @@ if ($dir == 'entrata') {
if ($fatturazione_futura) { if ($fatturazione_futura) {
echo ' echo '
<div class="alert alert-warning"> <div class="alert alert-warning">
<i class="fa fa-warning"></i> '.tr("Stai fatturando un'attività futura rispetto alla data di fatturazione.").'</b> <i class="fa fa-warning"></i> '.tr("Stai fatturando un'attività futura rispetto alla data di fatturazione.").'</b>
</div>'; </div>';
} }
} }
} }
$righe = $fattura->getRighe();
$righe_vuote = false;
foreach ($righe as $riga) {
if ($riga->qta == 0) {
$righe_vuote = true;
}
}
if ($righe_vuote) {
echo '
<div class="alert alert-warning" id="righe-vuote">
<i class="fa fa-warning"></i> '.tr("Nel documento sono presenti delle righe con quantità a 0.").'</b>
</div>';
}
?> ?>
<form action="" method="post" id="edit-form"> <form action="" method="post" id="edit-form">
<input type="hidden" name="backto" value="record-edit"> <input type="hidden" name="backto" value="record-edit">

View File

@ -75,6 +75,11 @@ foreach ($righe as $riga) {
} }
} }
// Imposto sfondo rosso alle righe con quantità a 0
if ($riga->qta == 0) {
$extra = 'class="danger"';
}
$extra_riga = ''; $extra_riga = '';
if (!$riga->isDescrizione()) { if (!$riga->isDescrizione()) {
// Informazioni su CIG, CUP, ... // Informazioni su CIG, CUP, ...

View File

@ -29,6 +29,20 @@ if ($module['name'] == 'Ordini cliente') {
$dir = 'uscita'; $dir = 'uscita';
} }
$righe = $ordine->getRighe();
$righe_vuote = false;
foreach ($righe as $riga) {
if ($riga->qta == 0) {
$righe_vuote = true;
}
}
if ($righe_vuote) {
echo '
<div class="alert alert-warning" id="righe-vuote">
<i class="fa fa-warning"></i> '.tr("Nel documento sono presenti delle righe con quantità a 0.").'</b>
</div>';
}
?><form action="" method="post" id="edit-form"> ?><form action="" method="post" id="edit-form">
<input type="hidden" name="backto" value="record-edit"> <input type="hidden" name="backto" value="record-edit">
<input type="hidden" name="op" value="update"> <input type="hidden" name="op" value="update">

View File

@ -78,8 +78,13 @@ foreach ($righe as $riga) {
} }
} }
// Imposto sfondo rosso alle righe con quantità a 0
if ($riga->qta == 0) {
$extra = 'class="danger"';
}
echo ' echo '
<tr data-id="'.$riga->id.'" data-type="'.get_class($riga).'"> <tr data-id="'.$riga->id.'" data-type="'.get_class($riga).'" '.$extra.'>
<td class="text-center">'; <td class="text-center">';
if (!$block_edit) { if (!$block_edit) {
echo ' echo '