FIX inconsistency in margin recording with option "Force to sale price"

This commit is contained in:
Laurent Destailleur
2021-03-24 21:49:45 +01:00
parent debcef9b55
commit 21a9779fe2
9 changed files with 36 additions and 16 deletions

View File

@@ -7122,7 +7122,7 @@ abstract class CommonObject
$buyPrice = 0;
if (($unitPrice > 0) && (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1)) // In most cases, test here is false
if (($unitPrice > 0) && (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull > 0)) // In most cases, test here is false
{
$buyPrice = $unitPrice * (1 - $discountPercent / 100);
} else {