From f0361b9c4c11eb8c36b5e6b523eebd47928f2d6a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 22 Jan 2013 16:48:32 +0100 Subject: [PATCH] Fix: broken feature --- htdocs/core/class/commonobject.class.php | 12 ++++++------ htdocs/core/class/hookmanager.class.php | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4b094236cde..26a1905a6af 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2135,7 +2135,7 @@ abstract class CommonObject $this->array_options[$key] = null; } break; - case 'price': + case 'price': $this->array_options[$key] = price2num($this->array_options[$key]); break; } @@ -2282,16 +2282,16 @@ abstract class CommonObject $qty= $obj->qty; $discount_percent_line = $obj->remise_percent; $total_ht = $obj->total_ht; - + $total_discount_line = price2num(($pu_ht * $qty) - $total_ht, 'MT'); $total_discount += $total_discount_line; - + $i++; } } else dol_syslog(get_class($this).'::getTotalDiscount '.$this->db->lasterror(), LOG_ERR); - - //print $total_discount; exit; + + //print $total_discount; exit; return price2num($total_discount); } @@ -2482,7 +2482,7 @@ abstract class CommonObject $parameters=array(); $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); diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index d3ddfe0ba8d..b836c001152 100755 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -41,6 +41,8 @@ class HookManager // Array result var $resArray=array(); + // Printable result (int, string) + var $resPrint; /** * Constructor