From 688d6e37e2ee0d889fa14426b8ec07cbf723c082 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Thu, 24 Sep 2015 16:57:13 +0200 Subject: [PATCH] FIX there is no way to hide or change qty to useful information by module --- htdocs/core/lib/pdf.lib.php | 57 ++++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 11 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 0ab44fb927b..6f2d9ff8089 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1341,7 +1341,10 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0) if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); $action=''; - return $hookmanager->executeHooks('pdf_getlinevatrate',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlinevatrate',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } else { @@ -1371,7 +1374,10 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0) if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); $action=''; - return $hookmanager->executeHooks('pdf_getlineupexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlineupexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } else { @@ -1428,7 +1434,11 @@ function pdf_getlineqty($object,$i,$outputlangs,$hidedetails=0) if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); $action=''; - return $hookmanager->executeHooks('pdf_getlineqty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlineqty',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; + } else { @@ -1458,7 +1468,10 @@ function pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails=0) if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); $action=''; - return $hookmanager->executeHooks('pdf_getlineqty_asked',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlineqty_asked',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } else { @@ -1488,7 +1501,10 @@ function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0) if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); $action=''; - return $hookmanager->executeHooks('pdf_getlineqty_shipped',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlineqty_shipped',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } else { @@ -1518,7 +1534,10 @@ function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0) if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); $action=''; - return $hookmanager->executeHooks('pdf_getlineqty_keeptoship',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlineqty_keeptoship',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } else { @@ -1553,8 +1572,12 @@ function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanag 'special_code' => $special_code ); $action = ''; - return $hookmanager->executeHooks('pdf_getlineunit', $parameters, $object, + $reshook = $hookmanager->executeHooks('pdf_getlineunit', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; + } else { if (empty($hidedetails) || $hidedetails > 1) { return $langs->transnoentitiesnoconv($object->lines[$i]->getLabelOfUnit('short')); @@ -1587,7 +1610,10 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0) if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); $action=''; - return $hookmanager->executeHooks('pdf_getlineremisepercent',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlineremisepercent',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } else { @@ -1614,7 +1640,10 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm if (!empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i' => $i, 'outputlangs' => $outputlangs, 'hidedetails' => $hidedetails, 'special_code' => $special_code); $action = ''; - return $hookmanager->executeHooks('pdf_getlineprogress', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlineprogress', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } else { if (empty($hidedetails) || $hidedetails > 1) return $object->lines[$i]->situation_percent . '%'; } @@ -1649,7 +1678,10 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0) if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); $action=''; - return $hookmanager->executeHooks('pdf_getlinetotalexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlinetotalexcltax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } else { @@ -1684,7 +1716,10 @@ function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0) if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line); $parameters = array('i'=>$i,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'special_code'=>$special_code); $action=''; - return $hookmanager->executeHooks('pdf_getlinetotalwithtax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('pdf_getlinetotalwithtax',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks + + if(!empty($hookmanager->resPrint)) return $hookmanager->resPrint; + else return $reshook; } else {