diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index b6fa0dd7122..8abac38d802 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -442,6 +442,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`; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index eaf4f0031eb..e3be3ac8361 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -612,12 +612,12 @@ else if ($action == 'addline' && $user->rights->propal->creer) { // On defini prix unitaire if (! empty($conf->global->PRODUIT_MULTIPRICES) && $object->client->price_level) { - $pu_ht = $prod->multiprices [$object->client->price_level]; - $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]; + $pu_ht = $prod->multiprices[$object->client->price_level]; + $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]; + if (isset($prod->multiprices_tva_tx[$object->client->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->client->price_level]; + if (isset($prod->multiprices_recuperableonly[$object->client->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level]; } elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index e854c278ec3..363776c7e6f 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-214 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 @@ -797,7 +797,10 @@ 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 ); if ($result < 0) @@ -932,6 +935,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); @@ -1072,7 +1079,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 e1739457849..a6659ee8bb3 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 @@ -725,7 +725,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) { @@ -863,6 +864,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/commande/fiche.php b/htdocs/commande/fiche.php index 25c8d068ae1..e0950bdccc7 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -588,8 +588,8 @@ 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]; + if (isset($prod->multiprices_tva_tx[$object->client->price_level])) $tva_tx=$prod->multiprices_tva_tx[$object->client->price_level]; + if (isset($prod->multiprices_recuperableonly[$object->client->price_level])) $tva_npr=$prod->multiprices_recuperableonly[$object->client->price_level]; } elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 7de3e878545..02356e94b52 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1152,8 +1152,6 @@ else if ($action == 'addline' && $user->rights->facture->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]; } elseif (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 096fee84d6a..6e4fbc03c66 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 @@ -391,7 +391,7 @@ class Facture extends CommonInvoice $this->lines[$i]->fk_fournprice, $this->lines[$i]->pa_ht, $this->lines[$i]->label, - '' + $this->lines[$i]->array_options ); if ($result < 0) { @@ -593,6 +593,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); @@ -1564,11 +1568,11 @@ class Facture extends CommonInvoice $interface=new Interfaces($this->db); $result=$interface->run_triggers('BILL_CANCEL',$this,$user,$langs,$conf); if ($result < 0) { - $error++; + $error++; $this->errors=$interface->errors; $this->db->rollback(); return -1; - + } // Fin appel triggers @@ -3574,7 +3578,7 @@ class FactureLigne extends CommonInvoiceLine include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; $interface=new Interfaces($this->db); $result = $interface->run_triggers('LINEBILL_INSERT',$this,$user,$langs,$conf); - if ($result < 0) + if ($result < 0) { $error++; $this->errors=$interface->errors;