Skip to content

Commit

Permalink
Merge pull request #3611 from atm-alexis/develop
Browse files Browse the repository at this point in the history
FIX there is no way to hide or change qty by hook
  • Loading branch information
eldy committed Oct 1, 2015
2 parents c7e05d2 + 688d6e3 commit d4b5256
Showing 1 changed file with 46 additions and 11 deletions.
57 changes: 46 additions & 11 deletions htdocs/core/lib/pdf.lib.php
Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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'));
Expand Down Expand Up @@ -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
{
Expand All @@ -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 . '%';
}
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit d4b5256

Please sign in to comment.