From b61a3f1ba946217f4c807ab7ace36e78a27fa13e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 18 Nov 2019 19:59:21 +0100 Subject: [PATCH] Update bookkeeping.class.php --- .../accountancy/class/bookkeeping.class.php | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) 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')