This commit is contained in:
MatteoPistorello 2023-12-29 16:16:15 +01:00
commit 07f3f139a6
4 changed files with 115 additions and 101 deletions

View File

@ -326,7 +326,7 @@ echo '
</div>
<div class="col-md-3">
{[ "type": "checkbox", "label": "'.tr('Creazione seriali').'", "name": "flag_crea_seriali", "value": 0, "help": "'.tr('Nel caso di righe contenenti serial, il gestionale procede alla registrazione del serial').'" ]}
{[ "type": "checkbox", "label": "'.tr('Creazione seriali').'", "name": "flag_crea_seriali", "value": '.setting('Creazione seriali in import FE').', "help": "'.tr('Nel caso di righe contenenti serial, il gestionale procede alla registrazione del serial').'" ]}
</div>';
$ritenuta = $dati_generali['DatiRitenuta'];
@ -605,12 +605,14 @@ if (!empty($righe)) {
</div>
<div class="row">';
for ($i = 0; $i < $qta; ++$i) {
echo '
<div class="col-md-3">
{[ "type": "text", "label": "'.tr('Serial').'", "name": "serial['.$key.'][]", "value": "'.$serial[$i].'" ]}
</div>';
}
if (setting('Creazione seriali in import FE') && $serial) {
for ($i = 0; $i < $qta; ++$i) {
echo '
<div class="col-md-3">
{[ "type": "text", "label": "'.tr('Serial').'", "name": "serial['.$key.'][]", "value": "'.$serial[$i].'" ]}
</div>';
}
}
echo '
</div>
</div>

View File

@ -6,72 +6,76 @@
$targa = '';
$totale_qta = 0.000;
$totale_ven = 0.00;
for ($r = 0; $r < sizeof($rs); ++$r) {
if ($targa != $rs[$r]['targa']) {
if ($targa != '') {
if ($rs) {
for ($r = 0; $r < sizeof($rs); ++$r) {
if ($targa != $rs[$r]['targa']) {
if ($targa != '') {
echo "
<table cellspacing='0' style='table-layout:fixed;'>
<col width='35'><col width='275'><col width='50'><col width='70'><col width='45'><col width='65'><col width='65'>
<tr>
<td class='first_cell cell-padded'>".'&nbsp;'."</td>
<td class='table_cell cell-padded'>".'&nbsp;'."</td>
<td class='table_cell cell-padded'>".'&nbsp;'."</td>
<td class='table_cell text-right cell-padded'>".number_format($totale_qta, 3, ',', '.')."&nbsp;kg</td>
<td class='table_cell text-right cell-padded'>".'&nbsp;'."</td>
<td class='table_cell text-right cell-padded'>".number_format($totale_ven, 2, ',', '.')." &euro;</td>
<td class='table_cell cell-padded'>".'&nbsp;'.'</td>
</tr>
</table>';
}
echo "
<br/>
<table cellspacing='0' style='table-layout:fixed;'>
<col width='35'><col width='275'><col width='50'><col width='70'><col width='45'><col width='65'><col width='65'>
<col width='150'><col width='250'>
<tr>
<td class='first_cell cell-padded'>".'&nbsp;'."</td>
<td class='table_cell cell-padded'>".'&nbsp;'."</td>
<td class='table_cell cell-padded'>".'&nbsp;'."</td>
<td class='table_cell text-right cell-padded'>".number_format($totale_qta, 3, ',', '.')."&nbsp;kg</td>
<td class='table_cell text-right cell-padded'>".'&nbsp;'."</td>
<td class='table_cell text-right cell-padded'>".number_format($totale_ven, 2, ',', '.')." &euro;</td>
<td class='table_cell cell-padded'>".'&nbsp;'.'</td>
<th bgcolor='#ffffff' class='full_cell1 cell-padded' width='150'>Targa: ".$rs[$r]['targa']."</th>
<th bgcolor='#ffffff' class='full_cell cell-padded' width='250'>Automezzo: ".$rs[$r]['nome'].'</th>
</tr>
</table>';
</table>';
echo "
<table class='table table-bordered' cellspacing='0' style='table-layout:fixed;'>
<col width='35'><col width='275'><col width='50'><col width='70'><col width='45'><col width='65'><col width='65'>
<tr>
<th bgcolor='#dddddd' class='full_cell1 cell-padded' width='10%'>Codice</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' >Descrizione</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' width='20%'>Sub.Cat.</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' width='10%'>Quantit&agrave;</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' width='10%'>P. Ven.</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' width='10%'>Totale</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' width='10%'>Utente</th>
</tr>";
$targa = $rs[$r]['targa'];
$totale_qta = 0.000;
$totale_ven = 0.00;
}
echo '
<tr>';
$qta = number_format($rs[$r]['qta'], 3, ',', '.').'&nbsp;'.$rs[$r]['um'];
$prz_vendita = number_format($rs[$r]['prezzo_vendita'], 2);
$prz_vendita += ($prz_vendita / 100) * $rs[$r]['iva'];
$totv = number_format($prz_vendita, 2) * $rs[$r]['qta'];
echo "
<br/>
<table cellspacing='0' style='table-layout:fixed;'>
<col width='150'><col width='250'>
<tr>
<th bgcolor='#ffffff' class='full_cell1 cell-padded' width='150'>Targa: ".$rs[$r]['targa']."</th>
<th bgcolor='#ffffff' class='full_cell cell-padded' width='250'>Automezzo: ".$rs[$r]['nome'].'</th>
</tr>
</table>';
<td class='first_cell cell-padded'>".$rs[$r]['codice']."</td>
<td class='table_cell cell-padded'>".$rs[$r]['descrizione']."</td>
<td class='table_cell cell-padded'>".$rs[$r]['subcategoria']."</td>
<td class='table_cell text-right cell-padded'>".$qta."</td>
<td class='table_cell text-right cell-padded'>".number_format($prz_vendita, 2, ',', '.')." &euro;</td>
<td class='table_cell text-right cell-padded'>".number_format($totv, 2, ',', '.')." &euro;</td>
<td class='table_cell cell-padded'>".ucfirst($rs[$r]['username']).'</td>
</tr>';
echo "
<table class='table table-bordered' cellspacing='0' style='table-layout:fixed;'>
<col width='35'><col width='275'><col width='50'><col width='70'><col width='45'><col width='65'><col width='65'>
<tr>
<th bgcolor='#dddddd' class='full_cell1 cell-padded' width='10%'>Codice</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' >Descrizione</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' width='20%'>Sub.Cat.</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' width='10%'>Quantit&agrave;</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' width='10%'>P. Ven.</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' width='10%'>Totale</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' width='10%'>Utente</th>
</tr>";
$targa = $rs[$r]['targa'];
$totale_qta = 0.000;
$totale_ven = 0.00;
}
echo '
<tr>';
$qta = number_format($rs[$r]['qta'], 3, ',', '.').'&nbsp;'.$rs[$r]['um'];
$prz_vendita = number_format($rs[$r]['prezzo_vendita'], 2);
$prz_vendita += ($prz_vendita / 100) * $rs[$r]['iva'];
$totv = number_format($prz_vendita, 2) * $rs[$r]['qta'];
echo "
<td class='first_cell cell-padded'>".$rs[$r]['codice']."</td>
<td class='table_cell cell-padded'>".$rs[$r]['descrizione']."</td>
<td class='table_cell cell-padded'>".$rs[$r]['subcategoria']."</td>
<td class='table_cell text-right cell-padded'>".$qta."</td>
<td class='table_cell text-right cell-padded'>".number_format($prz_vendita, 2, ',', '.')." &euro;</td>
<td class='table_cell text-right cell-padded'>".number_format($totv, 2, ',', '.')." &euro;</td>
<td class='table_cell cell-padded'>".ucfirst($rs[$r]['username']).'</td>
</tr>';
$totale_ven = $totale_ven + $totv;
if ($rs[$r]['um'] == 'kg') {
$totale_qta = $totale_qta + $rs[$r]['qta'];
$totale_ven = $totale_ven + $totv;
if ($rs[$r]['um'] == 'kg') {
$totale_qta = $totale_qta + $rs[$r]['qta'];
}
}
} else {
echo 'Nessun articolo caricato sugli automezzi il '.date('d/m/Y', strtotime($dt_carico)),'.';
}
echo '

View File

@ -5,46 +5,51 @@
echo '<br>';
$targa = '';
for ($r = 0; $r < sizeof($rs); ++$r) {
if ($targa != $rs[$r]['targa']) {
if ($targa != '') {
echo '
</table>
<br/>';
if ($rs) {
for ($r = 0; $r < sizeof($rs); ++$r) {
if ($targa != $rs[$r]['targa']) {
if ($targa != '') {
echo '
</table>
<br/>';
}
echo "
<table cellspacing='0' style='table-layout:fixed;'>
<col width='150'><col width='250'>
<tr>
<th bgcolor='#ffffff' class='full_cell1 cell-padded' width='150'>Targa: ".$rs[$r]['targa']."</th>
<th bgcolor='#ffffff' class='full_cell cell-padded' width='250'>Automezzo: ".$rs[$r]['nome']."</th>
</tr>
</table>
<table class='table table-bordered' cellspacing='0' style='table-layout:fixed;'>
<col width='50'><col width='300'><col width='50'><col width='50'><col width='50'>
<tr>
<th bgcolor='#dddddd' class='full_cell1 cell-padded' width='10%'>Codice</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' >Descrizione</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' width='20%'>Sub.Cat.</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' width='15%'>Q.t&agrave;</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' width='5%'></th>
</tr>";
$targa = $rs[$r]['targa'];
}
echo '
<tr>';
$qta = number_format($rs[$r]['qta'], 3, ',', '.').'&nbsp;'.$rs[$r]['um'];
echo "
<table cellspacing='0' style='table-layout:fixed;'>
<col width='150'><col width='250'>
<tr>
<th bgcolor='#ffffff' class='full_cell1 cell-padded' width='150'>Targa: ".$rs[$r]['targa']."</th>
<th bgcolor='#ffffff' class='full_cell cell-padded' width='250'>Automezzo: ".$rs[$r]['nome']."</th>
</tr>
</table>
<table class='table table-bordered' cellspacing='0' style='table-layout:fixed;'>
<col width='50'><col width='300'><col width='50'><col width='50'><col width='50'>
<tr>
<th bgcolor='#dddddd' class='full_cell1 cell-padded' width='10%'>Codice</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' >Descrizione</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' width='20%'>Sub.Cat.</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' width='15%'>Q.t&agrave;</th>
<th bgcolor='#dddddd' class='full_cell cell-padded' width='5%'></th>
</tr>";
$targa = $rs[$r]['targa'];
<td class='first_cell cell-padded'>".$rs[$r]['codice']."</td>
<td class='table_cell cell-padded'>".$rs[$r]['descrizione']."</td>
<td class='table_cell cell-padded'>".$rs[$r]['subcategoria']."</td>
<td class='table_cell text-right cell-padded'>".$qta."</td>
<td class='table_cell cell-padded'></td>
</tr>";
}
echo '
<tr>';
$qta = number_format($rs[$r]['qta'], 3, ',', '.').'&nbsp;'.$rs[$r]['um'];
echo "
<td class='first_cell cell-padded'>".$rs[$r]['codice']."</td>
<td class='table_cell cell-padded'>".$rs[$r]['descrizione']."</td>
<td class='table_cell cell-padded'>".$rs[$r]['subcategoria']."</td>
<td class='table_cell text-right cell-padded'>".$qta."</td>
<td class='table_cell cell-padded'></td>
</tr>";
} else {
echo 'Nessun articolo caricato negli automezzi.';
}
if ($targa != '') {
echo '
</table>';

View File

@ -21,3 +21,6 @@ INSERT INTO `zz_imports` (`name`, `class`) VALUES ('Listini cliente', 'Modules\\
-- Aggiunta impostazione per definire il listino cliente predefinito
INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`, `created_at`, `order`, `help`) VALUES (NULL, 'Listino cliente predefinito', '', 'query=SELECT id, nome AS descrizione FROM `mg_listini` ORDER BY descrizione ASC', '1', 'Generali', NULL, NULL, 'In fase di creazione anagrafica cliente collega il listino all\'anagrafica stessa');
-- Aggiunta impostazione per importazione serial di default
INSERT INTO `zz_settings` (`nome`, `valore`, `tipo`, `editable`, `sezione`, `order`, `help`) VALUES ("Creazione seriali in import FE", '1', 'boolean', 1, 'Fatturazione Elettronica', '16', "Determina il valore predefinito dell'impostazione Creazione seriali in fase di importazione di una fattura elettronica");