From 4649cf72105f646ab76e5fa2a626399a742dbf17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sat, 18 Jul 2015 19:37:58 +0200 Subject: [PATCH 1/6] Fix: [ bug #3206 ] PropaleLigne, OrderLine and FactureLigne given to triggers through update function does not contain all the information Close #3206 --- ChangeLog | 1 + htdocs/comm/propal/class/propal.class.php | 13 +++++++------ htdocs/commande/class/commande.class.php | 13 +++++++------ htdocs/compta/facture/class/facture.class.php | 13 +++++++------ 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index ab5fa93f635..94ef071cfea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,7 @@ Fix: [ bug #2861 ] Undefined variable $res when migrating Fix: [ bug #2837 ] Product list table column header does not match column body Fix: [ bug #2835 ] Customer prices of a product shows incorrect history order Fix: [ bug #2814 ] JPEG photos are not displayed in Product photos page +Fix: [ bug #3206 ] PropaleLigne, OrderLine and FactureLigne given to triggers through update function does not contain all the information ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 507a9dce633..29480acd60d 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -528,13 +528,14 @@ class Propal extends CommonObject $price = $pu - $remise; } - // Update line - $this->line=new PropaleLigne($this->db); + //Fetch current line from the database and then clone the object and set it in $oldline property + $line = new PropaleLigne($this->db); + $line->fetch($rowid); - // Stock previous line records - $staticline=new PropaleLigne($this->db); - $staticline->fetch($rowid); - $this->line->oldline = $staticline; + $staticline = clone $line; + + $line->oldline = $staticline; + $this->line = $line; // Reorder if fk_parent_line change if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index d1a776d3d24..78a5a89047a 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2349,13 +2349,14 @@ class Commande extends CommonOrder $price = ($pu - $remise); } - // Update line - $this->line=new OrderLine($this->db); + //Fetch current line from the database and then clone the object and set it in $oldline property + $line = new OrderLine($this->db); + $line->fetch($rowid); - // Stock previous line records - $staticline=new OrderLine($this->db); - $staticline->fetch($rowid); - $this->line->oldline = $staticline; + $staticline = clone $line; + + $line->oldline = $staticline; + $this->line = $line; // Reorder if fk_parent_line change if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 0d91d7944b8..eaa4c183a29 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2224,13 +2224,14 @@ class Facture extends CommonInvoice } $price = price2num($price); - // Update line into database - $this->line=new FactureLigne($this->db); + //Fetch current line from the database and then clone the object and set it in $oldline property + $line = new FactureLigne($this->db); + $line->fetch($rowid); - // Stock previous line records - $staticline=new FactureLigne($this->db); - $staticline->fetch($rowid); - $this->line->oldline = $staticline; + $staticline = clone $line; + + $line->oldline = $staticline; + $this->line = $line; // Reorder if fk_parent_line change if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line) From cc8eac67d95feeabfc5fec175773b619923a9411 Mon Sep 17 00:00:00 2001 From: Gauthier Date: Wed, 29 Jul 2015 12:29:33 +0200 Subject: [PATCH 2/6] FIX : Display country name instead of country id (display country id makes no sense on vcard files) --- htdocs/contact/vcard.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index 5d71ba88f26..9350ac066cf 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -64,8 +64,8 @@ $v->setPhoneNumber($contact->phone_pro, "PREF;WORK;VOICE"); $v->setPhoneNumber($contact->phone_mobile, "CELL;VOICE"); $v->setPhoneNumber($contact->fax, "WORK;FAX"); -$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country_id:''), "WORK;POSTAL"); -$v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country_id:''), "WORK"); +$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country:''), "WORK;POSTAL"); +$v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->country:''), "WORK"); $v->setEmail($contact->email,'internet,pref'); $v->setNote($contact->note); @@ -77,7 +77,7 @@ if ($company->id) $v->setURL($company->url, "WORK"); if (! $contact->phone_pro) $v->setPhoneNumber($company->phone, "WORK;VOICE"); if (! $contact->fax) $v->setPhoneNumber($company->fax, "WORK;FAX"); - if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country_code, "WORK;POSTAL"); + if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country, "WORK;POSTAL"); if ($company->email != $contact->email) $v->setEmail($company->email,'internet'); // Si contact lie a un tiers non de type "particulier" if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->name); From 9e05cecc1a2459796cda049b2e4567f2685baf34 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 31 Jul 2015 16:31:12 +0200 Subject: [PATCH 3/6] Fix : rowid was missing on expedition line so no origin id when creating an invoice --- htdocs/expedition/class/expedition.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index ce9885c1f1a..2e591bf67be 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1105,6 +1105,8 @@ class Expedition extends CommonObject $obj = $this->db->fetch_object($resql); $line->line_id = $obj->line_id; + $line->rowid = $obj->line_id; // TODO deprecated + $line->id = $obj->line_id; $line->fk_origin_line = $obj->fk_origin_line; $line->origin_line_id = $obj->fk_origin_line; // TODO deprecated $line->entrepot_id = $obj->fk_entrepot; From 7cb564586ea3033fabb92c61756f51722bd287ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 9 Aug 2015 13:52:02 +0200 Subject: [PATCH 4/6] Fix: [ bug #3310 ] OrderLine::fetch, FactureLigne::fetch and PropaleLigne::fetch do not return anything Close #3310 --- ChangeLog | 1 + htdocs/comm/propal/class/propal.class.php | 4 +++- htdocs/commande/class/commande.class.php | 4 +++- htdocs/compta/bank/class/account.class.php | 1 - htdocs/compta/facture/class/facture.class.php | 4 +++- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6165077d1ca..7662760ad01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,7 @@ Fix: [ bug #2570 ] [Contacts] Page should not process if ID is invalid Fix: [ bug #3268 ] SQL error when accessing thirdparty log page without a socid parameter Fix: [ bug #3180 ] formObjectOptions hook when editing thirdparty card does not print result Fix: [ bug #1791 ] Margin menu not available if any Finance module is not enabled +Fix: [ bug #3310 ] OrderLine::fetch, FactureLigne::fetch and PropaleLigne::fetch do not return anything ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 1a800dbf944..9cbb6e632fb 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2845,10 +2845,12 @@ class PropaleLigne extends CommonObject $this->date_end = $this->db->jdate($objp->date_end); $this->db->free($result); + + return 1; } else { - dol_print_error($this->db); + return -1; } } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index d1a776d3d24..a01e2df27c9 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3156,10 +3156,12 @@ class OrderLine extends CommonOrderLine $this->date_end = $this->db->jdate($objp->date_end); $this->db->free($result); + + return 1; } else { - dol_print_error($this->db); + return -1; } } diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 97e7543a030..77df9e6a3b2 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1133,7 +1133,6 @@ class AccountLine extends CommonObject } else { - dol_print_error($this->db); return -1; } } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 0d91d7944b8..79de4dbdb8a 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3471,10 +3471,12 @@ class FactureLigne extends CommonInvoiceLine $this->product_desc = $objp->product_desc; $this->db->free($result); + + return 1; } else { - dol_print_error($this->db); + return -1; } } From f3ef4fed93cc45bc310b54810ff0198b4121038c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 9 Aug 2015 13:58:03 +0200 Subject: [PATCH 5/6] Fix: [ bug #3313 ] Error enabling module with PostgreSQL database Close #3313 --- ChangeLog | 1 + htdocs/core/class/menubase.class.php | 2 +- htdocs/core/modules/DolibarrModules.class.php | 3 --- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6165077d1ca..d3347fc30f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,7 @@ Fix: [ bug #2570 ] [Contacts] Page should not process if ID is invalid Fix: [ bug #3268 ] SQL error when accessing thirdparty log page without a socid parameter Fix: [ bug #3180 ] formObjectOptions hook when editing thirdparty card does not print result Fix: [ bug #1791 ] Margin menu not available if any Finance module is not enabled +Fix: [ bug #3313 ] Error enabling module with PostgreSQL database ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index 961cfd5733c..570da8b27fa 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -152,7 +152,7 @@ class Menubase $sql.= " '".$this->fk_menu."',"; $sql.= " ".($this->fk_mainmenu?"'".$this->fk_mainmenu."'":"null").","; $sql.= " ".($this->fk_leftmenu?"'".$this->fk_leftmenu."'":"null").","; - $sql.= " '".$this->position."',"; + $sql.= " '".(int) $this->position."',"; $sql.= " '".$this->db->escape($this->url)."',"; $sql.= " '".$this->db->escape($this->target)."',"; $sql.= " '".$this->db->escape($this->titre)."',"; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index be498b04413..a9b80cef13e 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1009,7 +1009,6 @@ abstract class DolibarrModules $this->db->begin(); - //var_dump($this->menu); exit; foreach ($this->menu as $key => $value) { $menu = new Menubase($this->db); @@ -1018,11 +1017,9 @@ abstract class DolibarrModules if (! $this->menu[$key]['fk_menu']) { $menu->fk_menu=0; - //print 'aaa'.$this->menu[$key]['fk_menu']; } else { - //print 'xxx'.$this->menu[$key]['fk_menu'];exit; $foundparent=0; $fk_parent=$this->menu[$key]['fk_menu']; if (preg_match('/^r=/',$fk_parent)) // old deprecated method From 2f6587b48ecc8c1554f2194503796c0f034909be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 9 Aug 2015 18:08:22 +0200 Subject: [PATCH 6/6] FIX [ bug #3211 ] Error about sold to pay (Montant encours) Close #3211 --- ChangeLog | 1 + htdocs/societe/class/societe.class.php | 1 + 2 files changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index e4815781cd0..119556ecc2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,7 @@ FIX [ bug 1925 ] "Link to order" option in supplier invoices is not working prop FIX [ bug #3198 ] Trigger LINECONTRACT_INSERT passes Contrat as $object instead of ContratLigne FIX: Not showing delivery date on rouget pdf FIX: Not showing task extrafields when creating from left menu +FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts NEW: Created new ContratLigne::insert function diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 649af79e6cc..0869f46c575 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3162,6 +3162,7 @@ class Societe extends CommonObject $sql .= " AND fk_statut <> 0"; // Not a draft //$sql .= " AND (fk_statut <> 3 OR close_code <> 'abandon')"; // Not abandonned for undefined reason $sql .= " AND fk_statut <> 3"; // Not abandonned + $sql .= " AND fk_statut <> 2"; // Not clasified as paid dol_syslog("get_OutstandingBill", LOG_DEBUG); $resql=$this->db->query($sql);