From b3f59df95850f346aa4e5214ce7831346a10dd97 Mon Sep 17 00:00:00 2001 From: Thomas Zilio Date: Mon, 3 Sep 2018 10:44:11 +0200 Subject: [PATCH] Aggiunta gestione movimenti API --- modules/articoli/api/create.php | 19 +++++++++++++++++++ modules/interventi/api/delete.php | 2 +- modules/interventi/api/retrieve.php | 11 +++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 modules/articoli/api/create.php diff --git a/modules/articoli/api/create.php b/modules/articoli/api/create.php new file mode 100644 index 000000000..a250a0d4d --- /dev/null +++ b/modules/articoli/api/create.php @@ -0,0 +1,19 @@ +movimenta($data['qta'], $data['descrizione'], $data['data'], true); + + break; +} + +return [ + 'movimento_articolo', +]; diff --git a/modules/interventi/api/delete.php b/modules/interventi/api/delete.php index 60bb26bab..256b7e2ed 100644 --- a/modules/interventi/api/delete.php +++ b/modules/interventi/api/delete.php @@ -22,5 +22,5 @@ switch ($resource) { return [ 'sessioni_intervento', - 'articoli_intervento', + //'articoli_intervento', ]; diff --git a/modules/interventi/api/retrieve.php b/modules/interventi/api/retrieve.php index a8291748f..4e0d1a9fd 100644 --- a/modules/interventi/api/retrieve.php +++ b/modules/interventi/api/retrieve.php @@ -108,6 +108,16 @@ switch ($resource) { $parameters[':id_tecnico'] = $user['idanagrafica']; } + break; + + // Elenco articoli dell'intervento per l'applicazione + case 'articoli_intervento': + $query = 'SELECT id, idarticolo AS id_articolo, idintervento AS id_intervento, IF(idautomezzo != 0, idautomezzo, NULL) AS id_automezzo, qta, created_at as data FROM mg_articoli_interventi WHERE `idintervento` = :id_intervento'; + + $parameters = [ + ':id_intervento' => $request['id_intervento'], + ]; + break; } @@ -115,4 +125,5 @@ return [ 'sync', 'interventi', 'sessioni_intervento', + 'articoli_intervento', ];