From 642e75c3dd29b03d7eaf71f21678f05d2f5521d1 Mon Sep 17 00:00:00 2001 From: quentin Date: Thu, 2 Jul 2020 11:34:59 +0200 Subject: [PATCH 1/2] FIX wrong origin --- htdocs/commande/class/commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 54506a4a816..c92de067c8e 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1014,7 +1014,7 @@ class Commande extends CommonOrder // Complete vat rate with code $vatrate = $line->tva_tx; if ($line->vat_src_code && !preg_match('/\(.*\)/', $vatrate)) $vatrate .= ' ('.$line->vat_src_code.')'; - + $origin = !empty($line->origin) ? $line->origin : $this->element; $result = $this->addline( $line->desc, $line->subprice, @@ -1039,7 +1039,7 @@ class Commande extends CommonOrder $line->label, $line->array_options, $line->fk_unit, - $this->element, + $origin, $line->id ); if ($result < 0) From 6c01cc16f8fc46667d55c5b5a7af619f48caa0a0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 3 Jul 2020 00:14:22 +0200 Subject: [PATCH 2/2] Update commande.class.php --- htdocs/commande/class/commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index c92de067c8e..e356a4d5936 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1014,7 +1014,7 @@ class Commande extends CommonOrder // Complete vat rate with code $vatrate = $line->tva_tx; if ($line->vat_src_code && !preg_match('/\(.*\)/', $vatrate)) $vatrate .= ' ('.$line->vat_src_code.')'; - $origin = !empty($line->origin) ? $line->origin : $this->element; + $origin = (!empty($line->origin) ? $line->origin : $this->element); $result = $this->addline( $line->desc, $line->subprice,