62 lines
2.6 KiB
PHP
62 lines
2.6 KiB
PHP
<?php
|
|
include_once(__DIR__."/../../core.php");
|
|
|
|
$idmagazzino = $id_record;
|
|
/*
|
|
ARTICOLI CARICATI IN QUESTO Magazzino
|
|
*/
|
|
//Elenco articoli caricati sull'Magazzino
|
|
$query = "SELECT mg_articoli_magazzini.id, mg_articoli.codice AS codice, idarticolo, mg_articoli_magazzini.qta AS qta_automezzo, mg_articoli.qta AS qta_magazzino, mg_articoli.descrizione, mg_articoli.prezzo_vendita, (SELECT percentuale FROM co_iva WHERE id=mg_articoli.idiva_vendita) AS prciva_vendita FROM mg_articoli_magazzini INNER JOIN mg_articoli ON mg_articoli_magazzini.idarticolo=mg_articoli.id WHERE mg_articoli_magazzini.idmagazzino='".$idmagazzino."' AND mg_articoli_magazzini.qta>0";
|
|
$rs2 = $dbo->fetchArray($query);
|
|
for( $i=0; $i<sizeof($rs2); $i++ ){
|
|
$tot_articoli += $rs2[$i]['qta_automezzo'];
|
|
}
|
|
|
|
if( sizeof($rs2)!=0 ){
|
|
|
|
for( $i=0; $i<sizeof($rs2); $i++ ){
|
|
|
|
//Articolo
|
|
echo "<td class='text-left'>\n";
|
|
echo "<a href='".$rootdir."/editor.php?id_module=".$modules_info['Articoli']['id']."&id_record=".$rs2[$i]['idarticolo']."' target='_blank'>".$rs2[$i]['codice']." - ".$rs2[$i]['descrizione']."</a>\n";
|
|
echo "</td>\n";
|
|
|
|
//Quantità
|
|
echo "<td class='first_cell center'>\n";
|
|
echo "<span><big>".$rs2[$i]['qta_automezzo']."</big></span><br/>\n";
|
|
echo "<small>Q.tà magazzino: ".$rs2[$i]['qta_magazzino']."</small><br/>\n";
|
|
echo "</td>\n";
|
|
|
|
//Prezzo di vendita
|
|
echo "<td class='table_cell center'>\n";
|
|
$netto = $rs2[$i]['prezzo_vendita'];
|
|
$iva = $rs2[$i]['prezzo_vendita']/100*$rs2[$i]['prciva_vendita'];
|
|
echo "<span>".number_format( $netto+$iva, 2, ",", "" )." €</span><br/>\n";
|
|
echo "<small>netto: ".number_format( $netto, 2, ",", "" )." €</small><br/>\n";
|
|
echo "<small>iva: ".number_format( $iva, 2, ",", "" )." €</small><br/>\n";
|
|
echo "</td>\n";
|
|
|
|
|
|
//Pulsanti
|
|
echo "<td class='text-center'>\n";
|
|
|
|
echo " <form action='".$rootdir."/editor.php?id_module=".$modules_info['Magazzini']['id']."&id_record=".$id_record."' method='post' id='delete-form-".$rs2[$i]['id']."' role='form'>\n";
|
|
echo " <input type='hidden' name='backto' value='record-edit'>\n";
|
|
echo " <input type='hidden' name='id_record' value='".$id_record."'>\n";
|
|
echo " <input type='hidden' name='op' value='moverow'>\n";
|
|
echo " <input type='hidden' name='idmagazzinotecnico' value='".$rs2[$i]['id']."'>\n";
|
|
|
|
echo " <a href='javascript:;' class='btn btn-sm btn-danger' title='Rimuovi questa riga' onclick=\"if( confirm('Rimuovere articolo dall\'magazzino?') ){ $('#delete-form-".$rs2[$i]['id']."').submit(); }\"><i class='fa fa-trash-o'></i></a>\n";
|
|
echo " </form>\n";
|
|
|
|
|
|
echo "</td></tr>\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|