From 4fa364ec1c137de6589c715db515ab428956ca71 Mon Sep 17 00:00:00 2001 From: Regis Houssin <regis@dolibarr.fr> Date: Sun, 16 Dec 2007 11:31:14 +0000 Subject: [PATCH] Fix: le prix d'un produit ne doit pas avoir la valeur NULL --- htdocs/product.class.php | 4 ++-- mysql/migration/2.1.0-2.2.0.sql | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/product.class.php b/htdocs/product.class.php index 997e4920124..18a294b9d56 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 28686c95ef7..3c51a24c40f 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 -- GitLab