forked from Wavyzz/dolibarr
Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0
This commit is contained in:
@@ -1485,6 +1485,8 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
|
||||
$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';
|
||||
$prodser = new ProductFournisseur($db);
|
||||
@@ -1497,11 +1499,55 @@ 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)) {
|
||||
$translatealsoifmodified = (getDolGlobalString('MAIN_MULTILANG_TRANSLATE_EVEN_IF_MODIFIED')); // By default if value was modified manually, we keep it (no translation because we don't have it)
|
||||
if ($multilangsactive && ($outputlangs->defaultlang != $langs->defaultlang)) {
|
||||
$translatealsoifmodified = getDolGlobalString('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
|
||||
// ($textwasnotmodified is replaced with $textwasmodifiedorcompleted and we add completion).
|
||||
|
||||
Reference in New Issue
Block a user