Merge pull request #18383 from marc-dll/12.0_FIX_invoice_tiny_negative_vat

FIX: invoice validation: when checking if any VAT rate has a negative amount, prevent false positives with -1.0E-14 amounts
This commit is contained in:
Laurent Destailleur 2021-08-17 18:24:33 +02:00 committed by GitHub
commit 16c290f735
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -318,8 +318,8 @@ if (empty($reshook))
//var_dump($array_of_total_ht_per_vat_rate);exit;
foreach ($array_of_total_ht_per_vat_rate as $vatrate => $tmpvalue)
{
$tmp_total_ht = $array_of_total_ht_per_vat_rate[$vatrate];
$tmp_total_ht_devise = $array_of_total_ht_devise_per_vat_rate[$vatrate];
$tmp_total_ht = price2num($array_of_total_ht_per_vat_rate[$vatrate]);
$tmp_total_ht_devise = price2num($array_of_total_ht_devise_per_vat_rate[$vatrate]);
if (($tmp_total_ht < 0 || $tmp_total_ht_devise < 0) && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
{