mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 00:53:00 +01:00
Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 18.0
This commit is contained in:
@@ -1425,12 +1425,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
|
||||
{
|
||||
global $db, $conf, $langs;
|
||||
|
||||
$idprod = (!empty($object->lines[$i]->fk_product) ? $object->lines[$i]->fk_product : false);
|
||||
$label = (!empty($object->lines[$i]->label) ? $object->lines[$i]->label : (!empty($object->lines[$i]->product_label) ? $object->lines[$i]->product_label : ''));
|
||||
$desc = (!empty($object->lines[$i]->desc) ? $object->lines[$i]->desc : (!empty($object->lines[$i]->description) ? $object->lines[$i]->description : ''));
|
||||
$ref_supplier = (!empty($object->lines[$i]->ref_supplier) ? $object->lines[$i]->ref_supplier : (!empty($object->lines[$i]->ref_fourn) ? $object->lines[$i]->ref_fourn : '')); // TODO Not yet saved for supplier invoices, only supplier orders
|
||||
$note = (!empty($object->lines[$i]->note) ? $object->lines[$i]->note : '');
|
||||
$dbatch = (!empty($object->lines[$i]->detail_batch) ? $object->lines[$i]->detail_batch : false);
|
||||
$multilangsactive = getDolGlobalInt('MAIN_MULTILANGS');
|
||||
|
||||
if ($issupplierline) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
@@ -1444,10 +1439,54 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
|
||||
}
|
||||
}
|
||||
|
||||
//id
|
||||
$idprod = (!empty($object->lines[$i]->fk_product) ? $object->lines[$i]->fk_product : false);
|
||||
if ($idprod) {
|
||||
$prodser->fetch($idprod);
|
||||
//load multilangs
|
||||
if ($multilangsactive) {
|
||||
$prodser->getMultiLangs();
|
||||
$object->lines[$i]->multilangs = $prodser->multilangs;
|
||||
}
|
||||
}
|
||||
//label
|
||||
if (!empty($object->lines[$i]->label)) {
|
||||
$label = $object->lines[$i]->label;
|
||||
} else {
|
||||
if (!empty($object->lines[$i]->multilangs[$outputlangs->defaultlang]['label']) && $multilangsactive) {
|
||||
$label = $object->lines[$i]->multilangs[$outputlangs->defaultlang]['label'];
|
||||
} else {
|
||||
if (!empty($object->lines[$i]->product_label)) {
|
||||
$label = $object->lines[$i]->product_label;
|
||||
} else {
|
||||
$label = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
//description
|
||||
if (!empty($object->lines[$i]->desc)) {
|
||||
$desc = $object->lines[$i]->desc;
|
||||
} else {
|
||||
if (!empty($object->lines[$i]->multilangs[$outputlangs->defaultlang]['description']) && $multilangsactive) {
|
||||
$desc = $object->lines[$i]->multilangs[$outputlangs->defaultlang]['description'];
|
||||
} else {
|
||||
if (!empty($object->lines[$i]->description)) {
|
||||
$desc = $object->lines[$i]->description;
|
||||
} else {
|
||||
$desc = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
//ref supplier
|
||||
$ref_supplier = (!empty($object->lines[$i]->ref_supplier) ? $object->lines[$i]->ref_supplier : (!empty($object->lines[$i]->ref_fourn) ? $object->lines[$i]->ref_fourn : '')); // TODO Not yet saved for supplier invoices, only supplier orders
|
||||
//note
|
||||
$note = (!empty($object->lines[$i]->note) ? $object->lines[$i]->note : '');
|
||||
//dbatch
|
||||
$dbatch = (!empty($object->lines[$i]->detail_batch) ? $object->lines[$i]->detail_batch : false);
|
||||
|
||||
if ($idprod) {
|
||||
// If a predefined product and multilang and on other lang, we renamed label with label translated
|
||||
if (getDolGlobalInt('MAIN_MULTILANGS') && ($outputlangs->defaultlang != $langs->defaultlang)) {
|
||||
if ($multilangsactive && ($outputlangs->defaultlang != $langs->defaultlang)) {
|
||||
$translatealsoifmodified = (!empty($conf->global->MAIN_MULTILANG_TRANSLATE_EVEN_IF_MODIFIED)); // By default if value was modified manually, we keep it (no translation because we don't have it)
|
||||
|
||||
// TODO Instead of making a compare to see if param was modified, check that content contains reference translation. If yes, add the added part to the new translation
|
||||
|
||||
Reference in New Issue
Block a user