Merge pull request #11240 from ATM-Marc/FIX_8.0_crabe_situation_vat

FIX: crabe pdf: bad detailed VAT for situation invoices, in situations S2 and above
This commit is contained in:
Laurent Destailleur 2019-05-24 12:57:01 +02:00 committed by GitHub
commit 7a0c6859bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1211,24 +1211,6 @@ class pdf_crabe extends ModelePDFFactures
//}
// 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)
{
if ($tvakey != 0) // On affiche pas taux 0