Removed function pdf_getTotalQty (duplicate with pdf_getlineqty)

This commit is contained in:
Laurent Destailleur
2021-11-07 12:26:44 +01:00
parent dd2207d6c5
commit 713db0e613

View File

@@ -2214,48 +2214,6 @@ function pdf_getlinetotalwithtax($object, $i, $outputlangs, $hidedetails = 0)
return $result;
}
/**
* Return total quantity of products and/or services
*
* @param Object $object Object
* @param string $type Type
* @param Translate $outputlangs Object langs for output
* @return integer
* @deprecated Not used by Dolibarr core, so will be removed.
*/
function pdf_getTotalQty($object, $type, $outputlangs)
{
global $hookmanager;
$total = 0;
$nblines = count($object->lines);
// Loop on each lines
for ($i = 0; $i < $nblines; $i++) {
if ($object->lines[$i]->special_code != 3) {
if ($type == 'all') {
$total += $object->lines[$i]->qty;
} elseif ($type == 9 && is_object($hookmanager) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || !empty($object->lines[$i]->fk_parent_line))) {
$special_code = $object->lines[$i]->special_code;
if (!empty($object->lines[$i]->fk_parent_line)) {
$special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
}
$hidedetails = '';
$parameters = array('i'=>$i, 'outputlangs'=>$outputlangs, 'hidedetails'=>$hidedetails, 'special_code'=>$special_code);
$action = '';
$reshook = $hookmanager->executeHooks('pdf_getTotalQty', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
return $hookmanager->resPrint;
} elseif ($type == 0 && $object->lines[$i]->product_type == 0) {
$total += $object->lines[$i]->qty;
} elseif ($type == 1 && $object->lines[$i]->product_type == 1) {
$total += $object->lines[$i]->qty;
}
}
}
return $total;
}
/**
* Return linked objects to use for document generation.
* Warning: To save space, this function returns only one link per link type (all links are concated on same record string). This function is used by pdf_writeLinkedObjects