FIX: invoice pdf: lines originating from deposits were not detailed anymore

This commit is contained in:
Marc de Lima Lucio 2022-02-22 17:42:11 +01:00
parent 959aa0ce59
commit 0e0dd1ec6c

View File

@ -1271,7 +1271,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
$textwasmodified = ($note == $prodser->note);
if (!empty($prodser->multilangs[$outputlangs->defaultlang]["note"]) && ($textwasmodified || $translatealsoifmodified)) $note = $prodser->multilangs[$outputlangs->defaultlang]["note"];
}
} elseif ($object->element == 'facture' || $object->element == 'facturefourn') {
} elseif (($object->element == 'facture' || $object->element == 'facturefourn') && preg_match('/^\(DEPOSIT\).+/', $desc)) { // We must not replace '(DEPOSIT)' when it is alone, it will be translated and detailed later
$desc = str_replace('(DEPOSIT)', $outputlangs->trans('Deposit'), $desc);
}