mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 00:53:00 +01:00
Removed function pdf_getTotalQty (duplicate with pdf_getlineqty)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user