From 2147bd23e64da09d96fc2a44395aa4293a2ab427 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 2 Feb 2018 10:22:47 +0100 Subject: [PATCH 1/3] Fix: remove lines with special code when convert to reduc --- htdocs/compta/facture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index b5b200aa540..5fcd2d05aee 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -611,7 +611,7 @@ if (empty($reshook)) $i = 0; foreach ($object->lines as $line) { - if ($line->total_ht!=0) + if (empty($line->special_code) && $line->total_ht != 0) // Remove lines with special code { // no need to create discount if amount is null $amount_ht[$line->tva_tx] += $line->total_ht; $amount_tva[$line->tva_tx] += $line->total_tva; From a161ca37ffe23e530870f5fb83522910d075fff6 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 4 Feb 2018 08:58:31 +0100 Subject: [PATCH 2/3] Fix: use product_type instead special_code --- htdocs/compta/facture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 5fcd2d05aee..63b8f2a102b 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -611,7 +611,7 @@ if (empty($reshook)) $i = 0; foreach ($object->lines as $line) { - if (empty($line->special_code) && $line->total_ht != 0) // Remove lines with special code + if (empty($line->product_type >= 9) && $line->total_ht != 0) // Remove lines with product_type greater than or equal to 9 { // no need to create discount if amount is null $amount_ht[$line->tva_tx] += $line->total_ht; $amount_tva[$line->tva_tx] += $line->total_tva; From d5b7184c8d501e6d4e8b83afeed36027eed9a2c6 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 4 Feb 2018 09:04:15 +0100 Subject: [PATCH 3/3] Fix: wrong test --- htdocs/compta/facture.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 63b8f2a102b..39d603a6c5e 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -611,7 +611,7 @@ if (empty($reshook)) $i = 0; foreach ($object->lines as $line) { - if (empty($line->product_type >= 9) && $line->total_ht != 0) // Remove lines with product_type greater than or equal to 9 + if ($line->product_type < 9 && $line->total_ht != 0) // Remove lines with product_type greater than or equal to 9 { // no need to create discount if amount is null $amount_ht[$line->tva_tx] += $line->total_ht; $amount_tva[$line->tva_tx] += $line->total_tva;