Skip to content

Commit

Permalink
fix current element compare amount
Browse files Browse the repository at this point in the history
  • Loading branch information
alexis Algoud committed Jun 13, 2017
1 parent f780af3 commit 4c424bb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions htdocs/blockedlog/class/blockedlog.class.php
Expand Up @@ -502,8 +502,7 @@ public function getLog($element, $fk_object, $limit = 0, $order = -1) {
*/
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);
Expand All @@ -512,7 +511,15 @@ private function getCurrentValue() {
$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;
}
}

}

/**
Expand Down

0 comments on commit 4c424bb

Please sign in to comment.