diff --git a/htdocs/product.class.php b/htdocs/product.class.php index 997e4920124568f44e6a7869a8d349158d6878e5..18a294b9d56ba5d0883c04740cccb6ccb550cbd8 100644 --- a/htdocs/product.class.php +++ b/htdocs/product.class.php @@ -209,8 +209,8 @@ class Product extends CommonObject if ($this->libelle) $sql.= "'".addslashes($this->libelle)."', "; $sql.= $user->id.","; $sql.= " ".$this->type.","; - $sql.= ($price_ht?price2num($price_ht):"null").","; - $sql.= ($price_ttc?price2num($price_ttc):"null").","; + $sql.= $price_ht.","; + $sql.= $price_ttc.","; $sql.= "'".$this->price_base_type."',"; $sql.= "'".$this->canvas."')"; diff --git a/mysql/migration/2.1.0-2.2.0.sql b/mysql/migration/2.1.0-2.2.0.sql index 28686c95ef78b5532140de179b17a2e7c2f23e25..3c51a24c40f37d06bce3dc732ac9c84c979637fb 100644 --- a/mysql/migration/2.1.0-2.2.0.sql +++ b/mysql/migration/2.1.0-2.2.0.sql @@ -1165,4 +1165,8 @@ ALTER TABLE llx_societe_remise_except ADD CONSTRAINT fk_societe_remise_fk_factur DELETE FROM llx_const WHERE name = 'PRODUIT_CHANGE_PROD_DESC'; -ALTER TABLE llx_commande_fournisseurdet MODIFY fk_product integer; \ No newline at end of file +ALTER TABLE llx_commande_fournisseurdet MODIFY fk_product integer; + +-- Le prix d'un produit ne doit pas avoir la valeur NULL +UPDATE llx_product SET price = 0 WHERE price is NULL; +UPDATE llx_product SET price_ttc = 0 WHERE price_ttc is NULL; \ No newline at end of file