fetchArray("SELECT *, mg_articoli.id AS id_articolo, (SELECT nome FROM mg_categorie WHERE mg_categorie.parent = 0 AND mg_categorie.id = mg_articoli.id_categoria) AS categoria, (SELECT nome FROM mg_categorie WHERE mg_categorie.parent = 1 AND mg_categorie.id = mg_articoli.id_sottocategoria) AS subcategoria FROM mg_articoli WHERE ( replace(codice,'.','') LIKE \"%$search_codice%\" OR codice LIKE \"%$search_codice%\" ) AND replace(descrizione,'.','') LIKE \"%$search_descrizione%\" ".$add_where." AND qta > 0 HAVING CONCAT_WS( ' ', categoria, subcategoria ) LIKE \"%".$search_categoria.'%" ORDER BY codice ASC'); $totrows = sizeof($rs); $body .= '
Codice | \n"; $body .= "Descrizione | \n"; $body .= "Prezzo di vendita | \n"; $body .= "Q.tà | \n"; $body .= "Prezzo di acquisto | \n"; $body .= "Valore totale | \n"; $body .= "
---|---|---|---|---|---|
".$rs[$r]['codice']." | \n"; $body .= "".$rs[$r]['descrizione']." | \n"; $body .= "".Translator::numberToLocale($rs[$r]['prezzo_vendita'])." € | \n"; $body .= "".$rs[$r]['um'].' '.Translator::numberToLocale($rs[$r]['qta'])." | \n"; $body .= "".Translator::numberToLocale($rs[$r]['prezzo_acquisto'])." € | \n"; $body .= "".Translator::numberToLocale(($rs[$r]['prezzo_acquisto'] * $rs[$r]['qta']))." € | \n"; $body .= "
TOTALE: | \n"; $body .= "\n"; $body .= " | ".Translator::numberToLocale($totale_qta)." | \n"; $body .= "\n"; $body .= " | ".Translator::numberToLocale($totale_acquisto)." € | \n"; $body .= "