Merge pull request #12738 from mapiolca/patch-16

#FIX Error Margin with Situation Invoice
This commit is contained in:
Laurent Destailleur 2019-12-23 13:43:18 +01:00 committed by GitHub
commit 93cece6a3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,7 +98,11 @@ class FormMargin
$pv = $line->total_ht;
$pa_ht = ($pv < 0 ? - $line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
$pa = $line->qty * $pa_ht;
if ($object->type == Facture::TYPE_SITUATION) {
$pa = $line->qty * $pa_ht * ($line->situation_percent / 100);
} else {
$pa = $line->qty * $pa_ht;
}
// calcul des marges
if (isset($line->fk_remise_except) && isset($conf->global->MARGIN_METHODE_FOR_DISCOUNT)) { // remise