Skip to content

Commit 2b1aea9

Browse files
committed
fix: recupero utente per sincronizzazione movimenti da app
1 parent 777df47 commit 2b1aea9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

modules/articoli/src/Articolo.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ public function registra($qta, $descrizone = null, $data = null, $manuale = fals
163163
return false;
164164
}
165165

166-
global $user;
166+
// Recupero l'utente corrente
167+
$user = auth_osm()->getUser();
168+
$id_utente = $user->id;
167169

168170
// Movimento il magazzino solo se l'articolo non è un servizio
169171
if (empty($this->servizio)) {
@@ -175,7 +177,7 @@ public function registra($qta, $descrizone = null, $data = null, $manuale = fals
175177
'movimento' => $descrizone,
176178
'data' => $data,
177179
'manuale' => $manuale,
178-
'idutente' => $user->id,
180+
'idutente' => $id_utente,
179181
], $array));
180182
}
181183
$id = database()->lastInsertedID();

0 commit comments

Comments
 (0)