Merge pull request #20026 from cfoellmann/PR/fix-vat-double
fix vat double in commande PDF
This commit is contained in:
commit
3c49dddc02
@ -1216,35 +1216,6 @@ class pdf_eratosthene extends ModelePDFCommandes
|
||||
}
|
||||
//}
|
||||
|
||||
// VAT
|
||||
foreach ($this->tva_array as $tvakey => $tvaval) {
|
||||
if ($tvakey != 0) { // On affiche pas taux 0
|
||||
$this->atleastoneratenotnull++;
|
||||
|
||||
$index++;
|
||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||
|
||||
$tvacompl = '';
|
||||
if (preg_match('/\*/', $tvakey)) {
|
||||
$tvakey = str_replace('*', '', $tvakey);
|
||||
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
|
||||
}
|
||||
$totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalVAT", $mysoc->country_code) : '');
|
||||
$totalvat .= ' ';
|
||||
if (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'rateonly') {
|
||||
$totalvat .= vatrate($tvaval['vatrate'], 1).$tvacompl;
|
||||
} elseif (getDolGlobalString('PDF_VAT_LABEL_IS_CODE_OR_RATE') == 'codeonly') {
|
||||
$totalvat .= $tvaval['vatcode'].$tvacompl;
|
||||
} else {
|
||||
$totalvat .= vatrate($tvaval['vatrate'], 1).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl;
|
||||
}
|
||||
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1);
|
||||
|
||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||
$pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', 1);
|
||||
}
|
||||
}
|
||||
|
||||
// VAT
|
||||
foreach ($this->tva_array as $tvakey => $tvaval) {
|
||||
if ($tvakey != 0) { // On affiche pas taux 0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user