$this->pdf->SetXY(170, $y);\r
$ligne['montant'] = trim($ligne['montant']);\r
if (is_numeric($ligne['montant'])) {\r
- $this->pdf->Cell(33, 4, cubePrices::formatAmount($ligne['montant'], $this->client->lang) .' '. $this->euro, 0, 0, 'R');\r
+ $this->pdf->Cell(33, 4, cubePrices::formatAmount($ligne['montant'], $this->client->lang) . ' ' . $this->euro, 0, 0, 'R');\r
} else {\r
$this->pdf->Cell(33, 4, self::escape($ligne['montant']), 0, 0, 'R');\r
}\r
$this->pdf->SetXY(170, 218);\r
$space = 9.7;\r
}\r
- $this->pdf->Cell(32, $space, cubePrices::formatAmount($this->total_ht, $this->client->lang) .' '. $this->euro, 0, 1, 'R');\r
+ $this->pdf->Cell(32, $space, cubePrices::formatAmount($this->total_ht, $this->client->lang) . ' ' . $this->euro, 0, 1, 'R');\r
$this->pdf->SetX(170);\r
$this->pdf->setFont('KlavikaLight', '', 10);\r
// Affichage du taux de tva et du montant des taxes\r
$this->pdf->Cell(32, $space, $tva_text, 0, 1, 'R');\r
$this->pdf->SetX(170);\r
if ($tva) {\r
- $this->pdf->Cell(32, $space, $taxes . ' '.$this->euro, 0, 1, 'R');\r
+ $this->pdf->Cell(32, $space, $taxes . ' ' . $this->euro, 0, 1, 'R');\r
} else {\r
$this->pdf->Cell(32, $space, '-', 0, 1, 'R');\r
}\r
\r
$this->pdf->SetTextColor(255, 255, 255);\r
$this->pdf->setFont('KlavikaLight', 'B', 10);\r
- $this->pdf->Cell(32, $space + 1, $ttcf .' '. $this->euro, 0, 1, 'R');\r
+ $this->pdf->Cell(32, $space + 1, $ttcf . ' ' . $this->euro, 0, 1, 'R');\r
\r
if (isset($notes)) {\r
$this->pdf->setXY(8, 268);\r
$pdf->SetXY(170, $y);\r
$ligne['montant'] = trim($ligne['montant']);\r
if (is_numeric($ligne['montant'])) {\r
- $pdf->Cell(33, 4, cubePrices::formatAmount($ligne['montant'], $this->client->lang) .' '. $this->euro, 0, 0, 'R');\r
+ $pdf->Cell(33, 4, cubePrices::formatAmount($ligne['montant'], $this->client->lang) . ' ' . $this->euro, 0, 0, 'R');\r
} else {\r
$pdf->Cell(33, 4, self::escape($ligne['montant']), 0, 0, 'R');\r
}\r
$pages = 2 + ceil(($h - 355) / 245);\r
}\r
\r
+ $lasty = 0;\r
$nb_lines = count($lines);\r
if ($pages > 1) {\r
$i = 0;\r
}\r
for (; $i <= $nb_lines; $i++) {\r
$y += $lines[$i];\r
- if ($y > $limit) {\r
+ if (($y - $lasty) > $limit) {\r
$cesures[$page] = $i;\r
$y = $lines[$i];\r
+ $lasty = $y;\r
continue 2;\r
}\r
- }\r
-\r
- if ($i >= $nb_lines) {\r
- break;\r
+ if ($i >= $nb_lines) {\r
+ break;\r
+ }\r
}\r
}\r
}\r
\r
\r
$res = array('pages' => $pages, 'cesures' => $cesures);\r
- fb($res);\r
+\r
return $res;\r
}\r
\r
protected function escape($str) {\r
$str = cubeText::removeOddStuff($str);\r
- $str= utf8_decode($str);\r
+ $str = utf8_decode($str);\r
$str = str_replace(utf8_decode('€'), $this->euro, $str);\r
return $str;\r
}\r