diff --git a/ChangeLog b/ChangeLog index 61ef5f890d1..7e2babf155f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -382,6 +382,11 @@ Fix: [ bug #1757 ] Sorting breaks product/service statistics Fix: [ bug #1797 ] Tulip supplier invoice module takes creation date instead of invoice date Fix: [ bug #1792 ] Users are not allowed to see margins module index page when no product view permission is enabled Fix: [ bug #1846 ] Browser IE11 not detected +Fix: [ bug #1906 ] Deplacement does not allow translated decimal format +Fix: [ bug #1905 ] Custom deplacement types do not get translated in deplacement card +Fix: [ bug #2583 ] Unable to create a bank transfer with localized numbers +Fix: [ bug #2577 ] Incorrect invoice status in "Linked objects" page of a project +Fix: [ bug #2576 ] Unable to edit a dictionary entry that has # in its ref ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 05402898ee6..ae5326547ba 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -6,7 +6,7 @@ * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2011 Philippe Grand * Copyright (C) 2011 Remy Younes - * Copyright (C) 2012-2013 Marcos García + * Copyright (C) 2012-2015 Marcos García * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2011-2014 Alexandre Spangaro * @@ -1217,7 +1217,7 @@ if ($id) if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; } if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO')) || in_array($obj->type, array('systemauto'))) { $isdisable=0; $isdisable = 0; } - $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?$obj->code:'').'&id='.$id.'&'; + $url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):'').'&id='.$id.'&'; // Favorite // Only activated on country dictionary diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php index 3881efd5c9b..440244c77e8 100644 --- a/htdocs/compta/bank/virement.php +++ b/htdocs/compta/bank/virement.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copytight (C) 2005-2009 Regis Houssin * Copytight (C) 2012 Juanjo Menent + * Copyright (C) 2015 Marcos García * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -47,7 +48,7 @@ if ($action == 'add') $dateo = dol_mktime(12,0,0,GETPOST('remonth','int'),GETPOST('reday','int'),GETPOST('reyear','int')); $label = GETPOST('label','alpha'); - $amount= GETPOST('amount','int'); + $amount= GETPOST('amount'); if (! $label) { diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 407edf6332e..3676a87567d 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -427,11 +427,13 @@ else if ($id) print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', ''); print ''; - // Type + $form->load_cache_types_fees(); + + // Type print ''; print $form->editfieldkey("Type",'type',$langs->trans($object->type),$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'select:types_fees'); print ''; - print $form->editfieldval("Type",'type',$langs->trans($object->type),$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'select:types_fees'); + print $form->editfieldval("Type",'type',$form->cache_types_fees[$object->type],$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'select:types_fees'); print ''; // Who diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index d0ce1609b2a..5e893fe7d1e 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -683,13 +683,12 @@ if ($resql) print ''.price($objp->total_ttc).''; print ''; $cn=$facturestatic->getSumCreditNotesUsed(); - if (! empty($objp->am)) print price($objp->am); - if (! empty($objp->am) && ! empty($cn)) print '+'; - if (! empty($cn)) print price($cn); + $dep=$facturestatic->getSumDepositsUsed(); + print price($objp->am + $cn + $dep); print ''; // Remain to receive - print ''.((! empty($objp->am) || ! empty($cn))?price($objp->total_ttc-$objp->am-$cn):' ').''; + print ''.price($objp->total_ttc-$objp->am-$cn-$dep).''; // Status of invoice print ''; @@ -719,7 +718,7 @@ if ($resql) $total_ht+=$objp->total_ht; $total_tva+=($objp->total_tva + $tx1 + $tx2 + $revenuestamp); $total_ttc+=$objp->total_ttc; - $total_paid+=$objp->am + $cn; + $total_paid+=$objp->am + $cn + $dep; $i++; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c909df601f8..794661776f7 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -204,7 +204,7 @@ class Form else { if ($typeofdata == 'email') $ret.=dol_print_email($value,0,0,0,0,1); - elseif ($typeofdata == 'amount') $ret.=($value != '' ? price($value,'',$langs,0,0,-1,$conf->currency) : ''); + elseif ($typeofdata == 'amount') $ret.=($value != '' ? price($value,'',$langs,0,-1,-1,$conf->currency) : ''); elseif (preg_match('/^text/',$typeofdata) || preg_match('/^note/',$typeofdata)) $ret.=dol_htmlentitiesbr($value); elseif ($typeofdata == 'day' || $typeofdata == 'datepicker') $ret.=dol_print_date($value,'day'); elseif ($typeofdata == 'datehourpicker') $ret.=dol_print_date($value,'dayhour'); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 6b94b251d50..5b988e602f0 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -134,8 +134,8 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0) } // Financial - $tmpentry=array('enabled'=>(! empty($conf->comptabilite->enabled) || ! empty($conf->accounting->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->don->enabled) || ! empty($conf->tax->enabled) || ! empty($conf->salaries->enabled)), - 'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->plancompte->lire) || ! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read)), + $tmpentry=array('enabled'=>(! empty($conf->comptabilite->enabled) || ! empty($conf->accounting->enabled) || ! empty($conf->facture->enabled) || ! empty($conf->don->enabled) || ! empty($conf->tax->enabled) || ! empty($conf->salaries->enabled) || ! empty($conf->fournisseur->enabled)), + 'perms'=>(! empty($user->rights->compta->resultat->lire) || ! empty($user->rights->accounting->plancompte->lire) || ! empty($user->rights->facture->lire) || ! empty($user->rights->don->lire) || ! empty($user->rights->tax->charges->lire) || ! empty($user->rights->salaries->read) || ! empty($user->rights->fournisseur->facture->lire)), 'module'=>'comptabilite|accounting|facture|don|tax|salaries'); $showmode=dol_eldy_showmenu($type_user, $tmpentry, $listofmodulesforexternal); if ($showmode) diff --git a/htdocs/core/modules/modProjet.class.php b/htdocs/core/modules/modProjet.class.php index 97ddc6afaba..6bc21adb445 100644 --- a/htdocs/core/modules/modProjet.class.php +++ b/htdocs/core/modules/modProjet.class.php @@ -188,7 +188,7 @@ class modProjet extends DolibarrModules $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]='ProjectsAndTasksLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r]=array(array("projet","export")); - $this->export_dependencies_array[$r]=array('task_time'=>'ppt.rowid'); + $this->export_dependencies_array[$r]=array('task_time'=>'pt.rowid'); $this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label', 's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text', diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index d9539f17eb4..73f23b930ac 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -136,6 +136,7 @@ if (empty($reshook)) $object->socid = $objectsrc->socid; $object->ref_customer = $objectsrc->ref_client; + $object->model_pdf = GETPOST('model'); $object->date_delivery = $date_delivery; // Date delivery planed $object->fk_delivery_address = $objectsrc->fk_delivery_address; $object->shipping_method_id = GETPOST('shipping_method_id','int'); @@ -722,6 +723,14 @@ if ($action == 'create') print ''; print "\n"; + // Document model + print "".$langs->trans("Model").""; + print ''; + include_once DOL_DOCUMENT_ROOT . '/core/modules/expedition/modules_expedition.php'; + $liste = ModelePdfExpedition::liste_modeles($db); + print $form->selectarray('model', $liste, $conf->global->EXPEDITION_ADDON_PDF); + print "\n"; + // Other attributes $parameters=array('colspan' => ' colspan="3"'); $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$expe,$action); // Note that $action and $object may have been modified by hook diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 3f96454e8de..19450220824 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -178,8 +178,6 @@ class Expedition extends CommonObject $now=dol_now(); - if (empty($this->model_pdf)) $this->model_pdf=$conf->global->EXPEDITION_ADDON_PDF; - require_once DOL_DOCUMENT_ROOT .'/product/stock/class/mouvementstock.class.php'; $error = 0; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 378f6e947b6..f5996c9c9f8 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -395,7 +395,14 @@ foreach ($listofreferent as $key => $value) else print ''; // Status - print ''.$element->getLibStatut(5).''; + print ''; + if ($element instanceof CommonInvoice) { + //This applies for Facture and FactureFournisseur + print $element->getLibStatut(5, $element->getSommePaiement()); + } else { + print $element->getLibStatut(5); + } + print ''; print ''; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 181c9f3ec8d..3c21959dfec 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3156,7 +3156,7 @@ class Societe extends CommonObject $alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT'); $remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT'); */ - $sql = "SELECT sum(total) as amount FROM ".MAIN_DB_PREFIX."facture as f"; + $sql = "SELECT rowid, total_ttc FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " WHERE fk_soc = ". $this->id; $sql .= " AND paye = 0"; $sql .= " AND fk_statut <> 0"; // Not a draft @@ -3167,8 +3167,17 @@ class Societe extends CommonObject $resql=$this->db->query($sql); if ($resql) { - $obj=$this->db->fetch_object($resql); - return ($obj->amount); + $outstandingBill = 0; + $facturestatic=new Facture($this->db); + while($obj=$this->db->fetch_object($resql)) { + $facturestatic->id=$obj->rowid; + $paiement = $facturestatic->getSommePaiement(); + $creditnotes = $facturestatic->getSumCreditNotesUsed(); + $deposits = $facturestatic->getSumDepositsUsed(); + + $outstandingBill+= $obj->total_ttc - $paiement - $creditnotes - $deposits; + } + return $outstandingBill; } else return 0;