diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index d8a33ac1054..a1116ecd6a2 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2014-2017 Olivier Geffroy * Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2015-2017 Florian Henry - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2019 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 @@ -32,16 +32,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; */ class BookKeeping extends CommonObject { - /** - * @var string Error code (or message) - */ - public $error; - - /** - * @var string[] Array of Error codes (or messages) - */ - public $errors = array(); - /** * @var string Id to identify managed objects */ @@ -235,13 +225,13 @@ class BookKeeping extends CommonObject $this->label_operation = trim($this->label_operation); } if (isset($this->debit)) { - $this->debit = trim($this->debit); + $this->debit = (float) $this->debit; } if (isset($this->credit)) { - $this->credit = trim($this->credit); + $this->credit = (float) $this->credit; } if (isset($this->montant)) { - $this->montant = trim($this->montant); + $this->montant = (float) $this->montant; } if (isset($this->sens)) { $this->sens = trim($this->sens); @@ -258,8 +248,8 @@ class BookKeeping extends CommonObject if (isset($this->piece_num)) { $this->piece_num = trim($this->piece_num); } - if (empty($this->debit)) $this->debit = 0; - if (empty($this->credit)) $this->credit = 0; + if (empty($this->debit)) $this->debit = 0.0; + if (empty($this->credit)) $this->credit = 0.0; // Check parameters if (($this->numero_compte == "") || $this->numero_compte == '-1' || $this->numero_compte == 'NotDefined')