Fix inserimento articoli con quantità negative in ordini clienti e preventivi

This commit is contained in:
Pek5892 2023-02-28 17:00:21 +01:00
parent c847091140
commit d802dda05a
4 changed files with 2 additions and 4 deletions

View File

@ -611,7 +611,6 @@ switch (post('op')) {
case 'add_articolo':
$id_articolo = post('id_articolo');
$barcode = post('barcode');
$dir = 'entrata';
if (!empty($barcode)) {
$id_articolo = $dbo->selectOne('mg_articoli', 'id', ['deleted_at' => null, 'barcode' => $barcode])['id'];

View File

@ -245,7 +245,7 @@ if (!$block_edit) {
</div>
<div class="col-md-4">
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "icon-after": "add|'.Modules::get('Articoli')['id'].'" ]}
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "select-options": {"permetti_movimento_a_zero": '.($dir == 'entrata' ? 0 : 1).'}, "icon-after": "add|'.Modules::get('Articoli')['id'].'" ]}
</div>
<div class="col-md-4" style="margin-top: 25px">

View File

@ -447,7 +447,6 @@ switch (post('op')) {
case 'add_articolo':
$id_articolo = post('id_articolo');
$barcode = post('barcode');
$dir = 'entrata';
if (!empty($barcode)) {
$id_articolo = $dbo->selectOne('mg_articoli', 'id', ['deleted_at' => null, 'barcode' => $barcode])['id'];

View File

@ -265,7 +265,7 @@ if (!$block_edit) {
</div>
<div class="col-md-4">
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "icon-after": "add|'.Modules::get('Articoli')['id'].'" ]}
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "select-options": {"permetti_movimento_a_zero": 1}, "icon-after": "add|'.Modules::get('Articoli')['id'].'" ]}
</div>
<div class="col-md-4" style="margin-top: 25px">