From b090af9ccaf50bc43b545d5f0f7df43a62bc3940 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Thu, 12 Jun 2014 15:43:40 +0200 Subject: [PATCH 1/6] FIX[ bug #1444 ] Shipment product batch is not proposed --- htdocs/expedition/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 1fd33b29c53..f203896f7b8 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -863,7 +863,7 @@ if ($action == 'create') if (($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) || $defaultqty < 0) $defaultqty=0; } - if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() and is_array($product->stock_warehouse[GETPOST('entrepot_id','int')]))) + if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() and is_object($product->stock_warehouse[GETPOST('entrepot_id','int')]))) { // Quantity to send print ''; From 3c3bc8b769911c1fe820f737aa0cb12ca363309b Mon Sep 17 00:00:00 2001 From: KreizIT Date: Thu, 12 Jun 2014 16:29:03 +0200 Subject: [PATCH 2/6] FIX [ bug #1308 ] Stock movements on a product with batch --- htdocs/expedition/class/expedition.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 5cf09642c68..b7a94bc28c4 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1128,6 +1128,10 @@ class Expedition extends CommonObject // Eat-by date if (! empty($conf->productbatch->enabled)) { + /* test on conf at begining of file sometimes doesn't include expeditionbatch + * May be conf is not well initialized for dark reason + */ + require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionbatch.class.php'; $line->detail_batch=ExpeditionLigneBatch::FetchAll($this->db,$obj->line_id); } $this->lines[$i] = $line; From 18080deb932b00e486b723e3c352a1fbd32d57e3 Mon Sep 17 00:00:00 2001 From: philippe Date: Fri, 13 Jun 2014 12:16:49 +0200 Subject: [PATCH 3/6] Fix num paiement was not displayed --- htdocs/fourn/paiement/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/paiement/fiche.php b/htdocs/fourn/paiement/fiche.php index 8b58e7a4455..9a38e16f7f4 100644 --- a/htdocs/fourn/paiement/fiche.php +++ b/htdocs/fourn/paiement/fiche.php @@ -103,7 +103,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->fournisse } } -if ($action == 'setnum' && ! empty($_POST['num_paiement'])) +if ($action == 'setnum_paiement' && ! empty($_POST['num_paiement'])) { $object->fetch($id); $res = $object->update_num($_POST['num_paiement']); From d0a417ad36b11600c191f4ef03d7dd01678e6b99 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 14 Jun 2014 11:37:57 +0200 Subject: [PATCH 4/6] Fix 1480, 1483, 1497 $this instead of $object --- htdocs/compta/facture.php | 2 +- htdocs/expedition/fiche.php | 2 +- htdocs/fourn/facture/fiche.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index da275ca37c1..b6837d68a98 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1607,7 +1607,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $result = $interface->run_triggers('BILL_SENTBYMAIL', $object, $user, $langs, $conf); if ($result < 0) { $error ++; - $this->errors = $interface->errors; + $object->errors = $interface->errors; } // Fin appel triggers diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 1fd33b29c53..dc5628ccc47 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -500,7 +500,7 @@ if ($action == 'send' && ! GETPOST('addfile','alpha') && ! GETPOST('removedfile' $interface=new Interfaces($db); $result=$interface->run_triggers('SHIPPING_SENTBYMAIL',$object,$user,$langs,$conf); if ($result < 0) { - $error++; $this->errors=$interface->errors; + $error++; $object->errors=$interface->errors; } // Fin appel triggers diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index e70d78d1ea6..92c8be3469c 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -911,7 +911,7 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P $interface=new Interfaces($db); $result=$interface->run_triggers('BILL_SUPPLIER_SENTBYMAIL',$object,$user,$langs,$conf); if ($result < 0) { - $error++; $this->errors=$interface->errors; + $error++; $object->errors=$interface->errors; } // Fin appel triggers From 1250804e817802c878eaa6da5c79f8ef54197ee0 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 14 Jun 2014 11:42:17 +0200 Subject: [PATCH 5/6] Fix 1490 $this instead of $object --- htdocs/fichinter/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 182fd0d1a36..7dae4a359ee 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -730,7 +730,7 @@ if ($action == 'send' && ! GETPOST('cancel','alpha') && (empty($conf->global->MA $interface=new Interfaces($db); $result=$interface->run_triggers('FICHINTER_SENTBYMAIL',$object,$user,$langs,$conf); if ($result < 0) { - $error++; $this->errors=$interface->errors; + $error++; $object->errors=$interface->errors; } // Fin appel triggers From bada082b2bcbb236cdddb40f767252a328e0f519 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 14 Jun 2014 12:02:07 +0200 Subject: [PATCH 6/6] Fix 1462, 1468 $this instead of $object --- htdocs/comm/propal.php | 2 +- htdocs/societe/soc.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index efed0298f52..a9ec591cf5f 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -473,7 +473,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G $result = $interface->run_triggers('PROPAL_SENTBYMAIL', $object, $user, $langs, $conf); if ($result < 0) { $error ++; - $this->errors = $interface->errors; + $object->errors = $interface->errors; } // Fin appel triggers diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index f2d2e64791d..b88642cd83d 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -432,12 +432,12 @@ if (empty($reshook)) $sql = "UPDATE ".MAIN_DB_PREFIX."adherent"; $sql.= " SET fk_soc = NULL WHERE fk_soc = " . $id; - dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); - if (! $this->db->query($sql)) + dol_syslog(get_class($object)."::delete sql=".$sql, LOG_DEBUG); + if (! $object->db->query($sql)) { $error++; - $this->error .= $this->db->lasterror(); - dol_syslog(get_class($this)."::delete erreur -1 ".$this->error, LOG_ERR); + $object->error .= $object->db->lasterror(); + dol_syslog(get_class($object)."::delete erreur -1 ".$object->error, LOG_ERR); } }