diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index d0b64fdca77..82012400f68 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -950,7 +950,7 @@ abstract class CommonDocGenerator } } - if (array_key_exists('option_'.$key, $object->array_options)) { + if (array_key_exists('options_'.$key, $object->array_options)) { $array_to_fill = array_merge($array_to_fill, array($array_key.'_options_'.$key => $object->array_options['options_'.$key])); } else { $array_to_fill = array_merge($array_to_fill, array($array_key.'_options_'.$key => '')); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 2f3eb754b48..a1e55237aa4 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3491,7 +3491,7 @@ class Product extends CommonObject global $db, $conf, $user, $hookmanager; $sql = "SELECT COUNT(DISTINCT f.fk_soc) as nb_customers, COUNT(DISTINCT f.rowid) as nb,"; - $sql .= " COUNT(fd.rowid) as nb_rows, SUM('fd.qty') as qty"; + $sql .= " COUNT(fd.rowid) as nb_rows, SUM(fd.qty) as qty"; $sql .= " FROM ".MAIN_DB_PREFIX."facturedet_rec as fd"; $sql .= ", ".MAIN_DB_PREFIX."facture_rec as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s";