Merge pull request #11170 from atm-greg/Fix_margin_calculation_on_display

fix useless calculation
This commit is contained in:
Laurent Destailleur 2019-05-13 20:20:01 +02:00 committed by GitHub
commit e2408fb54d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,7 +91,7 @@ class FormMargin
$line->pa_ht = $line->subprice * (1 - ($line->remise_percent / 100));
}
$pv = $line->qty * $line->subprice * (1 - $line->remise_percent / 100);
$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;