From 4c424bb760c43e1d938fac74e0bddcc49b10a1fa Mon Sep 17 00:00:00 2001 From: alexis Algoud Date: Tue, 13 Jun 2017 10:09:53 +0200 Subject: [PATCH] fix current element compare amount --- htdocs/blockedlog/class/blockedlog.class.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 4f2a37e0116..b0cddd66f75 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -502,8 +502,7 @@ class BlockedLog */ private function getCurrentValue() { - if($this->action === 'PAYMENT_CUSTOMER_CREATE' - || $this->action === 'PAYMENT_ADD_TO_BANK') { + if($this->element === 'payment') { $sql="SELECT amount FROM ".MAIN_DB_PREFIX."paiement WHERE rowid=".$this->fk_object; $res = $this->db->query($sql); @@ -512,7 +511,15 @@ class BlockedLog $this->amounts = (double) $obj->amount; } } - + elseif($this->element === 'facture') { + $sql="SELECT total_ttc FROM ".MAIN_DB_PREFIX."facture WHERE rowid=".$this->fk_object; + + $res = $this->db->query($sql); + if($res && $obj = $this->db->fetch_object($res)) { + $this->amounts = (double) $obj->total_ttc; + } + } + } /**