From d1868b643ea842200237bb7f9a84e200fe4344ed Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 24 Sep 2014 11:47:34 +0200 Subject: [PATCH 1/4] FIX: clone line extrafields value on quote, order and invoice --- htdocs/comm/propal/class/propal.class.php | 11 +++++++++-- htdocs/commande/class/commande.class.php | 9 +++++++-- htdocs/compta/facture/class/facture.class.php | 9 +++++++-- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 1c2fe54cc71..2c507e3e59d 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2008 Raphael Bertrand * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2010-2011 Philippe Grand - * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012-2014 Christophe Battarel * Copyright (C) 2013 Florian Henry * * This program is free software; you can redistribute it and/or modify @@ -788,6 +788,9 @@ class Propal extends CommonObject $this->lines[$i]->fk_fournprice, $this->lines[$i]->pa_ht, $this->lines[$i]->label + $this->lines[$i]->date_start, + $this->lines[$i]->date_end, + $this->lines[$i]->array_options ); if ($result < 0) @@ -922,6 +925,10 @@ class Propal extends CommonObject $this->db->begin(); + // get extrafields so they will be clone + foreach($this->lines as $line) + $line->fetch_optionals($line->rowid); + // Load source object $objFrom = dol_clone($this); @@ -1046,7 +1053,7 @@ class Propal extends CommonObject $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_input_reason as dr ON p.fk_input_reason = dr.rowid'; $sql.= " WHERE p.fk_statut = c.id"; $sql.= " AND p.entity = ".$conf->entity; - if ($ref) $sql.= " AND p.ref='".$this->db->escape($ref)."'"; + if ($ref) $sql.= " AND p.ref='".$ref."'"; else $sql.= " AND p.rowid=".$rowid; dol_syslog(get_class($this)."::fetch sql=".$sql, LOG_DEBUG); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 795c2e26526..7a8fd63c8f1 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2011 Jean Heimburger - * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012-2014 Christophe Battarel * Copyright (C) 2013 Florian Henry * * This program is free software; you can redistribute it and/or modify @@ -712,7 +712,8 @@ class Commande extends CommonOrder $fk_parent_line, $this->lines[$i]->fk_fournprice, $this->lines[$i]->pa_ht, - $this->lines[$i]->label + $this->lines[$i]->label, + $this->lines[$i]->array_options ); if ($result < 0) { @@ -850,6 +851,10 @@ class Commande extends CommonOrder $this->db->begin(); + // get extrafields so they will be clone + foreach($this->lines as $line) + $line->fetch_optionals($line->rowid); + // Load source object $objFrom = dol_clone($this); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index e9bf109b9e7..93e245746a0 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2010-2013 Juanjo Menent - * Copyright (C) 2012 Christophe Battarel + * Copyright (C) 2012-2014 Christophe Battarel * Copyright (C) 2012 Marcos GarcĂ­a * Copyright (C) 2013 Cedric Gross * Copyright (C) 2013 Florian Henry @@ -367,7 +367,8 @@ class Facture extends CommonInvoice $fk_parent_line, $this->lines[$i]->fk_fournprice, $this->lines[$i]->pa_ht, - $this->lines[$i]->label + $this->lines[$i]->label, + $this->lines[$i]->array_options ); if ($result < 0) { @@ -569,6 +570,10 @@ class Facture extends CommonInvoice $this->db->begin(); + // get extrafields so they will be clone + foreach($this->lines as $line) + $line->fetch_optionals($line->rowid); + // Load source object $objFrom = dol_clone($this); From 2c52de3840c520965839d43a8307074255b23304 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 24 Sep 2014 12:12:10 +0200 Subject: [PATCH 2/4] fix missing "," --- htdocs/comm/propal/class/propal.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 2c507e3e59d..507a9dce633 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -787,7 +787,7 @@ class Propal extends CommonObject $fk_parent_line, $this->lines[$i]->fk_fournprice, $this->lines[$i]->pa_ht, - $this->lines[$i]->label + $this->lines[$i]->label, $this->lines[$i]->date_start, $this->lines[$i]->date_end, $this->lines[$i]->array_options From 920c9c725104b58ca3375ff7bf436042aa04f976 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 30 Sep 2014 17:36:01 +0200 Subject: [PATCH 3/4] Fix : tva not coming from multiprice --- htdocs/comm/propal.php | 2 -- htdocs/commande/fiche.php | 2 -- htdocs/compta/facture.php | 2 -- 3 files changed, 6 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index cece1b3b29e..beaa24be32e 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -738,8 +738,6 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- $pu_ttc = $prod->multiprices_ttc[$object->client->price_level]; $price_min = $prod->multiprices_min[$object->client->price_level]; $price_base_type = $prod->multiprices_base_type[$object->client->price_level]; - $tva_tx=$prod->multiprices_tva_tx[$object->client->price_level]; - $tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level]; } else { diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 99864a59dd2..9af80af21e1 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -686,8 +686,6 @@ else if ($action == 'addline' && $user->rights->commande->creer) $pu_ttc = $prod->multiprices_ttc[$object->client->price_level]; $price_min = $prod->multiprices_min[$object->client->price_level]; $price_base_type = $prod->multiprices_base_type[$object->client->price_level]; - $tva_tx=$prod->multiprices_tva_tx[$object->client->price_level]; - $tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level]; } else { diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index b17b59cf704..11a920877cd 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1262,8 +1262,6 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- $pu_ttc = $prod->multiprices_ttc[$object->client->price_level]; $price_min = $prod->multiprices_min[$object->client->price_level]; $price_base_type = $prod->multiprices_base_type[$object->client->price_level]; - //$tva_tx=$prod->multiprices_tva_tx[$object->client->price_level]; - //$tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level]; } else { From 05fe8e45b3ead4dd32b75e2c280b8be4c21356ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 3 Oct 2014 19:07:49 +0200 Subject: [PATCH 4/4] Exclude module dire from package --- build/makepack-dolibarr.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 55de5abffb4..a1e08361d36 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -434,6 +434,7 @@ if ($nboftargetok) { $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/nltechno*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/pos*`; $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`; + $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/teclib*`; $ret=`rm -fr $BUILDROOT/$PROJECT/test`; $ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`; $ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;