From 425e26ecb6661f6bc1472db385c06690f8511e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 15 Oct 2018 08:46:41 +0200 Subject: [PATCH] Update bookkeeping.class.php --- htdocs/accountancy/class/bookkeeping.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index b228588b90fb0..87d561b6add43 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1,7 +1,8 @@ - * Copyright (C) 2015-2017 Alexandre Spangaro - * Copyright (C) 2015-2017 Florian Henry +/* 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 * * 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 @@ -1640,9 +1641,9 @@ function export_bookkeping($model = 'ebp') /** * Transform transaction * - * @param number $direction If 0 tmp => real, if 1 real => tmp - * @param string $piece_num Piece num - * @return void + * @param number $direction If 0 tmp => real, if 1 real => tmp + * @param string $piece_num Piece num + * @return int int <0 if KO, >0 if OK */ public function transformTransaction($direction=0,$piece_num='') { @@ -1678,8 +1679,7 @@ public function transformTransaction($direction=0,$piece_num='') $this->errors[] = 'Error ' . $this->db->lasterror(); dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR); } - } - if ($direction==1) { + } elseif ($direction==1) { $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element.'_tmp WHERE piece_num = '.$piece_num; $resql = $this->db->query($sql); if (! $resql) {