2
0
forked from Wavyzz/dolibarr

FIX: error 500 when getting margin info for objects other than invoices

This commit is contained in:
Marc de Lima Lucio
2019-12-24 16:09:29 +01:00
parent 07b40f043e
commit c8dfc3d9fc

View File

@@ -98,7 +98,7 @@ 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
if ($object->type == Facture::TYPE_SITUATION) {
if ($object->element == 'facture' && $object->type == Facture::TYPE_SITUATION) {
$pa = $line->qty * $pa_ht * ($line->situation_percent / 100);
} else {
$pa = $line->qty * $pa_ht;