From 6f4cfc86e8e82b98092775113e9d4f1c79560103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 18 Oct 2015 11:25:55 +0200 Subject: [PATCH 1/4] Update notify.class.php http://www.dolibarr.fr/forum/12-howto--aide/54061-probleme-sur-la-validation-des-commande-fournisseu Fatal error: Call to a member function getFullName() on a non-object in /home/xxxx/public_html/xxxxx/htdocs/core/class/notify.class.php on line 374 --- htdocs/core/class/notify.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index b0d4b4e2690..0dbd47727fb 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -143,7 +143,7 @@ class Notify */ function send($action, $object) { - global $conf,$langs,$mysoc,$dolibarr_main_url_root; + global $user,$conf,$langs,$mysoc,$dolibarr_main_url_root; include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; From 29b8919a4000e1957defdee0039e1091aa947ca3 Mon Sep 17 00:00:00 2001 From: atm-robin Date: Mon, 26 Oct 2015 14:34:46 +0100 Subject: [PATCH 2/4] FIX supplier rights for orderToInvoice --- htdocs/fourn/commande/orderstoinvoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 083ea05bc64..b63b3d9dd1d 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -44,7 +44,7 @@ $langs->load('orders'); $langs->load('deliveries'); $langs->load('companies'); -if (! $user->rights->facture->creer) +if (! $user->rights->fournisseur->facture->creer) accessforbidden(); $id = (GETPOST('id') ? GETPOST('id', 'int') : GETPOST("facid")); // For backward compatibility From c46f9350a583a6bcbd92ba2dc1af3bc75e3d7607 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 30 Oct 2015 09:50:04 +0100 Subject: [PATCH 3/4] Fix : stats were wrong if same product on several lines with same quantity because of distinct --- htdocs/product/stats/commande.php | 5 +++-- htdocs/product/stats/commande_fournisseur.php | 3 ++- htdocs/product/stats/facture.php | 5 +++-- htdocs/product/stats/facture_fournisseur.php | 5 +++-- htdocs/product/stats/propal.php | 5 +++-- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 472b9ce4a45..d219088f9f9 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -118,8 +118,8 @@ if ($id > 0 || ! empty($ref)) print ''; - $sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client, c.rowid, c.total_ht as total_ht, c.ref,"; - $sql.= " c.date_commande, c.fk_statut as statut, c.facture, c.rowid as commandeid, d.qty"; + $sql = "SELECT s.nom as name, s.rowid as socid, s.code_client, c.rowid, c.total_ht as total_ht, c.ref,"; + $sql.= " c.date_commande, c.fk_statut as statut, c.facture, c.rowid as commandeid, SUM(d.qty) as qty"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."commande as c"; @@ -131,6 +131,7 @@ if ($id > 0 || ! empty($ref)) $sql.= " AND d.fk_product =".$product->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND c.fk_soc = ".$socid; + $sql.= " GROUP BY c.rowid "; $sql.= " ORDER BY $sortfield $sortorder "; $sql.= $db->plimit($conf->liste_limit +1, $offset); diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index 73de0374ebe..92179547e58 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -112,7 +112,7 @@ if ($id > 0 || ! empty($ref)) $sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client,"; $sql.= " c.rowid, c.total_ht as total_ht, c.ref,"; - $sql.= " c.date_commande, c.fk_statut as statut, c.rowid as commandeid, d.qty"; + $sql.= " c.date_commande, c.fk_statut as statut, c.rowid as commandeid, SUM(d.qty) as qty"; if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."commande_fournisseur as c"; @@ -124,6 +124,7 @@ if ($id > 0 || ! empty($ref)) $sql.= " AND d.fk_product =".$product->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND c.fk_soc = ".$socid; + $sql.= " GROUP BY c.rowid "; $sql.= " ORDER BY $sortfield $sortorder "; $sql.= $db->plimit($conf->liste_limit +1, $offset); diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index 49e5651b065..034ab4d9f30 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -124,9 +124,9 @@ if ($id > 0 || ! empty($ref)) if ($user->rights->facture->lire) { - $sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client,"; + $sql = "SELECT s.nom as name, s.rowid as socid, s.code_client,"; $sql.= " f.facnumber, f.total as total_ht,"; - $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid, d.qty"; + $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid, SUM(d.qty) as qty"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; @@ -138,6 +138,7 @@ if ($id > 0 || ! empty($ref)) $sql.= " AND d.fk_product =".$product->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND f.fk_soc = $socid"; + $sql.= " GROUP BY f.rowid "; $sql.= " ORDER BY $sortfield $sortorder "; $sql.= $db->plimit($conf->liste_limit +1, $offset); diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index d8e30bdae6a..f1a8d908744 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -122,8 +122,8 @@ if ($id > 0 || ! empty($ref)) print ''; - $sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client, f.ref, f.total_ht as total_ht,"; - $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid, d.qty"; + $sql = "SELECT s.nom as name, s.rowid as socid, s.code_client, f.ref, f.total_ht as total_ht,"; + $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid, SUM(d.qty) as qty"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f"; @@ -135,6 +135,7 @@ if ($id > 0 || ! empty($ref)) $sql.= " AND d.fk_product =".$product->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND f.fk_soc = ".$socid; + $sql.= " GROUP BY f.rowid "; $sql.= " ORDER BY $sortfield $sortorder "; $sql.= $db->plimit($conf->liste_limit +1, $offset); diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 566961d9c5f..1e76071c682 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -113,8 +113,8 @@ if ($id > 0 || ! empty($ref)) print ''; - $sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, p.total_ht as amount,"; - $sql.= "p.datep, p.fk_statut as statut, d.qty"; + $sql = "SELECT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, p.total_ht as amount,"; + $sql.= "p.datep, p.fk_statut as statut, SUM(d.qty) as qty"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user "; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ",".MAIN_DB_PREFIX."propal as p"; @@ -126,6 +126,7 @@ if ($id > 0 || ! empty($ref)) $sql.= " AND d.fk_product =".$product->id; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND p.fk_soc = ".$socid; + $sql.= " GROUP BY p.rowid "; $sql.= " ORDER BY $sortfield $sortorder "; $sql.= $db->plimit($conf->liste_limit +1, $offset); From c06c2d0464925ff0fe8c8982b434b23a2afd4a7a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Nov 2015 14:21:45 +0100 Subject: [PATCH 4/4] FIX #3841 creation of a task completed has not status set to finished by default --- htdocs/core/lib/company.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 7fbac977d79..380ecd80943 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1204,7 +1204,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) { $out.=''; + $out.=(! empty($objcon->id)?'&contactid='.$objcon->id:'').'&backtopage=1&percentage=100">'; $out.=$langs->trans("AddAnAction").' '; $out.=img_picto($langs->trans("AddAnAction"),'filenew'); $out.="";