File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5454}
5555echo '
5656 <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> ' : '' ).'
57+ <p class="mb-2"><b> ' .$ articolo ->codice .'</b></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+ if ( !empty ($ articolo ->barcode ) ){
60+
61+ echo '
62+ <div class="readmore">
63+ <table class="table">
64+ <tbody> ' ;
65+ foreach ($ articolo ->barcodes as $ barcode ) {
66+ echo '
67+ <tr>
68+ <td><i class="fa fa-barcode mr-1"></i> ' .$ barcode .'</td>
69+ </tr> ' ;
70+ }
71+ echo '
72+ </tbody>
73+ </table>
74+ </div> ' ;
75+ }
76+ echo '
5977 </div>
6078 </div>
6179 </div>
Original file line number Diff line number Diff line change @@ -503,6 +503,14 @@ public function getTotaleVenditaAttribute()
503503 return $ prezzo_vendita ;
504504 }
505505
506+ public function getBarcodesAttribute ()
507+ {
508+ $ barcode = database ()->table ('mg_articoli_barcode ' )->where ('idarticolo ' , $ this ->id )->pluck ('barcode ' );
509+
510+ return $ barcode ;
511+ }
512+
513+
506514 /**
507515 * @version distinta_base
508516 */
You can’t perform that action at this time.
0 commit comments