Fix: UTF8 support in public notes

This commit is contained in:
Laurent Destailleur 2008-12-15 22:07:07 +00:00
parent fe3e466503
commit 1ebc1bdece
6 changed files with 41 additions and 14 deletions

View File

@ -203,13 +203,13 @@ class pdf_einstein extends ModelePDFCommandes
$tab_height_newpage = 180;
// Affiche notes
if ($com->note_public)
if (! empty($com->note_public))
{
$tab_top = 88;
$pdf->SetFont('Arial','', 9); // Dans boucle pour g<>rer multi-page
$pdf->SetXY ($this->posxdesc-1, $tab_top);
$pdf->MultiCell(190, 3, $com->note_public, 0, 'J');
$pdf->MultiCell(190, 3, $outputlangs->convToOutputCharset($com->note_public), 0, 'J');
$nexY = $pdf->GetY();
$height_note=$nexY-$tab_top;

View File

@ -206,13 +206,13 @@ class pdf_crabe extends ModelePDFFactures
$tab_height_newpage = 180;
// Affiche notes
if ($fac->note_public)
if (! empty($fac->note_public))
{
$tab_top = 88;
$pdf->SetFont('Arial','', 9); // Dans boucle pour gerer multi-page
$pdf->SetXY ($this->posxdesc-1, $tab_top);
$pdf->MultiCell(190, 3, $fac->note_public, 0, 'J');
$pdf->MultiCell(190, 3, $outputlangs->convToOutputCharset($fac->note_public), 0, 'J');
$nexY = $pdf->GetY();
$height_note=$nexY-$tab_top;

View File

@ -239,7 +239,7 @@ class pdf_huitre extends ModelePDFFactures
*
*/
if ( $fac->note_public)
if (! empty($fac->note_public))
{
$pdf->SetFont('Arial','',7);
$pdf->SetXY(10, 211);

View File

@ -206,7 +206,7 @@ class pdf_propale_azur extends ModelePDFPropales
$tab_height_middlepage = 190;
// Affiche notes
if ($propale->note_public)
if (! empty($propale->note_public))
{
$tab_top = 88;
@ -232,7 +232,7 @@ class pdf_propale_azur extends ModelePDFPropales
$curY = $tab_top + 8;
$nexY = $tab_top + 8;
// Boucle sur les lignes
// Loop on each lines
for ($i = 0 ; $i < $nblignes ; $i++)
{
$curY = $nexY;

View File

@ -84,7 +84,7 @@ class pdf_propale_jaune extends ModelePDFPropales
/**
* \brief Fonction g<EFBFBD>n<EFBFBD>rant la propale sur le disque
* \brief Fonction generant la propale sur le disque
* \param propale Objet propal
* \param outputlangs Lang object for output language
* \return int 1=ok, 0=ko
@ -117,7 +117,7 @@ class pdf_propale_jaune extends ModelePDFPropales
$ret=$propale->fetch($id);
}
// D<EFBFBD>finition de $dir et $file
// Definition de $dir et $file
if ($propale->specimen)
{
$dir = $conf->propal->dir_output;
@ -189,20 +189,47 @@ class pdf_propale_jaune extends ModelePDFPropales
$nexY = $pdf->GetY();
$nblignes = sizeof($propale->lignes);
// Loop on each lines
for ($i = 0 ; $i < $nblignes ; $i++)
{
$curY = $nexY;
// Description de la ligne produit
$libelleproduitservice=dol_htmlentitiesbr($propale->lignes[$i]->libelle,1);
if ($propale->lignes[$i]->desc && $propale->lignes[$i]->desc!=$propale->lignes[$i]->libelle)
{
if ($libelleproduitservice) $libelleproduitservice.="<br>";
if ($propale->lignes[$i]->desc == '(CREDIT_NOTE)' && $propale->lignes[$i]->fk_remise_except)
{
$discount=new DiscountAbsolute($this->db);
$discount->fetch($propale->lignes[$i]->fk_remise_except);
$libelleproduitservice=dol_htmlentitiesbr($langs->trans("DiscountFromCreditNote",$discount->ref_facture_source),1);
}
else
{
$libelleproduitservice.=dol_htmlentitiesbr($propale->lignes[$i]->desc,1);
}
}
if ($propale->lignes[$i]->date_start && $propale->lignes[$i]->date_end)
{
// Affichage durée si il y en a une
$libelleproduitservice.="<br>".dol_htmlentitiesbr("(".$outputlangs->transnoentities("From")." ".dolibarr_print_date($propale->lignes[$i]->date_start,'',false,$outputlangs)." ".$outputlangs->transnoentities("to")." ".dolibarr_print_date($propale->lignes[$i]->date_end,'',false,$outputlangs).")",1);
}
$pdf->SetXY (30, $curY );
$pdf->MultiCell(102, 5, $outputlangs->convToOutputCharset($propale->lignes[$i]->desc), 0, 'J', 0);
$pdf->MultiCell(102, 5, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 'J', 0);
$nexY = $pdf->GetY();
$ref=dol_htmlentitiesbr($propale->lignes[$i]->ref);
$pdf->SetXY (10, $curY );
$pdf->MultiCell(20, 5, $outputlangs->convToOutputCharset($propale->lignes[$i]->ref), 0, 'C', 0);
$pdf->MultiCell(20, 5, $outputlangs->convToOutputCharset($ref), 0, 'C', 0);
$pdf->SetXY (132, $curY );
$pdf->MultiCell(12, 5, $propale->lignes[$i]->tva_tx, 0, 'C', 0);
$pdf->MultiCell(12, 5, vatrate($propale->lignes[$i]->tva_tx,0,$propale->lignes[$i]->info_bits), 0, 'C', 0);
$pdf->SetXY (144, $curY );
$pdf->MultiCell(10, 5, $propale->lignes[$i]->qty, 0, 'C', 0);

View File

@ -207,13 +207,13 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$tab_height_newpage = 180;
// Affiche notes
if ($com->note_public)
if (! empty($com->note_public))
{
$tab_top = 88;
$pdf->SetFont('Arial','', 9); // Dans boucle pour g<>rer multi-page
$pdf->SetXY ($this->posxdesc-1, $tab_top);
$pdf->MultiCell(190, 3, $com->note_public, 0, 'J');
$pdf->MultiCell(190, 3, $outputlangs->convToOutputCharset($com->note_public), 0, 'J');
$nexY = $pdf->GetY();
$height_note=$nexY-$tab_top;