From 2b9a118384b4cb871790cb576cc8e64756183f66 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Jan 2012 13:47:47 +0100 Subject: [PATCH] Fix: Bad date init --- htdocs/compta/sociales/class/chargesociales.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index c387453eb64..8c3d25644b3 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -108,7 +108,7 @@ class ChargeSociales extends CommonObject /** - * Create a social contribution in database + * Create a social contribution into database * * @param User $user User making creation * @return int <0 if KO, id if OK @@ -119,7 +119,7 @@ class ChargeSociales extends CommonObject $newamount=price2num($this->amount,'MT'); // Validation parametres - if (! $newamount > 0) + if (! $newamount > 0 || empty($this->date_ech) || empty($this->periode)) { $this->error="ErrorBadParameter"; return -2; @@ -489,7 +489,7 @@ class ChargeSociales extends CommonObject $this->paye = 0; $this->date = time(); $this->date_ech=$this->date+3600*24*30; - $this->period=$this->date+3600*24*30; + $this->periode=$this->date+3600*24*30; $this->amount=100; $this->lib = 0; $this->type = 1;