From 89547dde37dcc0acc19e731333c64ec8b5d05916 Mon Sep 17 00:00:00 2001 From: frederic34 Date: Wed, 11 Jun 2014 17:42:03 +0200 Subject: [PATCH 01/10] Display the total by currency account --- htdocs/compta/bank/index.php | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index cf43fc578fb..e98d8978440 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -90,7 +90,7 @@ print ''.$langs->trans("Status").''; print ''.$langs->trans("BankBalance").''; print "\n"; -$total = 0; $found = 0; +$total = array(); $found = 0; $var=true; foreach ($accounts as $key=>$type) { @@ -119,17 +119,19 @@ foreach ($accounts as $key=>$type) print ''; print ''.$acc->getLibStatut(2).''; print ''; - print ''.price($solde).''; + print ''.price($solde, 0, $langs, 0, 0, -1, $acc->currency_code).''; print ''; print ''; - $total += $solde; + $total[$acc->currency_code] += $solde; } } if (! $found) print ''.$langs->trans("None").''; // Total -print ''.$langs->trans("Total").''.price($total).''; - +foreach ($total as $key=>$solde) +{ + print ''.$langs->trans("Total ").$key.''.price($solde, 0, $langs, 0, 0, -1, $key).''; +} //print ' '; @@ -144,7 +146,7 @@ print ''.$langs->trans("Status").''; print ''.$langs->trans("BankBalance").''; print "\n"; -$total = 0; $found = 0; +$total = array(); $found = 0; $var=true; foreach ($accounts as $key=>$type) { @@ -165,16 +167,19 @@ foreach ($accounts as $key=>$type) print ' '; print ''.$acc->getLibStatut(2).''; print ''; - print ''.price($solde).''; + print ''.price($solde, 0, $langs, 0, 0, -1, $acc->currency_code).''; print ''; print ''; - $total += $solde; + $total[$acc->currency_code] += $solde; } } if (! $found) print ''.$langs->trans("None").''; // Total -print ''.$langs->trans("Total").''.price($total).''; +foreach ($total as $key=>$solde) +{ + print ''.$langs->trans("Total ").$key.''.price($solde, 0, $langs, 0, 0, -1, $key).''; +} @@ -193,7 +198,7 @@ print ''.$langs->trans("Status").''; print ''.$langs->trans("BankBalance").''; print "\n"; -$total = 0; $found = 0; +$total = array(); $found = 0; $var=true; foreach ($accounts as $key=>$type) { @@ -222,16 +227,19 @@ foreach ($accounts as $key=>$type) print ''; print ''.$acc->getLibStatut(2).''; print ''; - print ''.price($solde).''; + print ''.price($solde, 0, $langs, 0, 0, -1, $acc->currency_code).''; print ''; print ''; - $total += $solde; + $total[$acc->currency_code] += $solde; } } if (! $found) print ''.$langs->trans("None").''; // Total -print ''.$langs->trans("Total").''.price($total).''; +foreach ($total as $key=>$solde) +{ + print ''.$langs->trans("Total ").$key.''.price($solde, 0, $langs, 0, 0, -1, $key).''; +} print ""; From 56069baac8087b02d1e935ffc340fccecfc46de6 Mon Sep 17 00:00:00 2001 From: fmarcet Date: Wed, 11 Jun 2014 17:51:50 +0200 Subject: [PATCH 02/10] Fix: When you remove a right ended in 0, removes all module rights --- htdocs/user/class/usergroup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index a8ab0dc5ebb..bc8e14aafd1 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -385,7 +385,7 @@ class UserGroup extends CommonObject // Pour compatibilite, si lowid = 0, on est en mode suppression de tout // TODO A virer quand sera gere par l'appelant - if (substr($rid,-1,1) == 0) $wherefordel="module='$module'"; + //if (substr($rid,-1,1) == 0) $wherefordel="module='$module'"; } else { // Where pour la liste des droits a supprimer From 88c5d6e5d100e8080f3ee5f588afe344dc81aba4 Mon Sep 17 00:00:00 2001 From: frederic34 Date: Wed, 11 Jun 2014 18:01:14 +0200 Subject: [PATCH 03/10] Display the total with currency --- htdocs/compta/bank/account.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 27690ae7093..0e16f6744fd 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -784,8 +784,8 @@ if ($id > 0 || ! empty($ref)) print ''; if ($sep > 0) print ' '; // If we had at least one line in future else print $langs->trans("CurrentBalance"); - print ''; - print ''.price($total).''; + print ' '.$object->currency_code.''; + print ''.price($total, 0, $langs, 0, 0, -1, $object->currency_code).''; print ' '; print ''; } From b090af9ccaf50bc43b545d5f0f7df43a62bc3940 Mon Sep 17 00:00:00 2001 From: KreizIT Date: Thu, 12 Jun 2014 15:43:40 +0200 Subject: [PATCH 04/10] FIX[ bug #1444 ] Shipment product batch is not proposed --- htdocs/expedition/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 1fd33b29c53..f203896f7b8 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -863,7 +863,7 @@ if ($action == 'create') if (($line->product_type == 1 && empty($conf->global->STOCK_SUPPORTS_SERVICES)) || $defaultqty < 0) $defaultqty=0; } - if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() and is_array($product->stock_warehouse[GETPOST('entrepot_id','int')]))) + if (empty($conf->productbatch->enabled) || ! ($product->hasbatch() and is_object($product->stock_warehouse[GETPOST('entrepot_id','int')]))) { // Quantity to send print ''; From 3c3bc8b769911c1fe820f737aa0cb12ca363309b Mon Sep 17 00:00:00 2001 From: KreizIT Date: Thu, 12 Jun 2014 16:29:03 +0200 Subject: [PATCH 05/10] FIX [ bug #1308 ] Stock movements on a product with batch --- htdocs/expedition/class/expedition.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 5cf09642c68..b7a94bc28c4 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1128,6 +1128,10 @@ class Expedition extends CommonObject // Eat-by date if (! empty($conf->productbatch->enabled)) { + /* test on conf at begining of file sometimes doesn't include expeditionbatch + * May be conf is not well initialized for dark reason + */ + require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionbatch.class.php'; $line->detail_batch=ExpeditionLigneBatch::FetchAll($this->db,$obj->line_id); } $this->lines[$i] = $line; From 18080deb932b00e486b723e3c352a1fbd32d57e3 Mon Sep 17 00:00:00 2001 From: philippe Date: Fri, 13 Jun 2014 12:16:49 +0200 Subject: [PATCH 06/10] Fix num paiement was not displayed --- htdocs/fourn/paiement/fiche.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/paiement/fiche.php b/htdocs/fourn/paiement/fiche.php index 8b58e7a4455..9a38e16f7f4 100644 --- a/htdocs/fourn/paiement/fiche.php +++ b/htdocs/fourn/paiement/fiche.php @@ -103,7 +103,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->fournisse } } -if ($action == 'setnum' && ! empty($_POST['num_paiement'])) +if ($action == 'setnum_paiement' && ! empty($_POST['num_paiement'])) { $object->fetch($id); $res = $object->update_num($_POST['num_paiement']); From e8bca38daf26aafbc6edff72d012372557e983b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Jun 2014 13:41:15 +0200 Subject: [PATCH 07/10] Fix: syntax error --- htdocs/projet/class/project.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 1186de5e4ad..77591686983 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -83,6 +83,8 @@ class Project extends CommonObject $error = 0; $ret = 0; + $now=dol_now(); + // Check parameters if (!trim($this->ref)) { @@ -113,9 +115,9 @@ class Project extends CommonObject $sql.= ", " . $user->id; $sql.= ", 0"; $sql.= ", " . ($this->public ? 1 : 0); - $sql.= ", " . $this->db->idate(dol_now()); - $sql.= ", " . ($this->date_start != '' ? $this->db->idate($this->date_start) : 'null'); - $sql.= ", " . ($this->date_end != '' ? $this->db->idate($this->date_end) : 'null'); + $sql.= ", '".$this->db->idate($now)."'"; + $sql.= ", " . ($this->date_start != '' ? "'".$this->db->idate($this->date_start)."'" : 'null'); + $sql.= ", " . ($this->date_end != '' ? "'".$this->db->idate($this->date_end)."'" : 'null'); $sql.= ", ".$conf->entity; $sql.= ")"; From f0ce92292a28da61dd1b427170bd3563f108a905 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Jun 2014 14:20:58 +0200 Subject: [PATCH 08/10] Fix: date start/end of project was lost on some tabs. Fix: Bad file name for gantt include. --- htdocs/projet/contact.php | 10 ++++++++++ htdocs/projet/element.php | 10 ++++++++++ .../{ganttchart.php => ganttchart.inc.php} | 2 +- htdocs/projet/ganttview.php | 17 ++++++++++++++--- htdocs/projet/note.php | 10 ++++++++++ htdocs/projet/tasks.php | 4 ++-- htdocs/projet/tasks/contact.php | 10 ++++++++++ htdocs/projet/tasks/document.php | 10 ++++++++++ htdocs/projet/tasks/note.php | 10 ++++++++++ htdocs/projet/tasks/task.php | 10 ++++++++++ htdocs/projet/tasks/time.php | 10 ++++++++++ 11 files changed, 97 insertions(+), 6 deletions(-) rename htdocs/projet/{ganttchart.php => ganttchart.inc.php} (99%) diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 97b489cc3e4..c6880547c60 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -192,6 +192,16 @@ if ($id > 0 || ! empty($ref)) // Statut print ''.$langs->trans("Status").''.$object->getLibStatut(4).''; + // Date start + print ''.$langs->trans("DateStart").''; + print dol_print_date($object->date_start,'day'); + print ''; + + // Date end + print ''.$langs->trans("DateEnd").''; + print dol_print_date($object->date_end,'day'); + print ''; + print ""; print ''; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 04164a38579..322820b361d 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -128,6 +128,16 @@ print ''; // Statut print ''.$langs->trans("Status").''.$project->getLibStatut(4).''; +// Date start +print ''.$langs->trans("DateStart").''; +print dol_print_date($object->date_start,'day'); +print ''; + +// Date end +print ''.$langs->trans("DateEnd").''; +print dol_print_date($object->date_end,'day'); +print ''; + print ''; print ''; diff --git a/htdocs/projet/ganttchart.php b/htdocs/projet/ganttchart.inc.php similarity index 99% rename from htdocs/projet/ganttchart.php rename to htdocs/projet/ganttchart.inc.php index b3701191142..7b4249a0128 100644 --- a/htdocs/projet/ganttchart.php +++ b/htdocs/projet/ganttchart.inc.php @@ -16,7 +16,7 @@ */ /** - * \file htdocs/projet/ganttchart.php + * \file htdocs/projet/ganttchart.inc.php * \ingroup projet * \brief Gantt diagram of a project */ diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 77767fd446f..79d302addd3 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -137,6 +137,17 @@ if ($id > 0 || ! empty($ref)) // Statut print ''.$langs->trans("Status").''.$object->getLibStatut(4).''; + // Date start + print ''.$langs->trans("DateStart").''; + print dol_print_date($object->date_start,'day'); + print ''; + + // Date end + print ''.$langs->trans("DateEnd").''; + print dol_print_date($object->date_end,'day'); + print ''; + + print ''; print ''; @@ -184,8 +195,8 @@ if (count($tasksarray)>0) // Show Gant diagram from $taskarray using JSGantt - $dateformat=$langs->trans("FormatDateShort"); // Used by include ganttchart.php later - $dateformat=$langs->trans("FormatDateShortJQuery"); // Used by include ganttchart.php later + $dateformat=$langs->trans("FormatDateShort"); // Used by include ganttchart.inc.php later + $dateformat=$langs->trans("FormatDateShortJQuery"); // Used by include ganttchart.inc.php later $array_contacts=array(); $tasks=array(); $project_dependencies=array(); @@ -244,7 +255,7 @@ if (count($tasksarray)>0) { //var_dump($_SESSION); print '
'."\n"; - include_once DOL_DOCUMENT_ROOT.'/projet/ganttchart.php'; + include_once DOL_DOCUMENT_ROOT.'/projet/ganttchart.inc.php'; print '
'."\n"; } else diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php index 710d4b9f50d..493141cbe95 100644 --- a/htdocs/projet/note.php +++ b/htdocs/projet/note.php @@ -118,6 +118,16 @@ if ($id > 0 || ! empty($ref)) // Statut print ''.$langs->trans("Status").''.$object->getLibStatut(4).''; + // Date start + print ''.$langs->trans("DateStart").''; + print dol_print_date($object->date_start,'day'); + print ''; + + // Date end + print ''.$langs->trans("DateEnd").''; + print dol_print_date($object->date_end,'day'); + print ''; + print ""; print '
'; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index fc02da1c821..356eed55e6d 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -232,12 +232,12 @@ if ($id > 0 || ! empty($ref)) // Date start print ''.$langs->trans("DateStart").''; - print dol_print_date($object->date_start,'dayhour'); + print dol_print_date($object->date_start,'day'); print ''; // Date end print ''.$langs->trans("DateEnd").''; - print dol_print_date($object->date_end,'dayhour'); + print dol_print_date($object->date_end,'day'); print ''; // Other options diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index a86dd329e4c..f0bdce25fca 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -202,6 +202,16 @@ if ($id > 0 || ! empty($ref)) // Statut print ''.$langs->trans("Status").''.$projectstatic->getLibStatut(4).''; + // Date start + print ''.$langs->trans("DateStart").''; + print dol_print_date($projectstatic->date_start,'day'); + print ''; + + // Date end + print ''.$langs->trans("DateEnd").''; + print dol_print_date($projectstatic->date_end,'day'); + print ''; + print ''; dol_fiche_end(); diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 29aca5f23f7..50763f839f7 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -166,6 +166,16 @@ if ($object->id > 0) // Statut print ''.$langs->trans("Status").''.$projectstatic->getLibStatut(4).''; + // Date start + print ''.$langs->trans("DateStart").''; + print dol_print_date($projectstatic->date_start,'day'); + print ''; + + // Date end + print ''.$langs->trans("DateEnd").''; + print dol_print_date($projectstatic->date_end,'day'); + print ''; + print ''; dol_fiche_end(); diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index f0f72810e8a..a6f8846ce0e 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -148,6 +148,16 @@ if ($object->id > 0) // Statut print ''.$langs->trans("Status").''.$projectstatic->getLibStatut(4).''; + // Date start + print ''.$langs->trans("DateStart").''; + print dol_print_date($projectstatic->date_start,'day'); + print ''; + + // Date end + print ''.$langs->trans("DateEnd").''; + print dol_print_date($projectstatic->date_end,'day'); + print ''; + print ''; dol_fiche_end(); diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 62dfb3cbe68..dd83cf57d8f 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -243,6 +243,16 @@ if ($id > 0 || ! empty($ref)) // Statut print ''.$langs->trans("Status").''.$projectstatic->getLibStatut(4).''; + // Date start + print ''.$langs->trans("DateStart").''; + print dol_print_date($projectstatic->date_start,'day'); + print ''; + + // Date end + print ''.$langs->trans("DateEnd").''; + print dol_print_date($projectstatic->date_end,'day'); + print ''; + print ''; dol_fiche_end(); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 4d70ddae36b..2ef635dbe53 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -234,6 +234,16 @@ if ($id > 0 || ! empty($ref)) // Statut print ''.$langs->trans("Status").''.$projectstatic->getLibStatut(4).''; + // Date start + print ''.$langs->trans("DateStart").''; + print dol_print_date($projectstatic->date_start,'day'); + print ''; + + // Date end + print ''.$langs->trans("DateEnd").''; + print dol_print_date($projectstatic->date_end,'day'); + print ''; + print ''; dol_fiche_end(); From b70c6957760d2844c26660781eb875ddaacb6e54 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Jun 2014 18:41:28 +0200 Subject: [PATCH 09/10] Fix: checkstyle --- htdocs/fourn/class/fournisseur.facture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 278e1099c4f..9b523b2bc60 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1060,8 +1060,6 @@ class FactureFournisseur extends CommonInvoice * par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,idprod) * et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue). * - * FIXME Add field ref (that should be named ref_supplier) and label into update. For example can be filled when product line created from order. - * * @param string $desc Description de la ligne * @param double $pu Prix unitaire (HT ou TTC selon price_base_type, > 0 even for credit note) * @param double $txtva Taux de tva force, sinon -1 @@ -1079,6 +1077,8 @@ class FactureFournisseur extends CommonInvoice * @param int $rang Position of line * @param int $notrigger Disable triggers * @return int >0 if OK, <0 if KO + * + * FIXME Add field ref (that should be named ref_supplier) and label into update. For example can be filled when product line created from order. */ function addline($desc, $pu, $txtva, $txlocaltax1, $txlocaltax2, $qty, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits='', $price_base_type='HT', $type=0, $rang=-1, $notrigger=false) { From bb9862d6be8f42ddcedda68d61c61deb787392b0 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Tue, 17 Jun 2014 10:15:53 +0200 Subject: [PATCH 10/10] Fix: When you add a right ended in 0, add all module rights --- htdocs/user/class/usergroup.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index bc8e14aafd1..a9c92c57838 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -3,6 +3,7 @@ * Copyright (c) 2005-2013 Laurent Destailleur * Copyright (c) 2005-2012 Regis Houssin * Copyright (C) 2012 Florian Henry + * Copyright (C) 2014 Juanjo Menent * * 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 @@ -285,7 +286,7 @@ class UserGroup extends CommonObject // Pour compatibilite, si lowid = 0, on est en mode ajout de tout // TODO A virer quand sera gere par l'appelant - if (substr($rid,-1,1) == 0) $whereforadd="module='$module'"; + //if (substr($rid,-1,1) == 0) $whereforadd="module='$module'"; } else { // Where pour la liste des droits a ajouter