Bugfix importazione FE

This commit is contained in:
Thomas Zilio 2020-04-27 10:24:03 +02:00
parent 00462669a1
commit 429cb7267a
3 changed files with 12 additions and 6 deletions

View File

@ -10,25 +10,25 @@ unset($_SESSION['superselect']['id_categoria']);
<div class="row">
<div class="col-md-6">
{[ "type": "text", "label": "<?php echo tr('Codice:'); ?>", "name": "codice", "required": 0, "value": "<?php echo htmlentities(filter('codice')) ?: ''; ?>", "help": "<?php echo tr('Se non specificato, il codice verrà calcolato automaticamente'); ?>", "validation": "codice" ]}
{[ "type": "text", "label": "<?php echo tr('Codice'); ?>", "name": "codice", "required": 0, "value": "<?php echo htmlentities(filter('codice')) ?: ''; ?>", "help": "<?php echo tr('Se non specificato, il codice verrà calcolato automaticamente'); ?>", "validation": "codice" ]}
</div>
<div class="col-md-6">
{[ "type": "text", "label": "<?php echo tr('Barcode:'); ?>", "name": "barcode", "required": 0, "value": "<?php echo htmlentities(filter('barcode')) ?: ''; ?>", "validation": "barcode" ]}
{[ "type": "text", "label": "<?php echo tr('Barcode'); ?>", "name": "barcode", "required": 0, "value": "<?php echo htmlentities(filter('barcode')) ?: ''; ?>", "validation": "barcode" ]}
</div>
</div>
<div class="row">
<div class="col-md-12">
{[ "type": "text", "label": "<?php echo tr('Descrizione:'); ?>", "name": "descrizione", "required": 1, "value": "<?php echo htmlentities(filter('descrizione')) ?: ''; ?>" ]}
{[ "type": "text", "label": "<?php echo tr('Descrizione'); ?>", "name": "descrizione", "required": 1, "value": "<?php echo htmlentities(filter('descrizione')) ?: ''; ?>" ]}
</div>
<div class="col-md-6">
{[ "type": "select", "label": "<?php echo tr('Categoria:'); ?>", "name": "categoria", "required": 0, "ajax-source": "categorie", "icon-after": "add|<?php echo Modules::get('Categorie articoli')['id']; ?>" ]}
{[ "type": "select", "label": "<?php echo tr('Categoria'); ?>", "name": "categoria", "required": 0, "ajax-source": "categorie", "icon-after": "add|<?php echo Modules::get('Categorie articoli')['id']; ?>" ]}
</div>
<div class="col-md-6">
{[ "type": "select", "label": "<?php echo tr('Sottocategoria:'); ?>", "name": "subcategoria", "id": "subcategoria_add", "ajax-source": "sottocategorie", "icon-after": "add|<?php echo Modules::get('Categorie articoli')['id']; ?>||hide" ]}
{[ "type": "select", "label": "<?php echo tr('Sottocategoria'); ?>", "name": "subcategoria", "id": "subcategoria_add", "ajax-source": "sottocategorie", "icon-after": "add|<?php echo Modules::get('Categorie articoli')['id']; ?>||hide" ]}
</div>
</div>

View File

@ -291,8 +291,11 @@ if (!empty($righe)) {
}
// Individuazione articolo con codice relativo
$id_articolo = null;
$codice_principale = $codici[0]['CodiceValore'];
$id_articolo = $database->fetchOne('SELECT id FROM mg_articoli WHERE codice = '.prepare($codice_principale))['id'];
if (!empty($codice_principale)) {
$id_articolo = $database->fetchOne('SELECT id FROM mg_articoli WHERE codice = '.prepare($codice_principale))['id'];
}
echo '
<tr>

View File

@ -337,6 +337,9 @@ class FatturaElettronica
$fattura->save();
// Fix generazione idsede
$fattura->refresh();
return $fattura;
}