From 38d735341c47861c14aaae19778c02236132aef9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 2 Feb 2018 10:24:16 +0100 Subject: [PATCH 1/6] Fix: remove lines with special code when convert to reduc --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index e6c30abda2d..3a1ee89b366 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -636,7 +636,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 c1e6d884422187bd589eb8baa7f56740a0b2ff71 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 4 Feb 2018 08:55:51 +0100 Subject: [PATCH 2/6] Fix: use product_type instead special_code --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 3a1ee89b366..fe061cb2e3b 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -636,7 +636,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 8ee1186492b5db56c2a11045af26568c1a4d1ff5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 4 Feb 2018 09:05:35 +0100 Subject: [PATCH 3/6] Fix: wrong test --- htdocs/compta/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index fe061cb2e3b..4d9486af815 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -636,7 +636,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; From fd8f89c70839a750e3e30d4cbe525c6de36f01cd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Feb 2018 11:13:47 +0100 Subject: [PATCH 4/6] FIX a discount is a percent, not an amount, so we use vatrate not price --- htdocs/core/lib/functions2.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 54bf70981b7..73c0e8c74a7 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1471,7 +1471,7 @@ function dol_print_reduction($reduction,$langs) } else { - $string = price($reduction).'%'; + $string = vatrate($reduction,true); } return $string; From f3700b66c699adc7933d0c04923f0a47e34d1306 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Feb 2018 11:17:45 +0100 Subject: [PATCH 5/6] Fix size of columns when using PRODUCT_USE_UNIT --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 8 ++++---- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 8 ++++---- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index abc4688ef5c..7e9535fb48c 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -133,10 +133,10 @@ class pdf_einstein extends ModelePDFCommandes $this->posxdesc=$this->marge_gauche+1; if($conf->global->PRODUCT_USE_UNITS) { - $this->posxtva=99; - $this->posxup=114; - $this->posxqty=130; - $this->posxunit=147; + $this->posxtva=101; + $this->posxup=118; + $this->posxqty=135; + $this->posxunit=151; } else { diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index bfecd773b27..d4872b000de 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -118,10 +118,10 @@ class pdf_crabe extends ModelePDFFactures $this->posxdesc=$this->marge_gauche+1; if($conf->global->PRODUCT_USE_UNITS) { - $this->posxtva=99; - $this->posxup=114; - $this->posxqty=130; - $this->posxunit=147; + $this->posxtva=101; + $this->posxup=118; + $this->posxqty=135; + $this->posxunit=151; } else { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 41e76ddbf3d..604940b017e 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -107,10 +107,10 @@ class pdf_azur extends ModelePDFPropales $this->posxdesc=$this->marge_gauche+1; if($conf->global->PRODUCT_USE_UNITS) { - $this->posxtva=99; - $this->posxup=114; - $this->posxqty=130; - $this->posxunit=147; + $this->posxtva=101; + $this->posxup=118; + $this->posxqty=135; + $this->posxunit=151; } else { From dbe45d03d3ae570d9db36edc212ccf23e130443a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Feb 2018 23:12:19 +0100 Subject: [PATCH 6/6] Fix: amount into form must be numeric without format --- htdocs/projet/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 849ea5cd47d..fab93ff1634 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -783,14 +783,14 @@ elseif ($object->id > 0) // Opportunity probability print ''.$langs->trans("OpportunityProbability").''; - print ' %'; + print ' %'; print ''; print ''; print ''; // Opportunity amount print ''.$langs->trans("OpportunityAmount").''; - print ''; + print ''; print ''; }