From e7cfb719b994c1daf5400c3361790d4d7d4f0d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Jun 2014 12:05:31 +0200 Subject: [PATCH 01/41] [ bug #1432 ] Trigger SHIPPING_CREATE ignores interception on error --- ChangeLog | 1 + htdocs/expedition/class/expedition.class.php | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c3a10ce31ae..774b53ac280 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ Fix: [ bug #1416 ] Supplier order does not list document models in the select bo supplier order card Fix: [ bug #1443 ] Payment conditions is erased after editing supplier invoice label or limit date for payment +Fix: [ bug #1432 ] Trigger SHIPPING_CREATE ignores interception on error ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** Fix: Error on field accountancy code for export profile of invoices. diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 3f41cdbc07b..e5dbb540b85 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -272,8 +272,22 @@ class Expedition extends CommonObject if ($result < 0) { $error++; $this->errors=$interface->errors; } // Fin appel triggers - $this->db->commit(); - return $this->id; + if (! $error) + { + $this->db->commit(); + return $this->id; + } + else + { + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } + } else { From 0c1ba58a00f96d952214cc37b048d0954c25f3b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Jun 2014 12:13:27 +0200 Subject: [PATCH 02/41] Fix: [ bug #1449 ] Trigger ORDER_CREATE ignores interception on error --- ChangeLog | 1 + htdocs/commande/class/commande.class.php | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c3a10ce31ae..2031bd5ec6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ Fix: [ bug #1416 ] Supplier order does not list document models in the select bo supplier order card Fix: [ bug #1443 ] Payment conditions is erased after editing supplier invoice label or limit date for payment +Fix: [ bug #1449 ] Trigger ORDER_CREATE ignores interception on error ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** Fix: Error on field accountancy code for export profile of invoices. diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index b96ea931f21..90c54a5fefe 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -795,8 +795,19 @@ class Commande extends CommonOrder // Fin appel triggers } - $this->db->commit(); - return $this->id; + if (!$error) { + $this->db->commit(); + return $this->id; + } + + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; + } else { From 900b182f3c01218dc963b9b95bd55affffea1d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Jun 2014 12:22:31 +0200 Subject: [PATCH 03/41] Updated changelog --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2031bd5ec6b..e1649ddec66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,7 +9,7 @@ Fix: [ bug #1416 ] Supplier order does not list document models in the select bo supplier order card Fix: [ bug #1443 ] Payment conditions is erased after editing supplier invoice label or limit date for payment -Fix: [ bug #1449 ] Trigger ORDER_CREATE ignores interception on error +Fix: [ bug #1449 ] Trigger ORDER_CREATE, LINEORDER_DELETE, LINEORDER_UPDATE and LINEORDER_INSERT ignore interception on error ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** Fix: Error on field accountancy code for export profile of invoices. @@ -29,7 +29,7 @@ Fix: [ bug #1353 ] Email notifications, wrong URL. Fix: [ bug #1362 ] Note is not saved. Fix: tr/td balance. Fix: [ bug #1360 ] note indicator for member tab. -Fix: Nb of notes and doc not visible onto tasks. +Fix: Nb of notes and doc not visible onto task Fix: [ bug #1372 ] Margin calculation does not work in proposals. Fix: [ bug #1381 ] PHP Warning when listing stock transactions page. Fix: [ bug #1367 ] "Show invoice" link after a POS sell throws an error. From 6e0ecc4f780ce79066b31a9510730debaf6b2d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Jun 2014 12:22:43 +0200 Subject: [PATCH 04/41] Fixed LINEORDER_DELETE interception --- htdocs/commande/class/commande.class.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 90c54a5fefe..40937fc77e5 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3140,6 +3140,8 @@ class OrderLine extends CommonOrderLine $error=0; + $this->db->begin(); + $sql = 'DELETE FROM '.MAIN_DB_PREFIX."commandedet WHERE rowid='".$this->rowid."';"; dol_syslog("OrderLine::delete sql=".$sql); @@ -3165,7 +3167,18 @@ class OrderLine extends CommonOrderLine if ($result < 0) { $error++; $this->errors=$interface->errors; } // Fin appel triggers - return 1; + if (!$error) { + $this->db->commit(); + return 1; + } + + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; } else { From 95a58ebef8a248102d9870942b25d632fb6d9aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Jun 2014 12:23:31 +0200 Subject: [PATCH 05/41] Fixed LINEORDER_UPDATE interception --- htdocs/commande/class/commande.class.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 40937fc77e5..7281a013552 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3402,8 +3402,18 @@ class OrderLine extends CommonOrderLine // Fin appel triggers } - $this->db->commit(); - return 1; + if (!$error) { + $this->db->commit(); + return 1; + } + + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; } else { From 7ebd23153249183159b6b343b25042f002bb5cf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Jun 2014 12:23:57 +0200 Subject: [PATCH 06/41] Fixed LINEORDER_INSERT interception --- htdocs/commande/class/commande.class.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 7281a013552..3df18855769 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3294,8 +3294,18 @@ class OrderLine extends CommonOrderLine // Fin appel triggers } - $this->db->commit(); - return 1; + if (!$error) { + $this->db->commit(); + return 1; + } + + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; } else { From 08588e208086d6a46cdafe9094b3a5e80632d576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Jun 2014 12:31:48 +0200 Subject: [PATCH 07/41] Fixed ORDER_REOPEN trigger error message --- htdocs/commande/class/commande.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 3df18855769..6a0fc61776e 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -452,8 +452,13 @@ class Commande extends CommonOrder } else { - $this->db->rollback(); - return -1; + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::set_reopen ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; } } From 86719bc82a7b212e4a4d24f2e540af20c0270383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Jun 2014 12:35:41 +0200 Subject: [PATCH 08/41] Fixed ORDER_CANCEL trigger error message --- htdocs/commande/class/commande.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6a0fc61776e..0b4cea677fb 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -584,8 +584,14 @@ class Commande extends CommonOrder else { $this->error=$mouvP->error; + + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::cancel ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } $this->db->rollback(); - return -1; + return -1*$error; } } else From 16b1b0f22753d4d844eb30cd30545f4f3477a0dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Jun 2014 12:39:04 +0200 Subject: [PATCH 09/41] Fixed ORDER_CLASSIFY_BILLED trigger error message --- htdocs/commande/class/commande.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 0b4cea677fb..8e3e2cab64c 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2226,9 +2226,14 @@ class Commande extends CommonOrder else { $this->error=$this->db->error(); - dol_syslog(get_class($this)."::classifyBilled ".$this->error, LOG_ERR); + + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::classifyBilled ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } $this->db->rollback(); - return -2; + return -1*$error; } } else From f3807c754cf3784b8f6a2fc9e7da6f2075d70969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Jun 2014 12:44:41 +0200 Subject: [PATCH 10/41] Fixed ORDER_DELETE trigger error message --- htdocs/commande/class/commande.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 8e3e2cab64c..6c7b7bb5ff3 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2521,9 +2521,13 @@ class Commande extends CommonOrder else { $this->error=$this->db->lasterror(); - dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); - $this->db->rollback(); - return -1; + foreach($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); + $this->error.=($this->error?', '.$errmsg:$errmsg); + } + $this->db->rollback(); + return -1*$error; } } From 5a3fc00b4c28e96d0e57f637a73ff013e16f9324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Jun 2014 13:32:17 +0200 Subject: [PATCH 11/41] Fix: [ bug #1450 ] Several Customer order's triggers do not report the error from the trigger handler --- htdocs/commande/class/commande.class.php | 11 +++++------ htdocs/commande/fiche.php | 21 +++++++++++++++------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 6c7b7bb5ff3..199b6500184 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1792,7 +1792,7 @@ class Commande extends CommonOrder else { $this->db->rollback(); - $this->error=$this->db->lasterror(); + $this->error=$line->error; return -1; } } @@ -2399,11 +2399,10 @@ class Commande extends CommonOrder } else { - $this->error=$this->db->lasterror(); - $this->errors=array($this->db->lasterror()); - $this->db->rollback(); - dol_syslog(get_class($this)."::updateline Error=".$this->error, LOG_ERR); - return -1; + $this->error=$this->line->error; + + $this->db->rollback(); + return -1; } } else diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index c1a6d38a58a..666a1ea10d4 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -140,7 +140,7 @@ else if ($action == 'reopen' && $user->rights->commande->creer) } else { - $mesg='
'.$object->error.'
'; + setEventMessage($object->error, 'errors'); } } } @@ -154,9 +154,8 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->comm header('Location: index.php'); exit; } - else - { - $mesg='
'.$object->error.'
'; + else { + setEventMessage($object->error, 'errors'); } } @@ -187,7 +186,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights-> } else { - $mesg='
'.$object->error.'
'; + setEventMessage($object->error, 'errors'); } } @@ -445,6 +444,10 @@ else if ($action == 'add' && $user->rights->commande->creer) else if ($action == 'classifybilled' && $user->rights->commande->creer) { $ret=$object->classifyBilled(); + + if ($ret < 0) { + setEventMessage($object->error, 'errors'); + } } // Positionne ref commande client @@ -1076,7 +1079,9 @@ else if ($action == 'confirm_modif' && $user->rights->commande->creer) else if ($action == 'confirm_shipped' && $confirm == 'yes' && $user->rights->commande->cloturer) { $result = $object->cloture($user); - if ($result < 0) $mesgs=$object->errors; + if ($result < 0) { + setEventMessage($object->error, 'errors'); + } } else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->commande->valider) @@ -1097,6 +1102,10 @@ else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->comm if (! $error) { $result = $object->cancel($idwarehouse); + + if ($result < 0) { + setEventMessage($object->error, 'errors'); + } } } From b9801a8b3cbf1304a00ab371f95168d2d56b5ba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Jun 2014 13:32:47 +0200 Subject: [PATCH 12/41] Missing changelog --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index e1649ddec66..4755b61153f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ Fix: [ bug #1416 ] Supplier order does not list document models in the select bo Fix: [ bug #1443 ] Payment conditions is erased after editing supplier invoice label or limit date for payment Fix: [ bug #1449 ] Trigger ORDER_CREATE, LINEORDER_DELETE, LINEORDER_UPDATE and LINEORDER_INSERT ignore interception on error +Fix: [ bug #1450 ] Several Customer order's triggers do not report the error from the trigger handler ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** Fix: Error on field accountancy code for export profile of invoices. From 0ef89e40608943b9986a2422728c25d342714680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Jun 2014 13:40:06 +0200 Subject: [PATCH 13/41] Corrected ORDER_CLONE trigger error message --- htdocs/commande/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 666a1ea10d4..34dcccb80b8 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -120,7 +120,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->commande-> } else { - $mesg='
'.$object->error.'
'; + setEventMessage($object->error, 'errors'); $action=''; } } From 7cb5cc550fae6d353c5f135cb08a2e5b1cb2bf6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Jun 2014 13:41:17 +0200 Subject: [PATCH 14/41] Didn't mean to change this entry of the changelog --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4755b61153f..f77863f1de0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -30,7 +30,7 @@ Fix: [ bug #1353 ] Email notifications, wrong URL. Fix: [ bug #1362 ] Note is not saved. Fix: tr/td balance. Fix: [ bug #1360 ] note indicator for member tab. -Fix: Nb of notes and doc not visible onto task +Fix: Nb of notes and doc not visible onto tasks. Fix: [ bug #1372 ] Margin calculation does not work in proposals. Fix: [ bug #1381 ] PHP Warning when listing stock transactions page. Fix: [ bug #1367 ] "Show invoice" link after a POS sell throws an error. From ff37adf6f1e8468f7c32bc4631571f3c342ac3f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Jun 2014 13:47:30 +0200 Subject: [PATCH 15/41] Fix: [ bug #1451 ] Interrupted order clone through trigger, loads nonexistent order --- ChangeLog | 1 + htdocs/commande/fiche.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index f77863f1de0..8b291cf3d5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ Fix: [ bug #1443 ] Payment conditions is erased after editing supplier invoice l limit date for payment Fix: [ bug #1449 ] Trigger ORDER_CREATE, LINEORDER_DELETE, LINEORDER_UPDATE and LINEORDER_INSERT ignore interception on error Fix: [ bug #1450 ] Several Customer order's triggers do not report the error from the trigger handler +Fix: [ bug #1451 ] Interrupted order clone through trigger, loads nonexistent order ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** Fix: Error on field accountancy code for export profile of invoices. diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 34dcccb80b8..6630477d740 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -112,6 +112,9 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->commande-> { if ($object->id > 0) { + //Because createFromClone modifies the object, we must clone it so that we can restore it later + $orig = clone $object; + $result=$object->createFromClone($socid); if ($result > 0) { @@ -121,6 +124,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && $user->rights->commande-> else { setEventMessage($object->error, 'errors'); + $object = $orig; $action=''; } } From 2fed26d68b40d006f1549fe1fe0454477dca3fbe Mon Sep 17 00:00:00 2001 From: Fab Date: Wed, 11 Jun 2014 08:01:05 +0200 Subject: [PATCH 16/41] html fix : missing . --- ChangeLog | 1 + htdocs/fourn/facture/fiche.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c3a10ce31ae..ccea14de809 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ English Dolibarr ChangeLog -------------------------------------------------------------- ***** ChangeLog for 3.5.4 compared to 3.5.3 ***** +Fix: [ bug #1445 ] html fix : missing Fix: [ bug #1415 ] Intervention document model name and suppliers model names is not shown properly in module configuration Fix: [ bug #1416 ] Supplier order does not list document models in the select box of the diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 966ab630ade..af06e4b0bbc 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1164,7 +1164,7 @@ if ($action == 'create') { print $form->select_company((empty($_GET['socid'])?'':$_GET['socid']),'socid','s.fournisseur = 1',1); } - print ''; + print ''; // Ref supplier print ''.$langs->trans('RefSupplier').''; From 40742e84a9ef9702be1f9da246217ba45f48c0ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Jun 2014 16:47:00 +0200 Subject: [PATCH 17/41] Fix: Bad balance of colspan. Fix: Filter on status was not visible when selected from url. Fix: Filtering on status was last when asking to sort. --- ChangeLog | 2 ++ htdocs/fourn/facture/list.php | 25 ++++++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index c3a10ce31ae..392de85a460 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,8 @@ Fix: [ bug #1416 ] Supplier order does not list document models in the select bo supplier order card Fix: [ bug #1443 ] Payment conditions is erased after editing supplier invoice label or limit date for payment +Fix: Filter on status was not visible when selected from url. +Fix: Filtering on status was last when asking to sort. ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** Fix: Error on field accountancy code for export profile of invoices. diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 4b3b375a047..09dce5ceb70 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -119,7 +119,7 @@ if ($socid) { $sql .= " AND s.rowid = ".$socid; } -if (GETPOST('filtre')) +if (GETPOST('filtre') && GETPOST('filtre') != -1) // GETPOST('filtre') may be a string { $filtrearr = explode(",", GETPOST('filtre')); foreach ($filtrearr as $fil) @@ -191,15 +191,16 @@ if ($resql) $soc->fetch($socid); } - $param='&socid='.$socid; - if ($month) $param.='&month='.urlencode($month); - if ($year) $param.='&year=' .urlencode($year); - if (GETPOST("search_ref")) $param.='&search_ref='.urlencode(GETPOST("search_ref")); - if (GETPOST("search_ref_supplier")) $param.='&search_ref_supplier'.urlencode(GETPOST("search_ref_supplier")); - if (GETPOST("search_libelle")) $param.='&search_libelle='.urlencode(GETPOST("search_libelle")); - if (GETPOST("search_societe")) $param.='&search_societe='.urlencode(GETPOST("search_societe")); - if (GETPOST("search_montant_ht")) $param.='&search_montant_ht='.urlencode(GETPOST("search_montant_ht")); - if (GETPOST("search_montant_ttc")) $param.='&search_montant_ttc='.urlencode(GETPOST("search_montant_ttc")); + $param='&socid='.$socid; + if ($month) $param.='&month='.urlencode($month); + if ($year) $param.='&year=' .urlencode($year); + if (GETPOST("search_ref")) $param.='&search_ref='.urlencode(GETPOST("search_ref")); + if (GETPOST("search_ref_supplier")) $param.='&search_ref_supplier'.urlencode(GETPOST("search_ref_supplier")); + if (GETPOST("search_libelle")) $param.='&search_libelle='.urlencode(GETPOST("search_libelle")); + if (GETPOST("search_societe")) $param.='&search_societe='.urlencode(GETPOST("search_societe")); + if (GETPOST("search_montant_ht")) $param.='&search_montant_ht='.urlencode(GETPOST("search_montant_ht")); + if (GETPOST("search_montant_ttc")) $param.='&search_montant_ttc='.urlencode(GETPOST("search_montant_ttc")); + if (GETPOST("filtre") && GETPOST('filtre') != -1) $param.='&filtre='.urlencode(GETPOST("filtre")); print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->nom":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); print '
'; @@ -242,7 +243,9 @@ if ($resql) print ''; print ''; print ''; - print ''; + print ''; + $liststatus=array('paye:0'=>$langs->trans("Unpayed"), 'paye:1'=>$langs->trans("Payed")); + print $form->selectarray('filtre', $liststatus, GETPOST('filtre'), 1); print ''; print ''; print "\n"; From bb8516274eb1f6df34c768351d206df1bb2d6198 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 11 Jun 2014 18:01:15 +0200 Subject: [PATCH 18/41] Fix: socid was not caught. Fix: numbering modules was not correctly scanned. --- htdocs/projet/fiche.php | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php index d5001540a6b..dddeb089d2e 100644 --- a/htdocs/projet/fiche.php +++ b/htdocs/projet/fiche.php @@ -56,7 +56,7 @@ if ($object->id > 0) } // Security check -$socid=0; +$socid=GETPOST('socid'); if ($user->societe_id > 0) $socid=$user->societe_id; $result = restrictedArea($user, 'projet', $object->id); @@ -376,6 +376,10 @@ if ($action == 'create' && $user->rights->projet->creer) /* * Create */ + + $thirdparty=new Societe($db); + if ($socid > 0) $thirdparty->fetch($socid); + print_fiche_titre($langs->trans("NewProject")); dol_htmloutput_mesg($mesg); @@ -388,12 +392,28 @@ if ($action == 'create' && $user->rights->projet->creer) print ''; $defaultref=''; - $obj = empty($conf->global->PROJECT_ADDON)?'mod_project_simple':$conf->global->PROJECT_ADDON; - if (! empty($conf->global->PROJECT_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/project/".$conf->global->PROJECT_ADDON.".php")) + $modele = empty($conf->global->PROJECT_ADDON)?'mod_project_simple':$conf->global->PROJECT_ADDON; + + // Search template files + $file=''; $classname=''; $filefound=0; + $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + foreach($dirmodels as $reldir) { - require_once DOL_DOCUMENT_ROOT ."/core/modules/project/".$conf->global->PROJECT_ADDON.'.php'; - $modProject = new $obj; - $defaultref = $modProject->getNextValue($soc,$object); + $file=dol_buildpath($reldir."core/modules/project/".$modele.'.php',0); + if (file_exists($file)) + { + $filefound=1; + $classname = $modele; + break; + } + } + + if ($filefound) + { + $result=dol_include_once($reldir."core/modules/project/".$modele.'.php'); + $modProject = new $classname; + + $defaultref = $modProject->getNextValue($thirdparty,$object); } if (is_numeric($defaultref) && $defaultref <= 0) $defaultref=''; @@ -773,4 +793,4 @@ else llxFooter(); $db->close(); -?> +?> \ No newline at end of file From 80facefa23205b5c617293f74af7219562dca95c Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 12 Jun 2014 09:13:51 +0200 Subject: [PATCH 19/41] =?UTF-8?q?Fix=20[=20bug=20#1454=20]=20Mention=20de?= =?UTF-8?q?=20bas=20de=20page=20erron=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeLog | 1 + htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 392de85a460..610c08a28ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ Fix: [ bug #1443 ] Payment conditions is erased after editing supplier invoice l limit date for payment Fix: Filter on status was not visible when selected from url. Fix: Filtering on status was last when asking to sort. +Fix: [ bug #1454 ] Mention de bas de page erroné ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** Fix: Error on field accountancy code for export profile of invoices. diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index f48c6bc31a4..b0db46f033a 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -1092,7 +1092,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders */ function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0) { - return pdf_pagefoot($pdf,$outputlangs,'SUPPLIER_INVOICE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext); + return pdf_pagefoot($pdf,$outputlangs,'SUPPLIER_ORDER_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,0,$hidefreetext); } } From f796a6408ef5bc6cd2528af44e16812feb382a13 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 12 Jun 2014 15:28:11 +0200 Subject: [PATCH 20/41] Do not display dictionnay for non activated module --- ChangeLog | 1 + htdocs/core/lib/admin.lib.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index 610c08a28ad..b1f69e0e9fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ Fix: [ bug #1443 ] Payment conditions is erased after editing supplier invoice l Fix: Filter on status was not visible when selected from url. Fix: Filtering on status was last when asking to sort. Fix: [ bug #1454 ] Mention de bas de page erroné +Fix: Do not display dictionnay for non activated module ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** Fix: Error on field accountancy code for export profile of invoices. diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 3cfb0adeb7d..40f7ba41447 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -937,6 +937,8 @@ function complete_dictionnary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsq $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod))); if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2 && ! $conf->global->$const_name) $modulequalified=0; if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1 && ! $conf->global->$const_name) $modulequalified=0; + //If module is not activated disqualified + if (empty($conf->global->$const_name)) $modulequalified=0; if ($modulequalified) { From 1ba02185e5b47d223242509e2979cb7a08806c75 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Jun 2014 15:32:25 +0200 Subject: [PATCH 21/41] Fix: Error nor reported --- htdocs/comm/propal.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index f57778a42a4..a4d984951cd 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -195,7 +195,8 @@ else if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->pr else { $langs->load("errors"); - setEventMessage($langs->trans($object->error), 'errors'); + if (count($object->errors) > 0) setEventMessage($object->errors, 'errors'); + else setEventMessage($langs->trans($object->error), 'errors'); } } From b4ef780274248df2da40aef446e53c8f8e7df388 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Jun 2014 15:41:00 +0200 Subject: [PATCH 22/41] Fix: When project was disabled, label was not visible --- htdocs/core/class/html.formprojet.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 2c371d4afcd..e090f2f6824 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -77,7 +77,7 @@ class FormProjets $sql.= " WHERE p.entity = ".$conf->entity; if ($projectsListId !== false) $sql.= " AND p.rowid IN (".$projectsListId.")"; if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)"; - $sql.= " ORDER BY p.title ASC"; + $sql.= " ORDER BY p.ref ASC"; dol_syslog(get_class($this)."::select_projects sql=".$sql,LOG_DEBUG); $resql=$this->db->query($sql); @@ -113,6 +113,7 @@ class FormProjets else { $disabled=0; + $labeltoshow.=' '.dol_trunc($obj->title,$maxlength); if (! $obj->fk_statut > 0) { $disabled=1; @@ -134,8 +135,8 @@ class FormProjets if ($disabled) $resultat.=' disabled="disabled"'; //if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')'; //else $labeltoshow.=' ('.$langs->trans("Private").')'; - $resultat.='>'.$labeltoshow; - if (! $disabled) $resultat.=' - '.dol_trunc($obj->title,$maxlength); + $resultat.='>'; + $resultat.=$labeltoshow; $resultat.=''; } $out.= $resultat; From 40a5d20cc885ea47fc62bfd940d8e91e56e18f03 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 12 Jun 2014 16:46:20 +0200 Subject: [PATCH 23/41] Do not reset index on product import !!! --- htdocs/core/modules/modProduct.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php index c6e473f38e2..35b5f3d90b9 100644 --- a/htdocs/core/modules/modProduct.class.php +++ b/htdocs/core/modules/modProduct.class.php @@ -273,8 +273,6 @@ class modProduct extends DolibarrModules // Import product multiprice //-------- - $r=0; - $r++; $this->import_code[$r]=$this->rights_class.'_'.$r; $this->import_label[$r]="ProductsMultiPrice"; // Translation key From 1a9e53e21f3d804647ca50d11e60eee7143992d0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Jun 2014 22:00:16 +0200 Subject: [PATCH 24/41] Fxi: Correct property name --- htdocs/projet/class/task.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 7b21cbf57d0..93fd2ac6b6d 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -141,7 +141,7 @@ class Task extends CommonObject // End call triggers } } - + //Update extrafield if (!$error) { if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used @@ -311,7 +311,7 @@ class Task extends CommonObject // End call triggers } } - + //Update extrafield if (!$error) { if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used @@ -834,7 +834,7 @@ class Task extends CommonObject $this->id = $obj->fk_task; $this->timespent_date = $obj->task_date; $this->timespent_duration = $obj->task_duration; - $this->timespent_user = $obj->fk_user; + $this->timespent_fk_user = $obj->fk_user; $this->timespent_note = $obj->note; } @@ -1018,7 +1018,7 @@ class Task extends CommonObject // Load source object $clone_task->fetch($fromid); $origin_task->fetch($fromid); - + $defaultref=''; $obj = empty($conf->global->PROJECT_TASK_ADDON)?'mod_task_simple':$conf->global->PROJECT_TASK_ADDON; if (! empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/project/task/".$conf->global->PROJECT_TASK_ADDON.".php")) From d508c076e8e5292b04ab8b1445d6c3ad11ba4bf2 Mon Sep 17 00:00:00 2001 From: philippe Date: Fri, 13 Jun 2014 12:10:26 +0200 Subject: [PATCH 25/41] 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 2c834bace60..0cbceb917a0 100644 --- a/htdocs/fourn/paiement/fiche.php +++ b/htdocs/fourn/paiement/fiche.php @@ -101,7 +101,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 0916d2cf3b1307db8d8e7612ae96f2e5ce71f67b Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 13 Jun 2014 15:54:37 +0200 Subject: [PATCH 26/41] Fix link element from project "associates object" pages http://www.dolibarr.fr/forum/527-bugs-sur-la-version-stable-courante/50687-objet-associes-au-projet --- ChangeLog | 1 + htdocs/core/class/html.formprojet.class.php | 7 ++++++- htdocs/projet/element.php | 7 ++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b1f69e0e9fe..fe25f447e6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ Fix: Filter on status was not visible when selected from url. Fix: Filtering on status was last when asking to sort. Fix: [ bug #1454 ] Mention de bas de page erroné Fix: Do not display dictionnay for non activated module +Fix: Link element from element project pages ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** Fix: Error on field accountancy code for export profile of invoices. diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index e090f2f6824..d668912faca 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -168,6 +168,7 @@ class FormProjets */ function select_element($table_element) { + global $conf; $projectkey="fk_projet"; switch ($table_element) @@ -195,7 +196,7 @@ class FormProjets if (!empty($this->societe->id)) { $sql.= " AND fk_soc=".$this->societe->id; } - $sql.= ' AND entity='.$conf->entity; + $sql.= ' AND entity='.getEntity('project'); $sql.= " ORDER BY ref DESC"; dol_syslog(get_class($this).'::select_element sql='.$sql,LOG_DEBUG); @@ -219,6 +220,10 @@ class FormProjets return $sellist ; $this->db->free($resql); + }else { + $this->error=$this->db->lasterror(); + dol_syslog(get_class($this) . "::select_element " . $errmsg, LOG_ERR); + return -1; } } diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 4947af8ba30..88330819349 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -209,13 +209,18 @@ foreach ($listofreferent as $key => $value) $classname=$value['class']; $tablename=$value['table']; $qualified=$value['test']; + if ($qualified) { print '
'; print_titre($langs->trans($title)); - + $selectList=$formproject->select_element($tablename); + if ($selectList<0) { + setEventMessage($formproject->error,'errors'); + } + if ($selectList) { print ''; From 42e6727e5ddd75ba1261c81901a63794dc2526ed Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 13 Jun 2014 15:56:31 +0200 Subject: [PATCH 27/41] Better error return --- htdocs/core/class/html.formprojet.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index d668912faca..b3228278261 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -222,7 +222,7 @@ class FormProjets $this->db->free($resql); }else { $this->error=$this->db->lasterror(); - dol_syslog(get_class($this) . "::select_element " . $errmsg, LOG_ERR); + dol_syslog(get_class($this) . "::select_element " . $this->error, LOG_ERR); return -1; } } From 0f77fbaea2099af02d8fa04673b8ca5ece6daf3c Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 17 Jun 2014 11:18:30 +0200 Subject: [PATCH 28/41] Fix [ bug #1349 ] AJAX contact selector does not work fine in Project card --- ChangeLog | 1 + htdocs/core/js/lib_head.js | 1 + htdocs/core/lib/ajax.lib.php | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index c44642dd3f4..2ad59346161 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,7 @@ Fix: [ bug #1451 ] Interrupted order clone through trigger, loads nonexistent or Fix: [ bug #1454 ] Mention de bas de page erroné Fix: Do not display dictionnay for non activated module Fix: Link element from element project pages +Fix: [ bug #1349 ] AJAX contact selector does not work fine in Project card ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** Fix: Error on field accountancy code for export profile of invoices. diff --git a/htdocs/core/js/lib_head.js b/htdocs/core/js/lib_head.js index cfb2977c370..9221843d575 100644 --- a/htdocs/core/js/lib_head.js +++ b/htdocs/core/js/lib_head.js @@ -808,6 +808,7 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton, var input = this.input = $( "" ) .insertAfter( select ) .val( value ) + .attr('id', 'inputautocomplete'+select.attr('id')) .autocomplete({ delay: 0, minLength: this.options.minLengthToAutocomplete, diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index f111551cc51..e24d12dbc52 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -358,6 +358,13 @@ function ajax_combobox($htmlname, $event=array(), $minLengthToAutocomplete=0) } }); $("select#" + htmlname).html(response.value); + if (response.num) { + var selecthtml_str = response.value; + var selecthtml_dom=$.parseHTML(selecthtml_str); + $("#inputautocomplete"+htmlname).val(selecthtml_dom[0][0].innerHTML); + } else { + $("#inputautocomplete"+htmlname).val(""); + } }); } });'; From 03156b58e3242e329ca795d316fc9d6a12f5d056 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 17 Jun 2014 11:30:41 +0200 Subject: [PATCH 29/41] [ bug #1452 ] variable used but not defined --- htdocs/fourn/facture/fiche.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index af06e4b0bbc..62022c7e5e4 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1167,7 +1167,7 @@ if ($action == 'create') print ''; // Ref supplier - print '
'; + print ''; print ''; print ''; // Label - print ''; + print ''; // Date invoice print ''; print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; print ''; // Ajout de produits/services predefinis if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { - print ''; + + if (! empty($conf->use_javascript_ajax)) { + print ''; + } print ''; print ' Fix: [ bug #1415 ] Intervention document model name and suppliers model names is not shown properly in module configuration diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 76d63a10317..ce82c0a2817 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -287,11 +287,10 @@ function pdf_getHeightForLogo($logo, $url = false) * @param Societe $targetcompany Target company object * @param Contact $targetcontact Target contact object * @param int $usecontact Use contact instead of company - * @param int $mode Address type - * @param Societe $deliverycompany Delivery company object + * @param int $mode Address type ('source', 'target', 'targetwithdetails') * @return string String with full address */ -function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$targetcontact='',$usecontact=0,$mode='source',$deliverycompany='') +function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$targetcontact='',$usecontact=0,$mode='source') { global $conf; @@ -322,7 +321,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target } } - if ($mode == 'target') + if ($mode == 'target' || $mode == 'targetwithdetails') { if ($usecontact) { @@ -341,11 +340,13 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code))."\n"; } - - if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS)) + if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails') { // Phone - if ($targetcontact->phone_pro) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcontact->phone_pro); + if (! empty($targetcontact->phone_pro) || ! empty($targetcontact->phone_mobile)) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": "; + if (! empty($targetcontact->phone_pro)) $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_pro); + if (! empty($targetcontact->phone_pro) || ! empty($targetcontact->phone_mobile)) $stringaddress .= " / "; + if (! empty($targetcontact->phone_mobile)) $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_mobile); // Fax if ($targetcontact->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax); // EMail @@ -360,10 +361,13 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target // Country if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code))."\n"; - if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS)) + if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails') { // Phone - if ($targetcompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcompany->phone); + if (! empty($targetcompany->phone) || ! empty($targetcompany->phone_mobile)) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": "; + if (! empty($targetcompany->phone)) $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone); + if (! empty($targetcompany->phone) || ! empty($targetcompany->phone_mobile)) $stringaddress .= " / "; + if (! empty($targetcompany->phone_mobile)) $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone_mobile); // Fax if ($targetcompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax); // EMail @@ -406,16 +410,6 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target } } - if ($mode == 'delivery') // for a delivery address (address + phone/fax) - { - $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($deliverycompany))."\n"; - - // Phone - if ($deliverycompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($deliverycompany->phone); - // Fax - if ($deliverycompany->fax) $stringaddress .= ($stringaddress ? ($deliverycompany->phone ? " - " : "\n") : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($deliverycompany->fax); - } - return $stringaddress; } diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index dafff8b81ea..539d62f92a8 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -602,8 +602,7 @@ class pdf_merou extends ModelePdfExpedition $carac_client_name=$outputlangs->convToOutputCharset($object->client->nom); } - $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target'); - + $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,((!empty($object->contact))?$object->contact:null),$usecontact,'targetwithdetails'); $blDestX=$blExpX+55; $blW=50; diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index d479d2c8059..13a911977ed 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -504,7 +504,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 4, $outputlangs->transnoentities("RefSending") ." : ".$object->ref, '', 'R'); - //Date Expedition + // Date Expedition $posy+=4; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); @@ -530,7 +530,7 @@ class pdf_rouget extends ModelePdfExpedition $origin_id = $object->origin_id; // TODO move to external function - if ($conf->$origin->enabled) + if (! empty($conf->$origin->enabled)) { $outputlangs->load('orders'); @@ -616,7 +616,7 @@ class pdf_rouget extends ModelePdfExpedition $carac_client_name=$outputlangs->convToOutputCharset($object->client->nom); } - $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,$object->contact,$usecontact,'target'); + $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,(!empty($object->contact)?$object->contact:null),$usecontact,'targetwithdetails'); // Show recipient $widthrecbox=100; From 221d7b56aaf6d80376991df5f72b87a53e4cb161 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Jun 2014 12:52:08 +0200 Subject: [PATCH 37/41] Fix: The object deliverycompany was not used anymore and output of details for delivery reports was lost during 3.5. Rewrite code to restore feature. Conflicts: htdocs/core/modules/expedition/doc/pdf_merou.modules.php htdocs/core/modules/expedition/doc/pdf_rouget.modules.php --- htdocs/core/lib/pdf.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index ce82c0a2817..1f9bcc20cd7 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -345,7 +345,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target // Phone if (! empty($targetcontact->phone_pro) || ! empty($targetcontact->phone_mobile)) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": "; if (! empty($targetcontact->phone_pro)) $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_pro); - if (! empty($targetcontact->phone_pro) || ! empty($targetcontact->phone_mobile)) $stringaddress .= " / "; + if (! empty($targetcontact->phone_pro) && ! empty($targetcontact->phone_mobile)) $stringaddress .= " / "; if (! empty($targetcontact->phone_mobile)) $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_mobile); // Fax if ($targetcontact->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax); @@ -366,7 +366,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target // Phone if (! empty($targetcompany->phone) || ! empty($targetcompany->phone_mobile)) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": "; if (! empty($targetcompany->phone)) $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone); - if (! empty($targetcompany->phone) || ! empty($targetcompany->phone_mobile)) $stringaddress .= " / "; + if (! empty($targetcompany->phone) && ! empty($targetcompany->phone_mobile)) $stringaddress .= " / "; if (! empty($targetcompany->phone_mobile)) $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone_mobile); // Fax if ($targetcompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax); From f7654107f92c2e7e4cd53a2dcd314b4bccc855a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Jun 2014 13:22:08 +0200 Subject: [PATCH 38/41] Fix 1462, 1468, 1480, 1483, 1490, 1497 $this instead of $object Fix 1455 outstanding amount --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 93925c1e6aa..888c7efcfb6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,8 @@ Fix: [ bug #1349 ] AJAX contact selector does not work fine in Project card Fix: [ bug #1452 ] variable used but not defined Fix: If multiprice level is used the VAT on addline is not correct Fix: [ bug #1254 ] Error when using "Enter" on qty input box of a product (on supplier order part) +Fix: [ bug #1462, 1468, 1480, 1483, 1490, 1497] $this instead of $object +Fix: [ bug #1455 ] outstanding amount ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** Fix: Error on field accountancy code for export profile of invoices. From fcb00b202412a4c6622d94f8bd6d9f66e9a09004 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Jun 2014 13:38:44 +0200 Subject: [PATCH 39/41] Fix: [ bug #1425 ] --- ChangeLog | 1 + htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 2 +- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- .../modules/supplier_order/pdf/pdf_muscadet.modules.php | 7 +++++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 888c7efcfb6..f089cd9f782 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,6 +29,7 @@ Fix: If multiprice level is used the VAT on addline is not correct Fix: [ bug #1254 ] Error when using "Enter" on qty input box of a product (on supplier order part) Fix: [ bug #1462, 1468, 1480, 1483, 1490, 1497] $this instead of $object Fix: [ bug #1455 ] outstanding amount +Fix: [ bug #1425 ] ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** Fix: Error on field accountancy code for export profile of invoices. diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 953212748f8..b0f03c3df2c 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -606,7 +606,7 @@ class pdf_einstein extends ModelePDFCommandes }*/ // Show planed date of delivery - if ($object->date_livraison) + if (! empty($object->date_livraison)) { $outputlangs->load("sendings"); $pdf->SetFont('','B', $default_font_size - 2); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 4aea9af7085..aa584d7a8f0 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -618,7 +618,7 @@ class pdf_azur extends ModelePDFPropales $posxval=52; // Show shipping date - if ($object->date_livraison) + if (! empty($object->date_livraison)) { $outputlangs->load("sendings"); $pdf->SetFont('','B', $default_font_size - 2); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index b0db46f033a..11f34209316 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -909,6 +909,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $outputlangs->load("bills"); $outputlangs->load("orders"); $outputlangs->load("companies"); + $outputlangs->load("sendings"); $default_font_size = pdf_getPDFFontSize($outputlangs); @@ -979,11 +980,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $posy+=5; $pdf->SetXY($posx,$posy); - if ($object->date_commande) + if (! empty($object->date_commande)) { $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date_commande,"day",false,$outputlangs,true), '', 'R'); - $pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : " . dol_print_date($object->date_livraison,"day",false,$outputlangs,true), '', 'R'); } else { @@ -991,6 +991,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderToProcess"), '', 'R'); } + $pdf->SetTextColor(0,0,60); + if (! empty($object->date_livraison)) $pdf->MultiCell(190, 3, $outputlangs->transnoentities("DateDeliveryPlanned")." : " . dol_print_date($object->date_livraison,"day",false,$outputlangs,true), '', 'R'); + $posy+=5; $pdf->SetTextColor(0,0,60); From a2065d0b6ad7f8fa804c25b1a367f63084024d2a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Jun 2014 13:49:59 +0200 Subject: [PATCH 40/41] Fix: [ bug #1428 ] "Nothing" is shown in the middle of the screen in a supplier order. --- ChangeLog | 1 + htdocs/core/class/html.formfile.class.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f089cd9f782..5e5bb5ae2d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ English Dolibarr ChangeLog -------------------------------------------------------------- ***** ChangeLog for 3.5.4 compared to 3.5.3 ***** +Fix: [ bug #1428 ] "Nothing" is shown in the middle of the screen in a supplier order. Fix: The object deliverycompany was not used anymore and output of details for delivery reports was lost during 3.5. Rewrite code to restore feature. diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 1eadc4f427a..d139f235fd9 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -615,7 +615,7 @@ class FormFile } } - if (count($file_list) == 0) + if (count($file_list) == 0 && $headershown) { $out.=''; } From 28fd8c68626641733d733ab8437f26d963fa2468 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Jun 2014 14:04:37 +0200 Subject: [PATCH 41/41] Fix: [ bug #1431 ] Reception and Send supplier order box has a weird top margin. --- ChangeLog | 1 + htdocs/fourn/commande/fiche.php | 51 ++++++++++++++------------------- 2 files changed, 23 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e5bb5ae2d5..dd6c12d1b72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ English Dolibarr ChangeLog -------------------------------------------------------------- ***** ChangeLog for 3.5.4 compared to 3.5.3 ***** +Fix: [ bug #1431 ] Reception and Send supplier order box has a weird top margin. Fix: [ bug #1428 ] "Nothing" is shown in the middle of the screen in a supplier order. Fix: The object deliverycompany was not used anymore and output of details for delivery reports was lost during 3.5. Rewrite code to diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 287c2ed1c83..21d165c118e 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -198,7 +198,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) } if (GETPOST('addline_predefined') || (! GETPOST('dp_desc') && ! GETPOST('addline_predefined') && GETPOST('idprod', 'int')>0) // we push enter onto qty field - ) + ) { $predef=(($conf->global->MAIN_FEATURES_LEVEL < 2) ? '_predef' : ''); $idprod=GETPOST('idprod', 'int'); @@ -221,7 +221,7 @@ else if ($action == 'addline' && $user->rights->fournisseur->commande->creer) } if (! GETPOST('addline_predefined') && ( GETPOST('pu')==='')) // Unit price can be 0 but not '' { - + setEventMessage($langs->trans($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('UnitPrice'))), 'errors'); $error++; } @@ -760,10 +760,10 @@ else if ($action == 'add' && $user->rights->fournisseur->commande->creer) $object->mode_reglement_id = GETPOST('mode_reglement_id'); $object->note_private = GETPOST('note_private'); $object->note_public = GETPOST('note_public'); - + // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost($extralabels,$object); - + $id = $object->create($user); if ($id < 0) { @@ -1118,12 +1118,12 @@ if ($action=="create") // Other options $parameters=array(); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook - + if (empty($reshook) && ! empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields,'edit'); } - + // Bouton "Create Draft" print "
'.$langs->trans('RefSupplier').'
'.$langs->trans('RefSupplier').'
'.$langs->trans('Type').''; @@ -1254,7 +1254,7 @@ if ($action == 'create') print '
'.$langs->trans('Label').'
'.$langs->trans('Label').'
'.$langs->trans('DateInvoice').''; From 7f92031583e16509e7e097be96de5b2fbb544359 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 17 Jun 2014 11:31:20 +0200 Subject: [PATCH 30/41] Changelog --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 2ad59346161..e997d097dd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,7 @@ Fix: [ bug #1454 ] Mention de bas de page erroné Fix: Do not display dictionnay for non activated module Fix: Link element from element project pages Fix: [ bug #1349 ] AJAX contact selector does not work fine in Project card +Fix: [ bug #1452 ] variable used but not defined ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** Fix: Error on field accountancy code for export profile of invoices. From 0645189432634fead60e2ccc64c0cee6dfaead76 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 18 Jun 2014 10:56:38 +0200 Subject: [PATCH 31/41] If multiprice level is used the VAT on addline is not correct --- ChangeLog | 1 + htdocs/comm/propal.php | 2 ++ htdocs/commande/fiche.php | 2 ++ htdocs/compta/facture.php | 2 ++ 4 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index e997d097dd8..748f60a2f5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ Fix: Do not display dictionnay for non activated module Fix: Link element from element project pages Fix: [ bug #1349 ] AJAX contact selector does not work fine in Project card Fix: [ bug #1452 ] variable used but not defined +Fix: If multiprice level is used the VAT on addline is not correct ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** Fix: Error on field accountancy code for export profile of invoices. diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index a4d984951cd..ddec39d90d2 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -738,6 +738,8 @@ 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 6630477d740..12d62904dd8 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -686,6 +686,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]; } else { diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index d685f9ad1ed..4f00678b514 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1259,6 +1259,8 @@ 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 5b5473bc7c09fa98d55321944cd5db6cc21137c2 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Thu, 19 Jun 2014 10:02:58 +0200 Subject: [PATCH 32/41] Fix: [ bug #1509 ] Expedition admin submit error Expedition admin free text & watermark submit error --- ChangeLog | 1 + htdocs/admin/expedition.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c44642dd3f4..78020debf17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,7 @@ Fix: [ bug #1451 ] Interrupted order clone through trigger, loads nonexistent or Fix: [ bug #1454 ] Mention de bas de page erroné Fix: Do not display dictionnay for non activated module Fix: Link element from element project pages +Fix: [ bug #1509 ] Expedition admin free text & watermark submit error ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** Fix: Error on field accountancy code for export profile of invoices. diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 0e0008a54b7..fbc03faf37d 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -76,7 +76,7 @@ else if ($action == 'set_SHIPPING_FREE_TEXT') $freetext=GETPOST('SHIPPING_FREE_TEXT','alpha'); $res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); - if ($res < 0) + if ($res > 0) setEventMessage($langs->trans("SetupSaved")); else setEventMessage($langs->trans("Error"), 'errors'); @@ -87,7 +87,7 @@ else if ($action == 'set_SHIPPING_DRAFT_WATERMARK') $draft=GETPOST('SHIPPING_DRAFT_WATERMARK','alpha'); $res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); - if ($res < 0) + if ($res > 0) setEventMessage($langs->trans("SetupSaved")); else setEventMessage($langs->trans("Error"), 'errors'); From aaabf9647d3a2e0d2466bec968f444f2b4faeafc Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 20 Jun 2014 09:33:25 +0200 Subject: [PATCH 33/41] Fix 1462, 1468, 1480, 1483, 1490, 1497 $this instead of $object (3.5 fix) --- htdocs/comm/propal.php | 2 +- htdocs/compta/facture.php | 2 +- htdocs/expedition/fiche.php | 2 +- htdocs/fichinter/fiche.php | 2 +- htdocs/fourn/facture/fiche.php | 2 +- htdocs/societe/soc.php | 8 ++++---- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index a4d984951cd..beaa24be32e 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -550,7 +550,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G $interface=new Interfaces($db); $result=$interface->run_triggers('PROPAL_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/compta/facture.php b/htdocs/compta/facture.php index d685f9ad1ed..9070afb2c53 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1783,7 +1783,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO $interface=new Interfaces($db); $result=$interface->run_triggers('BILL_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/expedition/fiche.php b/htdocs/expedition/fiche.php index 6d566337e10..4743ad5f25b 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -456,7 +456,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/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 21ccb1f2649..b48950267fb 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -736,7 +736,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 diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index af06e4b0bbc..ea079eb9321 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -881,7 +881,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 diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 149cec123e8..fad70d5bd2e 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -414,12 +414,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); } } From 40f5911f52cfe2d92ccc524c3950d45a1e322f70 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 20 Jun 2014 09:36:31 +0200 Subject: [PATCH 34/41] Fix: [ bug #1254 ] Error when using "Enter" on qty input box of a product (on supplier order part) --- ChangeLog | 1 + htdocs/fourn/commande/fiche.php | 64 +++++++++++++++++++++++++++------ 2 files changed, 54 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 748f60a2f5b..31928d2b0ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,7 @@ Fix: Link element from element project pages Fix: [ bug #1349 ] AJAX contact selector does not work fine in Project card Fix: [ bug #1452 ] variable used but not defined Fix: If multiprice level is used the VAT on addline is not correct +Fix: [ bug #1254 ] Error when using "Enter" on qty input box of a product (on supplier order part) ***** ChangeLog for 3.5.3 compared to 3.5.2 ***** Fix: Error on field accountancy code for export profile of invoices. diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 5f3ef882fcf..287c2ed1c83 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1731,6 +1731,30 @@ elseif (! empty($object->id)) // TODO Use the predefinedproductline_create.tpl.php file // Add free products/services form + + //Fix Bug [ bug #1254 ] Error when using "Enter" on qty input box of a product + //this Fix Will be obsolete in 3.6 because 3.6 get one form to do every things + if (! empty($conf->use_javascript_ajax)) { + print ''; + } + $var=true; print '
'; @@ -1755,22 +1779,40 @@ elseif (! empty($object->id)) print ''; print $form->load_tva('tva_tx',(GETPOST('tva_tx')?GETPOST('tva_tx'):-1),$object->thirdparty,$mysoc); print '%%
'; From 46e54ac64e13e9096bffd9b1b33d255121a02ac1 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 20 Jun 2014 10:53:56 +0200 Subject: [PATCH 35/41] Fix 1455 outstanding amount --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index e1fae9fe46a..e58ff47a9b1 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2870,7 +2870,7 @@ class Societe extends CommonObject // Set outstanding amount $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET "; - $sql.= " outstanding_limit= ".($outstanding!=''?$outstanding:'null'); + $sql.= " outstanding_limit= '".($outstanding!=''?$outstanding:'null')."'"; $sql.= " WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::set_outstanding sql=".$sql); From 8ce8bf47ee5259dccdf8db8ade7044062061df80 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Jun 2014 12:48:08 +0200 Subject: [PATCH 36/41] Fix: The object deliverycompany was not used anymore and output of details for delivery reports was lost during 3.5. Rewrite code to restore feature. Conflicts: htdocs/core/modules/expedition/doc/pdf_merou.modules.php htdocs/core/modules/expedition/doc/pdf_rouget.modules.php --- ChangeLog | 3 ++ htdocs/core/lib/pdf.lib.php | 32 ++++++++----------- .../expedition/doc/pdf_merou.modules.php | 3 +- .../expedition/doc/pdf_rouget.modules.php | 6 ++-- 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index c44642dd3f4..c07a2d37bff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ English Dolibarr ChangeLog -------------------------------------------------------------- ***** ChangeLog for 3.5.4 compared to 3.5.3 ***** +Fix: The object deliverycompany was not used anymore and output of + details for delivery reports was lost during 3.5. Rewrite code to + restore feature. Fix: [ bug #1445 ] html fix : missing
'.$langs->trans("None").'
\n"; @@ -1140,9 +1140,9 @@ elseif (! empty($object->id)) $title=$langs->trans("SupplierOrder"); dol_fiche_head($head, 'card', $title, 0, 'order'); - + $res=$object->fetch_optionals($object->id,$extralabels); - + /* * Confirmation de la suppression de la commande */ @@ -1470,7 +1470,7 @@ elseif (! empty($object->id)) } } } - + // Ligne de 3 colonnes print ''.$langs->trans("AmountHT").''; print ''.price($object->total_ht).''; @@ -1731,30 +1731,30 @@ elseif (! empty($object->id)) // TODO Use the predefinedproductline_create.tpl.php file // Add free products/services form - + //Fix Bug [ bug #1254 ] Error when using "Enter" on qty input box of a product //this Fix Will be obsolete in 3.6 because 3.6 get one form to do every things if (! empty($conf->use_javascript_ajax)) { print ''; } - + $var=true; print ''; print ''; @@ -1788,26 +1788,26 @@ elseif (! empty($object->id)) // Ajout de produits/services predefinis if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { - + if (! empty($conf->use_javascript_ajax)) { print '