Laurent Destailleur 3 rokov pred
rodič
commit
0027335e3b

+ 2 - 6
htdocs/core/lib/pdf.lib.php

@@ -1418,10 +1418,6 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
 
 	// Description long of product line
 	if (!empty($desc) && ($desc != $label)) {
-		if ($libelleproduitservice && empty($hidedesc)) {
-			$libelleproduitservice .= '__N__';
-		}
-
 		if ($desc == '(CREDIT_NOTE)' && $object->lines[$i]->fk_remise_except) {
 			$discount = new DiscountAbsolute($db);
 			$discount->fetch($object->lines[$i]->fk_remise_except);
@@ -1547,7 +1543,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
 			// Adding the descriptions if they are filled
 			$desccateg = $cate->description;
 			if ($desccateg) {
-				$libelleproduitservice .= '__N__'.$desccateg;
+				$libelleproduitservice = dol_concatdesc($libelleproduitservice, $desccateg);
 			}
 		}
 	}
@@ -1572,7 +1568,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
 			}
 			$libelleproduitservice .= '<br><b style="color:#333666;" ><em>'.$period.'</em></b>';
 		} else {
-			$libelleproduitservice .= "__N__".$period;
+			$libelleproduitservice = dol_concatdesc($libelleproduitservice, $period);
 		}
 		//print $libelleproduitservice;
 	}

+ 2 - 2
test/phpunit/PdfDocTest.php

@@ -160,11 +160,11 @@ class PdfDocTest extends PHPUnit\Framework\TestCase
 
 		$result=pdf_getlinedesc($localobject, 0, $langs);
 		print __METHOD__." result=".$result."\n";
-		$this->assertEquals($result, "PINKDRESS - Label 1<br>This is a description with a &eacute; accent<br>(Country of origin: France)");
+		$this->assertEquals("PINKDRESS - Label 1<br>This is a description with a &eacute; accent<br>(Country of origin: France)", $result);
 
 		$result=doc_getlinedesc($localobject->lines[0], $langs);
 		print __METHOD__." result=".$result."\n";
-		$this->assertEquals($result, "PINKDRESS - Label 1\nThis is a description with a é accent\n(Country of origin: France)");
+		$this->assertEquals("PINKDRESS - Label 1\nThis is a description with a é accent\n(Country of origin: France)", $result);
 	}
 
 	/**