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'], 2)." € | \n"; $body .= "".$rs[$r]['um'].' '.Translator::numberToLocale($rs[$r]['qta'], 2)." | \n"; $body .= "".Translator::numberToLocale($rs[$r]['prezzo_acquisto'], 2)." € | \n"; $body .= "".Translator::numberToLocale(($rs[$r]['prezzo_acquisto'] * $rs[$r]['qta']), 2)." € | \n"; $body .= "
TOTALE: | \n"; $body .= "\n"; $body .= " | ".Translator::numberToLocale($totale_qta, 2)." | \n"; $body .= "\n"; $body .= " | ".Translator::numberToLocale($totale_acquisto, 2)." € | \n"; $body .= "