From fa78ab7c66336ce6283d3274685d68a3ddb61978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 16 Oct 2018 23:20:13 +0200 Subject: [PATCH] do not trim int --- htdocs/contrat/class/contrat.class.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 398da806c2d..7e0c2d13ca5 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -10,6 +10,7 @@ * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2015-2017 Ferran Marcet * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -2887,9 +2888,9 @@ class ContratLigne extends CommonObjectLine $error=0; // Clean parameters - $this->fk_contrat=trim($this->fk_contrat); - $this->fk_product=trim($this->fk_product); - $this->statut=(int) $this->statut; + $this->fk_contrat = (int) $this->fk_contrat; + $this->fk_product = (int) $this->fk_product; + $this->statut = (int) $this->statut; $this->label=trim($this->label); $this->description=trim($this->description); $this->vat_src_code=trim($this->vat_src_code); @@ -2899,7 +2900,7 @@ class ContratLigne extends CommonObjectLine $this->qty=trim($this->qty); $this->remise_percent=trim($this->remise_percent); $this->remise=trim($this->remise); - $this->fk_remise_except=trim($this->fk_remise_except); + $this->fk_remise_except = (int) $this->fk_remise_except; $this->subprice=price2num($this->subprice); $this->price_ht=price2num($this->price_ht); $this->total_ht=trim($this->total_ht); @@ -2908,9 +2909,9 @@ class ContratLigne extends CommonObjectLine $this->total_localtax2=trim($this->total_localtax2); $this->total_ttc=trim($this->total_ttc); $this->info_bits=trim($this->info_bits); - $this->fk_user_author=trim($this->fk_user_author); - $this->fk_user_ouverture=trim($this->fk_user_ouverture); - $this->fk_user_cloture=trim($this->fk_user_cloture); + $this->fk_user_author = (int) $this->fk_user_author; + $this->fk_user_ouverture = (int) $this->fk_user_ouverture; + $this->fk_user_cloture = (int) $this->fk_user_cloture; $this->commentaire=trim($this->commentaire); //if (empty($this->subprice)) $this->subprice = 0; if (empty($this->price_ht)) $this->price_ht = 0;