Unificazione aggiunta seriali

This commit is contained in:
Thomas Zilio 2020-08-10 09:54:01 +02:00
parent 529945a4da
commit 8987b1f374
4 changed files with 6 additions and 21 deletions

View File

@ -371,17 +371,10 @@ switch (post('op')) {
break;
case 'add_serial':
$idriga = post('idriga');
$idarticolo = post('idarticolo');
$articolo = Articolo::find(post('idriga'));
$serials = (array) post('serial');
foreach ($serials as $key => $value) {
if (empty($value)) {
unset($serials[$key]);
}
}
$dbo->sync('mg_prodotti', ['id_riga_ddt' => $idriga, 'dir' => $dir, 'id_articolo' => $idarticolo], ['serial' => $serials]);
$articolo->serials = $serials;
break;

View File

@ -619,9 +619,7 @@ switch (post('op')) {
$articolo = Articolo::find(post('idriga'));
$serials = (array) post('serial');
$articolo->serials = $serials;
$articolo->save();
break;

View File

@ -344,7 +344,8 @@ switch (post('op')) {
case 'add_serial':
$articolo = Articolo::find(post('idriga'));
$articolo->serials = post('serial');
$serials = (array) post('serial');
$articolo->serials = $serials;
aggiorna_sedi_movimenti('interventi', $id_record);
break;

View File

@ -288,17 +288,10 @@ switch (post('op')) {
break;
case 'add_serial':
$idriga = post('idriga');
$idarticolo = post('idarticolo');
$articolo = Articolo::find(post('idriga'));
$serials = (array) post('serial');
foreach ($serials as $key => $value) {
if (empty($value)) {
unset($serials[$key]);
}
}
$dbo->sync('mg_prodotti', ['id_riga_ordine' => $idriga, 'dir' => $dir, 'id_articolo' => $idarticolo], ['serial' => $serials]);
$articolo->serials = $serials;
break;