FIX invoice situation VAT total rounding into PDF crabe
This commit is contained in:
parent
480587c826
commit
3d18c71201
@ -1120,7 +1120,26 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
|
|
||||||
//}
|
//}
|
||||||
|
|
||||||
// VAT
|
// VAT
|
||||||
|
// Situations totals migth be wrong on huge amounts
|
||||||
|
if ($object->situation_cycle_ref && $object->situation_counter > 1) {
|
||||||
|
|
||||||
|
$sum_pdf_tva = 0;
|
||||||
|
foreach($this->tva as $tvakey => $tvaval){
|
||||||
|
$sum_pdf_tva+=$tvaval; // sum VAT amounts to compare to object
|
||||||
|
}
|
||||||
|
|
||||||
|
if($sum_pdf_tva!=$object->total_tva) { // apply coef to recover the VAT object amount (the good one)
|
||||||
|
$coef_fix_tva = $object->total_tva / $sum_pdf_tva;
|
||||||
|
|
||||||
|
foreach($this->tva as $tvakey => $tvaval) {
|
||||||
|
$this->tva[$tvakey]=$tvaval * $coef_fix_tva;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
foreach($this->tva as $tvakey => $tvaval)
|
foreach($this->tva as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey != 0) // On affiche pas taux 0
|
if ($tvakey != 0) // On affiche pas taux 0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user