Skip to content

Commit

Permalink
Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Apr 27, 2024
2 parents 1c76738 + 4ed7702 commit aac93f6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion htdocs/barcode/printsheet.php
Expand Up @@ -314,7 +314,7 @@
$arrayoflabels[$codecards] = $labeltoshow;
}
asort($arrayoflabels);
print $form->selectarray('modellabel', $arrayoflabels, (GETPOST('modellabel') ? GETPOST('modellabel') : $conf->global->ADHERENT_ETIQUETTE_TYPE), 1, 0, 0, '', 0, 0, 0, '', '', 1);
print $form->selectarray('modellabel', $arrayoflabels, (GETPOST('modellabel') ? GETPOST('modellabel') : getDolGlobalString('ADHERENT_ETIQUETTE_TYPE')), 1, 0, 0, '', 0, 0, 0, '', '', 1);
print '</div></div>';

// Number of stickers to print
Expand Down
4 changes: 2 additions & 2 deletions htdocs/commande/card.php
Expand Up @@ -875,8 +875,8 @@
}
}

$tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx)) ?: 0;
$tmpprodvat = price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));
$tmpvat = (float) price2num(preg_replace('/\s*\(.*\)/', '', $tva_tx));
$tmpprodvat = (float) price2num(preg_replace('/\s*\(.*\)/', '', $prod->tva_tx));

// Set unit price to use
if (!empty($price_ht) || $price_ht === '0') {
Expand Down
16 changes: 7 additions & 9 deletions htdocs/core/lib/pdf.lib.php
Expand Up @@ -1351,17 +1351,15 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_
}
}
}
// Show page nb only on iso languages (so default Helvetica font)
$pdf->SetXY($dims['wk'] - $dims['rm'] - 18 - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_X', 0), -$posy - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_Y', 0));

if (getDolGlobalString('PDF_USE_GETALIASNBPAGE_FOR_TOTAL')) {
// $pagination = $pdf->getAliasNumPage().' / '.$pdf->getAliasNbPages(); // works with $pdf->Cell
$pagination = $pdf->PageNo().' / '.$pdf->getAliasNbPages(); // seems to not works with all fonts like ru_UK
} else {
$pagination = $pdf->PageNo().' / '.$pdf->getNumPages(); // seems to always work even with $pdf->Cell. But some users has reported wrong nb (no way to reproduce)
// Show page nb and apply correction for some font.
$pdf->SetXY($dims['wk'] - $dims['rm'] - 18 - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_X', 0), -$posy - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_Y', 0));
$pagination = $pdf->PageNo().' / '.$pdf->getAliasNbPages();
$fontRenderCorrection = 0;
if (in_array(pdf_getPDFFont($outputlangs), array('freemono', 'DejaVuSans'))) {
$fontRenderCorrection = 10;
}

$pdf->MultiCell(18, 2, $pagination, 0, 'R', 0);
$pdf->MultiCell(18 + $fontRenderCorrection, 2, $pagination, 0, 'R', 0);

// Show Draft Watermark
if (!empty($watermark)) {
Expand Down

0 comments on commit aac93f6

Please sign in to comment.