|
27 | 27 | <hr> |
28 | 28 | <div class="row"> |
29 | 29 | <div class="col-md-6"> |
30 | | - <div class="card card-info card-outline shadow"> |
| 30 | + <div class="card card-primary card-outline shadow"> |
31 | 31 | <div class="card-header"> |
32 | 32 | <h3 class="card-title"><i class="fa fa-vcard"></i> '.tr('Articolo').'</h3> |
33 | 33 | </div> |
34 | 34 | <div class="card-body"> |
35 | 35 | <div class="row"> |
36 | 36 | <div class="col-md-3"> |
37 | | - <img src="'.$immagine_articolo.'" " class="img-fluid"> |
| 37 | + <img src="'.$immagine_articolo.'" class="img-fluid img-thumbnail"> |
38 | 38 | </div> |
39 | | - |
| 39 | +
|
40 | 40 | <div class="col-md-9">'; |
41 | 41 | // Articolo |
42 | 42 | if ($articolo->marca) { |
43 | 43 | echo ' |
44 | | - <p class="float-right"><i class="fa fa-tag"></i> |
45 | | - '.($articolo->marca ? ($articolo->marca->link ? '<a href="'.$articolo->marca->link.'" target="_blank" rel="noopener noreferrer"> '.$articolo->marca->name.'</a>' : $articolo->marca->name.' ') : ''). |
| 44 | + <p class="float-right badge badge-info p-2"><i class="fa fa-tag mr-1"></i> |
| 45 | + '.($articolo->marca ? ($articolo->marca->link ? '<a href="'.$articolo->marca->link.'" target="_blank" rel="noopener noreferrer" class="text-white"> '.$articolo->marca->name.'</a>' : $articolo->marca->name.' ') : ''). |
46 | 46 | ($articolo->id_modello ? ' <small><i class="fa fa-chevron-right"></i></small> '.Marca::where('parent', $articolo->id_marca)->where('id', $articolo->id_modello)->first()->name.' ' : '') |
47 | 47 | .'</p>'; |
48 | 48 | } |
49 | 49 | if ($articolo->id_categoria) { |
50 | 50 | echo ' |
51 | | - <p class="text-muted">'.$articolo->categoria->getTranslation('title'). |
| 51 | + <p class="text-muted mb-2"><i class="fa fa-folder-open mr-1"></i>'.$articolo->categoria->getTranslation('title'). |
52 | 52 | ($articolo->sottocategoria ? ' <small><i class="fa fa-chevron-right"></i></small> '.$articolo->sottocategoria->getTranslation('title') : ''). |
53 | 53 | '</p>'; |
54 | 54 | } |
55 | 55 | echo ' |
56 | | - <p><h4><b>'.$articolo->getTranslation('title').'</b> '.($articolo->attivo ? '<i class="fa fa-check text-success"></i>' : '<i class="fa fa-times text-danger"></i> ').'</h4></p> |
57 | | - <p><b>'.$articolo->codice.'</b> '.($articolo->barcode ? ' - <i class="fa fa-barcode"></i> '.$articolo->barcode.'</p>' : '').'</p> |
58 | | - '.($articolo->note ? '<p class="text-danger"><i class="fa fa-pencil-square-o"></i> '.$articolo->note.'</p>' : '').' |
| 56 | + <h4 class="mb-2 text-primary"><b>'.$articolo->getTranslation('title').'</b> '.($articolo->attivo ? '<span class="badge badge-success"><i class="fa fa-check"></i> '.tr('Attivo').'</span>' : '<span class="badge badge-danger"><i class="fa fa-times"></i> '.tr('Disattivato').'</span>').'</h4> |
| 57 | + <p class="mb-2"><b>'.$articolo->codice.'</b> '.($articolo->barcode ? ' <span class="badge badge-secondary"><i class="fa fa-barcode mr-1"></i> '.$articolo->barcode.'</span>' : '').'</p> |
| 58 | + '.($articolo->note ? '<p class="alert alert-warning p-2 mt-2"><i class="fa fa-pencil-square-o mr-1"></i> '.$articolo->note.'</p>' : '').' |
59 | 59 | </div> |
60 | 60 | </div> |
61 | 61 | </div> |
|
73 | 73 | // Giacenze |
74 | 74 | echo ' |
75 | 75 | <div class="col-md-4"> |
76 | | - <div class="card card-info card-outline shadow"> |
| 76 | + <div class="card card-success card-outline shadow"> |
77 | 77 | <div class="card-header"> |
78 | 78 | <h3 class="card-title"><i class="fa fa-archive"></i> '.tr('Giacenze').'</h3> |
79 | 79 | </div> |
80 | 80 | <div class="card-body">'; |
81 | 81 | if ($articolo->servizio) { |
82 | 82 | echo ' |
83 | 83 | <div class="alert alert-info text-center" role="alert"> |
84 | | - <i class="fa fa-info-circle"></i> '.tr('Questo articolo è un servizio').'. |
| 84 | + <i class="fa fa-info-circle mr-1"></i> '.tr('Questo articolo è un servizio').'. |
85 | 85 | </div>'; |
86 | 86 | } else { |
87 | 87 | echo ' |
88 | | - <table class="table table-sm"> |
| 88 | + <table class="table table-sm table-hover"> |
89 | 89 | <thead> |
90 | 90 | <tr> |
91 | 91 | <th>'.tr('Sede').'</th> |
|
96 | 96 | <tbody>'; |
97 | 97 | foreach ($sedi as $sede) { |
98 | 98 | $threshold_sede = $dbo->fetchOne('SELECT `threshold_qta` FROM `mg_scorte_sedi` WHERE `id_sede` = '.prepare($sede['id']).' AND `id_articolo` = '.prepare($articolo->id))['threshold_qta']; |
| 99 | + $giacenza_value = $giacenze[$sede['id']][0]; |
| 100 | + $is_low = $giacenza_value < $threshold_sede; |
| 101 | + |
| 102 | + // Format the quantity with the appropriate decimal places |
| 103 | + $formatted_qty = numberFormat($giacenza_value, null); |
| 104 | + $formatted_secondary = $articolo->fattore_um_secondaria != 0 ? numberFormat($giacenza_value * $articolo->fattore_um_secondaria, null) : ''; |
99 | 105 |
|
100 | 106 | echo ' |
101 | | - <tr class="'.($giacenze[$sede['id']][0] < $threshold_sede ? 'text-danger' : '').'"> |
102 | | - <td>'.$sede['nomesede'].'</td> |
103 | | - <td class="text-right">'.numberFormat($giacenze[$sede['id']][0], 'qta').' '.$articolo->um.'</td> |
104 | | - '.($articolo->fattore_um_secondaria != 0 ? '<td class="text-right"><i class="fa fa-chevron-right pull-left"></i> '.$giacenze[$sede['id']][0] * $articolo->fattore_um_secondaria.' '.$articolo->um_secondaria.'</td>' : '').' |
| 107 | + <tr class="'.($is_low ? 'text-danger' : '').'"> |
| 108 | + <td>'.($is_low ? '<i class="fa fa-exclamation-triangle mr-1"></i>' : '').$sede['nomesede'].'</td> |
| 109 | + <td class="text-right">'.$formatted_qty.' '.$articolo->um.'</td> |
| 110 | + '.($articolo->fattore_um_secondaria != 0 ? '<td class="text-right"><i class="fa fa-chevron-right pull-left"></i> '.$formatted_secondary.' '.$articolo->um_secondaria.'</td>' : '').' |
105 | 111 | </tr>'; |
106 | 112 | } |
107 | 113 | echo ' |
|
115 | 121 | // Panoramica |
116 | 122 | echo ' |
117 | 123 | <div class="col-md-2"> |
118 | | - <div class="card card-info card-outline shadow"> |
| 124 | + <div class="card card-warning card-outline shadow"> |
119 | 125 | <div class="card-header"> |
120 | 126 | <h3 class="card-title"><i class="fa fa-info-circle"></i> '.tr('Informazioni').'</h3> |
121 | 127 | </div> |
122 | 128 | <div class="card-body"> |
123 | | - <table class="table table-sm"> |
| 129 | + <table class="table table-sm table-hover"> |
124 | 130 | <tbody> |
125 | 131 | <tr> |
126 | | - <td>'.tr('Garanzia').'</td> |
127 | | - <td class="text-right">'.($articolo->gg_garanzia ? $articolo->gg_garanzia.' giorni' : '').'</td> |
| 132 | + <td><i class="fa fa-calendar-check-o mr-1"></i> '.tr('Garanzia').'</td> |
| 133 | + <td class="text-right font-weight-bold">'.($articolo->gg_garanzia ? $articolo->gg_garanzia.' giorni' : '<span class="text-muted">-</span>').'</td> |
128 | 134 | </tr> |
129 | 135 | <tr> |
130 | | - <td>'.tr('Serial number').'</td> |
131 | | - <td class="text-right">'.($articolo->abilita_serial ? '<i class="fa fa-check text-success"></i>' : '<i class="fa fa-times text-danger"></i>').'</td> |
| 136 | + <td><i class="fa fa-qrcode mr-1"></i> '.tr('Serial number').'</td> |
| 137 | + <td class="text-right">'.($articolo->abilita_serial ? '<span class="badge badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-danger"><i class="fa fa-times"></i></span>').'</td> |
132 | 138 | </tr> |
133 | 139 | <tr> |
134 | | - <td>'.tr('Ubicazione').'</td> |
135 | | - <td class="text-right">'.($articolo->ubicazione ?: '').'</td> |
| 140 | + <td><i class="fa fa-map-marker mr-1"></i> '.tr('Ubicazione').'</td> |
| 141 | + <td class="text-right font-weight-bold">'.($articolo->ubicazione ? $articolo->ubicazione : '<span class="text-muted">-</span>').'</td> |
136 | 142 | </tr> |
137 | 143 | <tr> |
138 | | - <td>'.tr('Peso lordo').'</td> |
139 | | - <td class="text-right">'.($articolo->peso_lordo ? numberFormat($articolo->peso_lordo, $decimals).' '.tr('kg') : '').'</td> |
| 144 | + <td><i class="fa fa-balance-scale mr-1"></i> '.tr('Peso lordo').'</td> |
| 145 | + <td class="text-right font-weight-bold">'.($articolo->peso_lordo ? numberFormat($articolo->peso_lordo, null).' '.tr('kg') : '<span class="text-muted">-</span>').'</td> |
140 | 146 | </tr> |
141 | 147 | <tr> |
142 | | - <td>'.tr('Volume').'</td> |
143 | | - <td class="text-right">'.($articolo->volume ? numberFormat($articolo->volume, $decimals).' '.tr('m³') : '').'</td> |
| 148 | + <td><i class="fa fa-cube mr-1"></i> '.tr('Volume').'</td> |
| 149 | + <td class="text-right font-weight-bold">'.($articolo->volume ? numberFormat($articolo->volume, null).' '.tr('m³') : '<span class="text-muted">-</span>').'</td> |
144 | 150 | </tr> |
145 | 151 | </tbody> |
146 | 152 | </table> |
147 | 153 | </div> |
148 | 154 | </div> |
149 | | - </div> |
| 155 | + </div> |
150 | 156 | </div>'; |
0 commit comments