Fix: broken feature

This commit is contained in:
Regis Houssin 2013-01-22 16:48:32 +01:00
parent 131dd663cb
commit f0361b9c4c
2 changed files with 8 additions and 6 deletions

View File

@ -2135,7 +2135,7 @@ abstract class CommonObject
$this->array_options[$key] = null; $this->array_options[$key] = null;
} }
break; break;
case 'price': case 'price':
$this->array_options[$key] = price2num($this->array_options[$key]); $this->array_options[$key] = price2num($this->array_options[$key]);
break; break;
} }
@ -2282,16 +2282,16 @@ abstract class CommonObject
$qty= $obj->qty; $qty= $obj->qty;
$discount_percent_line = $obj->remise_percent; $discount_percent_line = $obj->remise_percent;
$total_ht = $obj->total_ht; $total_ht = $obj->total_ht;
$total_discount_line = price2num(($pu_ht * $qty) - $total_ht, 'MT'); $total_discount_line = price2num(($pu_ht * $qty) - $total_ht, 'MT');
$total_discount += $total_discount_line; $total_discount += $total_discount_line;
$i++; $i++;
} }
} }
else dol_syslog(get_class($this).'::getTotalDiscount '.$this->db->lasterror(), LOG_ERR); else dol_syslog(get_class($this).'::getTotalDiscount '.$this->db->lasterror(), LOG_ERR);
//print $total_discount; exit; //print $total_discount; exit;
return price2num($total_discount); return price2num($total_discount);
} }
@ -2482,7 +2482,7 @@ abstract class CommonObject
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('showLinkedObjectBlock',$parameters,$this,$action); // Note that $action and $object may have been modified by hook $reshook=$hookmanager->executeHooks('showLinkedObjectBlock',$parameters,$this,$action); // Note that $action and $object may have been modified by hook
if (! $reshook) if (empty($hookmanager->resPrint))
{ {
$num = count($this->linkedObjects); $num = count($this->linkedObjects);

View File

@ -41,6 +41,8 @@ class HookManager
// Array result // Array result
var $resArray=array(); var $resArray=array();
// Printable result (int, string)
var $resPrint;
/** /**
* Constructor * Constructor