From 5b24b7cf467addb81ce3634a90e50ee1e716ddd3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Sep 2010 11:59:46 +0000 Subject: [PATCH] Fix: Error when capital is not a number --- htdocs/societe/class/societe.class.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 3cf6eb47749..bcd85cf3670 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -357,7 +357,6 @@ class Societe extends CommonObject // Clean parameters $this->id=$id; - $this->capital=trim($this->capital); $this->nom=trim($this->nom); $this->adresse=trim($this->adresse); // TODO obsolete $this->address=trim($this->address); @@ -386,8 +385,8 @@ class Societe extends CommonObject $this->localtax1_assuj=trim($this->localtax1_assuj); $this->localtax2_assuj=trim($this->localtax2_assuj); - $this->capital=trim($this->capital); - if (strlen($this->capital) == 0) $this->capital = 0; + $this->capital=price2num(trim($this->capital),'MT'); + if (empty($this->capital)) $this->capital = 0; $this->effectif_id=trim($this->effectif_id); $this->forme_juridique_code=trim($this->forme_juridique_code);