From 144b2dd622f45543fdc650d46f3fd392bff69370 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Fri, 26 Feb 2016 10:28:43 +0000 Subject: [PATCH] #extranet : fix euro symbol in titles and descriptions @0:10 --- .../Metier/class.extranet.document.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/inc/extranet/Metier/class.extranet.document.php b/inc/extranet/Metier/class.extranet.document.php index eb93d5d71..5e7648d86 100644 --- a/inc/extranet/Metier/class.extranet.document.php +++ b/inc/extranet/Metier/class.extranet.document.php @@ -34,7 +34,7 @@ abstract class extranetDocument extends cubeMetier { $template = ROOT . '/images/extranet/docs/'; - $this->euro = ' ' . chr(128); + $this->euro = chr(128); $this->pdf = new FPDI(); $this->pdf->SetAutoPageBreak(false); @@ -130,7 +130,7 @@ abstract class extranetDocument extends cubeMetier { $this->pdf->SetXY(170, $y); $ligne['montant'] = trim($ligne['montant']); if (is_numeric($ligne['montant'])) { - $this->pdf->Cell(33, 4, cubePrices::formatAmount($ligne['montant'], $this->client->lang) . $this->euro, 0, 0, 'R'); + $this->pdf->Cell(33, 4, cubePrices::formatAmount($ligne['montant'], $this->client->lang) .' '. $this->euro, 0, 0, 'R'); } else { $this->pdf->Cell(33, 4, self::escape($ligne['montant']), 0, 0, 'R'); } @@ -169,14 +169,14 @@ abstract class extranetDocument extends cubeMetier { $this->pdf->SetXY(170, 218); $space = 9.7; } - $this->pdf->Cell(32, $space, cubePrices::formatAmount($this->total_ht, $this->client->lang) . $this->euro, 0, 1, 'R'); + $this->pdf->Cell(32, $space, cubePrices::formatAmount($this->total_ht, $this->client->lang) .' '. $this->euro, 0, 1, 'R'); $this->pdf->SetX(170); $this->pdf->setFont('KlavikaLight', '', 10); // Affichage du taux de tva et du montant des taxes $this->pdf->Cell(32, $space, $tva_text, 0, 1, 'R'); $this->pdf->SetX(170); if ($tva) { - $this->pdf->Cell(32, $space, $taxes . $this->euro, 0, 1, 'R'); + $this->pdf->Cell(32, $space, $taxes . ' '.$this->euro, 0, 1, 'R'); } else { $this->pdf->Cell(32, $space, '-', 0, 1, 'R'); } @@ -184,7 +184,7 @@ abstract class extranetDocument extends cubeMetier { $this->pdf->SetTextColor(255, 255, 255); $this->pdf->setFont('KlavikaLight', 'B', 10); - $this->pdf->Cell(32, $space + 1, $ttcf . $this->euro, 0, 1, 'R'); + $this->pdf->Cell(32, $space + 1, $ttcf .' '. $this->euro, 0, 1, 'R'); if (isset($notes)) { $this->pdf->setXY(8, 268); @@ -221,7 +221,7 @@ abstract class extranetDocument extends cubeMetier { $pdf->SetXY(170, $y); $ligne['montant'] = trim($ligne['montant']); if (is_numeric($ligne['montant'])) { - $pdf->Cell(33, 4, cubePrices::formatAmount($ligne['montant'], $this->client->lang) . $this->euro, 0, 0, 'R'); + $pdf->Cell(33, 4, cubePrices::formatAmount($ligne['montant'], $this->client->lang) .' '. $this->euro, 0, 0, 'R'); } else { $pdf->Cell(33, 4, self::escape($ligne['montant']), 0, 0, 'R'); } @@ -275,7 +275,7 @@ abstract class extranetDocument extends cubeMetier { } } - $pages=max(count($cesures),$pages); + $pages = max(count($cesures), $pages); if (!isset($cesures[$pages - 1])) { $cesures[$pages - 1] = $nb_lines - 1; @@ -289,7 +289,9 @@ abstract class extranetDocument extends cubeMetier { protected function escape($str) { $str = cubeText::removeOddStuff($str); - return utf8_decode($str); + $str= utf8_decode($str); + $str = str_replace(utf8_decode('€'), $this->euro, $str); + return $str; } abstract protected function documentTitre(); -- 2.39.5