From 6d415001364d149255f2c6524211dd2830ef3c31 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 8 Nov 2013 10:08:01 +0100 Subject: [PATCH] Fix : SQL error on margin page --- htdocs/margin/productMargins.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php index 50d30a217f0..f16cb126e87 100644 --- a/htdocs/margin/productMargins.php +++ b/htdocs/margin/productMargins.php @@ -158,7 +158,7 @@ print ''; $sql = "SELECT p.label, p.rowid, p.fk_product_type, p.ref,"; $sql.= " d.fk_product,"; $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht,"; -$sql.= " f.datef, f.paye, f.fk_statut as statut"; +$sql.= " f.datef, f.paye, f.fk_statut as statut,"; $sql.= " sum(d.total_ht) as selling_price,"; $sql.= " sum(".$db->ifsql('d.total_ht <=0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,"; $sql.= " sum(".$db->ifsql('d.total_ht <=0','-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))','d.total_ht - (d.buy_price_ht * d.qty)').") as marge";