forked from Wavyzz/dolibarr
Kit must show details on PDF.
This commit is contained in:
@@ -1253,7 +1253,9 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
|
||||
// If we want another language, and if label is same than default language (we did force it to a specific value), we can use translation.
|
||||
//var_dump($outputlangs->defaultlang.' - '.$langs->defaultlang.' - '.$label.' - '.$prodser->label);exit;
|
||||
$textwasmodified = ($label == $prodser->label);
|
||||
if (!empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && ($textwasmodified || $translatealsoifmodified)) $label = $prodser->multilangs[$outputlangs->defaultlang]["label"];
|
||||
if (!empty($prodser->multilangs[$outputlangs->defaultlang]["label"]) && ($textwasmodified || $translatealsoifmodified)) {
|
||||
$label = $prodser->multilangs[$outputlangs->defaultlang]["label"];
|
||||
}
|
||||
|
||||
// Set desc
|
||||
// Manage HTML entities description test because $prodser->description is store with htmlentities but $desc no
|
||||
@@ -1281,6 +1283,17 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
|
||||
$libelleproduitservice = '<b>'.$libelleproduitservice.'</b>';
|
||||
}
|
||||
|
||||
// Add ref of subproducts
|
||||
if (!empty($conf->global->SHOW_SUBPRODUCT_REF_IN_PDF)) {
|
||||
$prodser->get_sousproduits_arbo();
|
||||
if (!empty($prodser->sousprods) && is_array($prodser->sousprods) && count($prodser->sousprods)) {
|
||||
$tmparrayofsubproducts = reset($prodser->sousprods);
|
||||
foreach($tmparrayofsubproducts as $subprodval) {
|
||||
$libelleproduitservice .= "\n * ".$subprodval[5].(($subprodval[5] && $subprodval[3]) ? ' - ' : '').$subprodval[3].' ('.$subprodval[1].')';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Description long of product line
|
||||
if (!empty($desc) && ($desc != $label))
|
||||
{
|
||||
@@ -1314,12 +1327,16 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
|
||||
$discount->fetch($object->lines[$i]->fk_remise_except);
|
||||
$libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromExcessPaid", $discount->ref_invoice_supplier_source);
|
||||
} else {
|
||||
if ($idprod)
|
||||
{
|
||||
if (empty($hidedesc))
|
||||
{
|
||||
if (!empty($conf->global->MAIN_DOCUMENTS_DESCRIPTION_FIRST))
|
||||
{
|
||||
if ($idprod) {
|
||||
// Check if description must be output
|
||||
if (!empty($object->element)) {
|
||||
$tmpkey = 'MAIN_DOCUMENTS_HIDE_DESCRIPTION_FOR_'.strtoupper($object->element);
|
||||
if (!empty($conf->global->$tmpkey)) {
|
||||
$hidedesc = 1;
|
||||
}
|
||||
}
|
||||
if (empty($hidedesc)) {
|
||||
if (!empty($conf->global->MAIN_DOCUMENTS_DESCRIPTION_FIRST)) {
|
||||
$libelleproduitservice = $desc."\n".$libelleproduitservice;
|
||||
} else {
|
||||
if (!empty($conf->global->HIDE_LABEL_VARIANT_PDF) && $prodser->isVariant()) {
|
||||
|
||||
Reference in New Issue
Block a user