diff --git a/ChangeLog b/ChangeLog index 8bc845021b6cb6a96c953d7400c304dc3ca367c4..960bc09756beace10f666ec89986daa65b410c88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -237,6 +237,7 @@ FIX [ bug #3198 ] Trigger LINECONTRACT_INSERT passes Contrat as $object instead FIX: Not showing delivery date on rouget pdf FIX: Not showing task extrafields when creating from left menu FIX [ bug #3288 ] Tasks box is not properly drawn +FIX [ bug #3211 ] Outstading bill amount of a client showed wrong amounts NEW: Created new ContratLigne::insert function @@ -684,6 +685,9 @@ 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 +Fix: [ bug #3206 ] PropaleLigne, OrderLine and FactureLigne given to triggers through update function does not contain all the information +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/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 9920a231841e02bf6b43f0d94e3e84d30844ef1c..77c4e5c6f76435b9223af605471d4e9598351504 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -643,15 +643,15 @@ 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); - $this->line->context = $this->context; + $staticline = clone $line; - // Stock previous line records - $staticline=new PropaleLigne($this->db); - $staticline->fetch($rowid); - $this->line->oldline = $staticline; + $line->oldline = $staticline; + $this->line = $line; + $this->line->context = $this->context; // Reorder if fk_parent_line change if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line) @@ -1062,9 +1062,9 @@ class Propal extends CommonObject function createFromClone($socid=0) { global $db, $user,$langs,$conf,$hookmanager; - + dol_include_once('/projet/class.project.class.php'); - + $this->context['createfromclone']='createfromclone'; $error=0; @@ -1089,16 +1089,16 @@ class Propal extends CommonObject $this->socid = $objsoc->id; $this->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); $this->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); - + $project = new Project($db); - + if($objFrom->fk_project > 0 && $project->fetch($objFrom->fk_project)) { if($project->socid <= 0) $this->fk_project = $objFrom->fk_project; else $this->fk_project = ''; } else { $this->fk_project = ''; } - + $this->fk_delivery_address = ''; } @@ -3107,10 +3107,12 @@ class PropaleLigne extends CommonObjectLine $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 c941dfc1ff8eaf51793f4cdabaecab1aea1cb04b..4a037ba486a1b0437c9a2b12095b77c559cdcf95 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1112,10 +1112,10 @@ class Commande extends CommonOrder // get extrafields from original line $object->fetch_optionals($object->id); - + $e = new ExtraFields($db); $element_extrafields = $e->fetch_name_optionals_label($this->element); - + foreach($object->array_options as $options_key => $value) { if(array_key_exists(str_replace('options_', '', $options_key), $element_extrafields)){ $this->array_options[$options_key] = $value; @@ -2503,15 +2503,15 @@ 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); - $this->line->context = $this->context; + $staticline = clone $line; - // Stock previous line records - $staticline=new OrderLine($this->db); - $staticline->fetch($rowid); - $this->line->oldline = $staticline; + $line->oldline = $staticline; + $this->line = $line; + $this->line->context = $this->context; // Reorder if fk_parent_line change if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line) @@ -3471,10 +3471,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 8ccf4107ee74aadef9aa0816ff182224d94483f1..72aa176b7b6ac9d9f93435766ae7ca49beac0d27 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1244,7 +1244,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 dbbc1d88212bbe98b3a54ada72cc933ec7adb5a0..2d70166a49f0c703cf0a6da077be75b77d0a86c6 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2345,15 +2345,25 @@ class Facture extends CommonInvoice $pu_tva = $tabprice[4]; $pu_ttc = $tabprice[5]; - // Update line into database - $this->line=new FactureLigne($this->db); + // Old properties: $price, $remise (deprecated) + $price = $pu; + $remise = 0; + if ($remise_percent > 0) + { + $remise = round(($pu * $remise_percent / 100),2); + $price = ($pu - $remise); + } + $price = price2num($price); - $this->line->context = $this->context; + //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; + $this->line->context = $this->context; // Reorder if fk_parent_line change if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line) @@ -3843,10 +3853,12 @@ class FactureLigne extends CommonInvoiceLine $this->fk_prev_id = $objp->fk_prev_id; $this->db->free($result); + + return 1; } else { - dol_print_error($this->db); + return -1; } } diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index e695fad05720edc0ea37293af5d55a6e14406e7e..5229a0e8416e444839dcc96bbc76d9f624a43a29 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -65,8 +65,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); @@ -78,7 +78,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); diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index b7607e3920e6ad83de866aa869580d62ff5833a6..de2870d7a9f241fbb9d90723098deec43f9ad38f 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1334,7 +1334,6 @@ print $sql; $this->db->begin(); - //var_dump($this->menu); exit; foreach ($this->menu as $key => $value) { $menu = new Menubase($this->db); @@ -1343,11 +1342,9 @@ print $sql; 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 diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index ab2a25e98c48e566f81d2aac3b5042dbc7b45e57..3699399bdca417b0239a751804e55432d7ad1cf7 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1192,6 +1192,8 @@ class Expedition extends CommonObject $line->details_entrepot[] = $detail_entrepot; $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->fk_product = $obj->fk_product; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index fba9bdd30be3936bb6738b90b14834427d8a2970..a6438d4709bbcab538be272f6ca7179c408986dc 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3291,6 +3291,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);