2
0
forked from Wavyzz/dolibarr

NEW: [ task #977 ] New option to manage product unit

Migrated code from GPCSolutions/dolibarr:3.2-units branch and adapted for 3.8 with some improvements
This commit is contained in:
Marcos García de La Fuente
2015-02-26 14:15:33 +01:00
parent a67d0f712c
commit b4c84fac9d
44 changed files with 931 additions and 92 deletions

View File

@@ -1420,6 +1420,43 @@ function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0)
}
}
/**
* Return line unit
*
* @param Object $object Object
* @param int $i Current line number
* @param Translate $outputlangs Object langs for output
* @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
* @param HookManager $hookmanager Hook manager instance
* @return void
*/
function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = false)
{
global $langs;
if ($object->lines[$i]->special_code != 3) {
if (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);
}
$parameters = array(
'i' => $i,
'outputlangs' => $outputlangs,
'hidedetails' => $hidedetails,
'special_code' => $special_code
);
$action = '';
return $hookmanager->executeHooks('pdf_getlineunit', $parameters, $object,
$action); // Note that $action and $object may have been modified by some hooks
} else {
if (empty($hidedetails) || $hidedetails > 1) {
return $langs->transnoentitiesnoconv($object->lines[$i]->get_unit_label('short'));
}
}
}
}
/**
* Return line remise percent
*