|
29 | 29 | echo '<table class="table table-striped table-hover table-bordered" id="tabella-inventario"> |
30 | 30 | <thead> |
31 | 31 | <tr> |
32 | | - <th width="20%">'.tr('Codice').'</th> |
33 | | - <th width="30%">'.tr('Descrizione').'</th> |
34 | | - <th width="15%">'.tr('Giacenza attuale').'</th> |
35 | | - <th width="15%">'.tr('Nuova giacenza').'</th> |
| 32 | + <th width="15%">'.tr('Codice').'</th> |
| 33 | + <th>'.tr('Descrizione').'</th> |
| 34 | + <th width="18%" class="text-center">'.tr('Attuale giacenza').'</th> |
| 35 | + <th width="10%" class="text-center">'.tr('Nuova giacenza').'</th> |
36 | 36 | <th width="15%">'.tr('Ubicazione').'</th> |
37 | | - <th width="5%">'.tr('Azioni').'</th> |
| 37 | + <th width="4%">'.tr('Azioni').'</th> |
38 | 38 | </tr> |
39 | 39 | </thead> |
40 | 40 | <tbody>'; |
|
45 | 45 | $descrizione = $riga['descrizione']; |
46 | 46 | $giacenza_attuale = floatval($riga['giacenza_attuale']); |
47 | 47 | $nuova_giacenza = floatval($riga['nuova_giacenza']); |
48 | | - $ubicazione = $riga['ubicazione']; |
49 | 48 |
|
| 49 | + $ultimo_movimento = $dbo->fetchOne('SELECT data, movimento FROM mg_movimenti WHERE idarticolo = '.prepare($riga['id_articolo']).' ORDER BY data DESC LIMIT 1'); |
| 50 | + $data_movimento = $ultimo_movimento['data']; |
| 51 | + $descrizione_movimento = $ultimo_movimento['movimento']; |
50 | 52 | echo '<tr data-id="'.$id.'"> |
51 | 53 | <td>'.$codice.'</td> |
52 | 54 | <td>'.$descrizione.'</td> |
53 | | - <td class="text-right">'.Translator::numberToLocale($giacenza_attuale).'</td> |
| 55 | + <td class="text-right"> |
| 56 | + <small class="text-muted">('.Translator::dateToLocale($data_movimento).')</small> <span class="badge badge-info">'.Translator::numberToLocale($giacenza_attuale).'</span><br> |
| 57 | + <small class="text-muted">'.$descrizione_movimento.'</small> |
| 58 | + </td> |
54 | 59 | <td>'; |
55 | 60 |
|
56 | | - // Input giacenza con struttura OpenSTAManager |
57 | | - echo '{[ "type": "number", "name": "giacenza_'.$id.'", "value": "'.$nuova_giacenza.'", "decimals": "qta", "class": "text-right", "onchange": "aggiornaGiacenza('.$id.', this.value)" ]}'; |
| 61 | + // Input giacenza con struttura OpenSTAManager |
| 62 | + echo '{[ "type": "number", "name": "giacenza_'.$id.'", "value": "'.$nuova_giacenza.'", "decimals": "qta", "class": "text-right", "onchange": "aggiornaGiacenza('.$id.', this.value)" ]}'; |
58 | 63 |
|
59 | 64 | echo '</td> |
60 | 65 | <td>'; |
61 | 66 |
|
62 | | - // Input ubicazione con struttura OpenSTAManager |
63 | | - echo '{[ "type": "text", "name": "ubicazione_'.$id.'", "value": "'.$ubicazione.'", "placeholder": "'.tr('Ubicazione').'", "onchange": "aggiornaUbicazione('.$id.', this.value)" ]}'; |
| 67 | + // Input ubicazione con struttura OpenSTAManager |
| 68 | + echo '{[ "type": "text", "name": "ubicazione_'.$id.'", "value": "'.$ubicazione.'", "placeholder": "'.tr('Ubicazione').'", "onchange": "aggiornaUbicazione('.$id.', this.value)" ]}'; |
64 | 69 |
|
65 | 70 | echo '</td> |
66 | 71 | <td class="text-center"> |
67 | | - <button type="button" class="btn btn-danger" |
68 | | - onclick="rimuoviRigaInventario('.$id.')" |
| 72 | + <button type="button" class="btn btn-danger" |
| 73 | + onclick="rimuoviRigaInventario('.$id.')" |
69 | 74 | title="'.tr('Rimuovi').'"> |
70 | 75 | <i class="fa fa-trash"></i> |
71 | 76 | </button> |
|
0 commit comments