From 40f1bed8d0dfaaabb4712f445f1fc9561d84111d Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Wed, 29 Apr 2020 09:15:27 +0200 Subject: [PATCH 1/8] Add possibility to filter stats by ThirdParty type and categorie --- .../comm/propal/class/propalestats.class.php | 24 +++++++++++++- htdocs/comm/propal/stats/index.php | 33 ++++++++++++++++--- htdocs/commande/class/commandestats.class.php | 24 +++++++++++++- htdocs/commande/stats/index.php | 30 ++++++++++++++++- .../facture/class/facturestats.class.php | 26 ++++++++++++++- htdocs/compta/facture/stats/index.php | 32 ++++++++++++++++-- 6 files changed, 159 insertions(+), 10 deletions(-) diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index d5c48006430..655ccda2a80 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -3,6 +3,7 @@ * Copyright (c) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (c) 2011 Juanjo Menent + * Copyright (C) 2020 Maxime DEMAREST * * 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 @@ -46,6 +47,7 @@ class PropaleStats extends Stats public $from; public $field; public $where; + public $join; /** @@ -56,13 +58,14 @@ class PropaleStats extends Stats * @param int $userid Id user for filter (creation user) * @param string $mode Option ('customer', 'supplier') */ - public function __construct($db, $socid = 0, $userid = 0, $mode = 'customer') + public function __construct($db, $socid = 0, $userid = 0, $mode = 'customer', $typentid = 0, $categid = 0) { global $user, $conf; $this->db = $db; $this->socid = ($socid > 0 ? $socid : 0); $this->userid = $userid; + $this->join = ''; if ($mode == 'customer') { @@ -96,6 +99,19 @@ class PropaleStats extends Stats $this->where .= " AND p.fk_soc = ".$this->socid; } if ($this->userid > 0) $this->where .= ' AND fk_user_author = '.$this->userid; + + if ($typentid) + { + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = p.fk_soc'; + $this->where .= ' AND s.fk_typent = '.$typentid; + } + + if ($categid) + { + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cs ON cs.fk_soc = p.fk_soc'; + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as c ON c.rowid = cs.fk_categorie'; + $this->where .= ' AND c.rowid = '.$categid; + } } @@ -113,6 +129,7 @@ class PropaleStats extends Stats $sql = "SELECT date_format(".$this->field_date.",'%m') as dm, COUNT(*) as nb"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->field_date." BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -135,6 +152,7 @@ class PropaleStats extends Stats $sql = "SELECT date_format(".$this->field_date.",'%Y') as dm, COUNT(*) as nb, SUM(c.".$this->field.")"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -156,6 +174,7 @@ class PropaleStats extends Stats $sql = "SELECT date_format(".$this->field_date.",'%m') as dm, SUM(p.".$this->field.")"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->field_date." BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -178,6 +197,7 @@ class PropaleStats extends Stats $sql = "SELECT date_format(".$this->field_date.",'%m') as dm, AVG(p.".$this->field.")"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->field_date." BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -198,6 +218,7 @@ class PropaleStats extends Stats $sql = "SELECT date_format(".$this->field_date.",'%Y') as year, COUNT(*) as nb, SUM(".$this->field.") as total, AVG(".$this->field.") as avg"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " GROUP BY year"; $sql .= $this->db->order('year', 'DESC'); @@ -221,6 +242,7 @@ class PropaleStats extends Stats $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg"; $sql .= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product"; if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " AND p.rowid = tl.fk_propal AND tl.fk_product = product.rowid"; $sql .= " AND ".$this->field_date." BETWEEN '".$this->db->idate(dol_get_first_day($year, 1, false))."' AND '".$this->db->idate(dol_get_last_day($year, 12, false))."'"; diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 3fee370c89b..78fbf725929 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos García * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2020 Maxime DEMAREST * * 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 @@ -28,7 +29,10 @@ require '../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); @@ -38,6 +42,8 @@ if ($mode == 'customer' && !$user->rights->propale->lire) accessforbidden(); if ($mode == 'supplier' && !$user->rights->supplier_proposal->lire) accessforbidden(); $object_status = GETPOST('object_status'); +$typent_id = GETPOST('typent_id', 'int'); +$categ_id = GETPOST('categ_id', 'categ_id'); $userid = GETPOST('userid', 'int'); $socid = GETPOST('socid', 'int'); @@ -64,17 +70,26 @@ $langs->loadLangs(array('orders', 'companies', 'other', 'suppliers', 'supplier_p $form = new Form($db); $formpropal = new FormPropal($db); +$formcompany = new FormCompany($db); +$formother = new FormOther($db); $langs->loadLangs(array('propal', 'other', 'companies')); -$picto = 'propal'; -$title = $langs->trans("ProposalsStatistics"); -$dir = $conf->propale->dir_temp; +if ($mode == 'customer') +{ + $picto = 'propal'; + $title = $langs->trans("ProposalsStatistics"); + $dir = $conf->propale->dir_temp; + $cat_type = Categorie::TYPE_CUSTOMER; + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); +} if ($mode == 'supplier') { $picto = 'supplier_proposal'; $title = $langs->trans("ProposalsStatisticsSuppliers").' ('.$langs->trans("SentToSuppliers").")"; $dir = $conf->supplier_proposal->dir_temp; + $cat_type = Categorie::TYPE_SUPPLIER; + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); } llxHeader('', $title); @@ -85,7 +100,7 @@ print load_fiche_titre($title, '', $picto); dol_mkdir($dir); -$stats = new PropaleStats($db, $socid, ($userid > 0 ? $userid : 0), $mode); +$stats = new PropaleStats($db, $socid, ($userid > 0 ? $userid : 0), $mode, ($typent_id > 0 ? $typent_id : 0), ($categ_id > 0 ? $categ_id : 0)); if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND p.fk_statut IN ('.$db->escape($object_status).')'; // Build graphic number of object @@ -251,6 +266,16 @@ print '
'; $filter = 's.client IN (1,2,3)'; print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"'); print ''; + // ThirdParty Type + print ''.$langs->trans("ThirdPartyType").''; + $sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. + print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent); + if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); + print ''; + // Category + print ''.$cat_label.''; + print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); + print ''; // User print ''.$langs->trans("CreatedBy").''; print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index 8b6dc4db6ec..e040a1b1ce1 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -3,6 +3,7 @@ * Copyright (c) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos García + * Copyright (C) 2020 Maxime DEMAREST * * 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 @@ -45,6 +46,7 @@ class CommandeStats extends Stats public $from; public $field; public $where; + public $join; /** @@ -55,7 +57,7 @@ class CommandeStats extends Stats * @param string $mode Option ('customer', 'supplier') * @param int $userid Id user for filter (creation user) */ - public function __construct($db, $socid, $mode, $userid = 0) + public function __construct($db, $socid, $mode, $userid = 0, $typentid = 0, $categid = 0) { global $user, $conf; @@ -64,6 +66,7 @@ class CommandeStats extends Stats $this->socid = ($socid > 0 ? $socid : 0); $this->userid = $userid; $this->cachefilesuffix = $mode; + $this->join = ''; if ($mode == 'customer') { @@ -92,6 +95,19 @@ class CommandeStats extends Stats $this->where .= " AND c.fk_soc = ".$this->socid; } if ($this->userid > 0) $this->where .= ' AND c.fk_user_author = '.$this->userid; + + if ($typentid) + { + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = c.fk_soc'; + $this->where .= ' AND s.fk_typent = '.$typentid; + } + + if ($categid) + { + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cats ON cats.fk_soc = c.fk_soc'; + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as cat ON cat.rowid = cats.fk_categorie'; + $this->where .= ' AND cat.rowid = '.$categid; + } } /** @@ -108,6 +124,7 @@ class CommandeStats extends Stats $sql = "SELECT date_format(c.date_commande,'%m') as dm, COUNT(*) as nb"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -130,6 +147,7 @@ class CommandeStats extends Stats $sql = "SELECT date_format(c.date_commande,'%Y') as dm, COUNT(*) as nb, SUM(c.".$this->field.")"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -151,6 +169,7 @@ class CommandeStats extends Stats $sql = "SELECT date_format(c.date_commande,'%m') as dm, SUM(c.".$this->field.")"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -173,6 +192,7 @@ class CommandeStats extends Stats $sql = "SELECT date_format(c.date_commande,'%m') as dm, AVG(c.".$this->field.")"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -193,6 +213,7 @@ class CommandeStats extends Stats $sql = "SELECT date_format(c.date_commande,'%Y') as year, COUNT(*) as nb, SUM(c.".$this->field.") as total, AVG(".$this->field.") as avg"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " GROUP BY year"; $sql .= $this->db->order('year', 'DESC'); @@ -214,6 +235,7 @@ class CommandeStats extends Stats $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg"; $sql .= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product"; if (!$user->rights->societe->client->voir && !$user->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " AND c.rowid = tl.fk_commande AND tl.fk_product = product.rowid"; $sql .= " AND c.date_commande BETWEEN '".$this->db->idate(dol_get_first_day($year, 1, false))."' AND '".$this->db->idate(dol_get_last_day($year, 12, false))."'"; diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 16cef93d228..d009621dc82 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos García * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2020 Maxime DEMAREST * * 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 @@ -28,7 +29,10 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formorder.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); @@ -39,6 +43,8 @@ if ($mode == 'customer' && !$user->rights->commande->lire) accessforbidden(); if ($mode == 'supplier' && !$user->rights->fournisseur->commande->lire) accessforbidden(); $object_status = GETPOST('object_status'); +$typent_id = GETPOST('typent_id', 'int'); +$categ_id = GETPOST('categ_id', 'categ_id'); $userid = GETPOST('userid', 'int'); $socid = GETPOST('socid', 'int'); @@ -65,6 +71,8 @@ $langs->loadLangs(array('orders', 'companies', 'other', 'suppliers')); $form = new Form($db); $formorder = new FormOrder($db); +$formcompany = new FormCompany($db); +$formother = new FormOther($db); $picto = 'order'; $title = $langs->trans("OrdersStatistics"); @@ -83,7 +91,7 @@ print load_fiche_titre($title, '', $picto); dol_mkdir($dir); -$stats = new CommandeStats($db, $socid, $mode, ($userid > 0 ? $userid : 0)); +$stats = new CommandeStats($db, $socid, $mode, ($userid > 0 ? $userid : 0), ($typent_id > 0 ? $typent_id : 0), ($categ_id > 0 ? $categ_id : 0)); if ($mode == 'customer') { if ($object_status != '' && $object_status >= -1) $stats->where .= ' AND c.fk_statut IN ('.$db->escape($object_status).')'; @@ -266,6 +274,26 @@ if ($mode == 'customer') $filter = 's.client IN (1,2,3)'; if ($mode == 'supplier') $filter = 's.fournisseur = 1'; print $form->select_company($socid, 'socid', $filter, 1, 0, 0, array(), 0, '', 'style="width: 95%"'); print ''; +// ThirdParty Type +print ''.$langs->trans("ThirdPartyType").''; +$sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. +print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent); +if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); +print ''; +// Category +if ($mode == 'customer') +{ + $cat_type = Categorie::TYPE_CUSTOMER; + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); +} +if ($mode == 'supplier') +{ + $cat_type = Categorie::TYPE_SUPPLIER; + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); +} +print ''.$cat_label.''; +print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); +print ''; // User print ''.$langs->trans("CreatedBy").''; print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index ea0b17bc59a..d280b7745e2 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (c) 2005-2013 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2020 Maxime DEMAREST * * 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 @@ -43,6 +44,7 @@ class FactureStats extends Stats public $from; public $field; public $where; + public $join; /** @@ -52,8 +54,9 @@ class FactureStats extends Stats * @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user. * @param string $mode Option ('customer', 'supplier') * @param int $userid Id user for filter (creation user) + * @param int $ Id user for filter (creation user) */ - public function __construct($db, $socid, $mode, $userid = 0) + public function __construct($db, $socid, $mode, $userid = 0, $typentid = 0, $categid = 0) { global $user, $conf; @@ -61,6 +64,7 @@ class FactureStats extends Stats $this->socid = ($socid > 0 ? $socid : 0); $this->userid = $userid; $this->cachefilesuffix = $mode; + $this->join = ''; if ($mode == 'customer') { @@ -79,6 +83,7 @@ class FactureStats extends Stats $this->field_line = 'total_ht'; } + $this->where = " f.fk_statut >= 0"; $this->where .= " AND f.entity IN (".getEntity('invoice').")"; if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND f.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id; @@ -90,6 +95,19 @@ class FactureStats extends Stats if ($this->userid > 0) $this->where .= ' AND f.fk_user_author = '.$this->userid; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $this->where .= " AND f.type IN (0,1,2,5)"; else $this->where .= " AND f.type IN (0,1,2,3,5)"; + + if ($typentid) + { + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = f.fk_soc'; + $this->where .= ' AND s.fk_typent = '.$typentid; + } + + if ($categid) + { + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_societe as cs ON cs.fk_soc = f.fk_soc'; + $this->join .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie as c ON c.rowid = cs.fk_categorie'; + $this->where .= ' AND c.rowid = '.$categid; + } } @@ -107,6 +125,7 @@ class FactureStats extends Stats $sql = "SELECT date_format(f.datef,'%m') as dm, COUNT(*) as nb"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -130,6 +149,7 @@ class FactureStats extends Stats $sql = "SELECT date_format(f.datef,'%Y') as dm, COUNT(*), SUM(c.".$this->field.")"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " GROUP BY dm"; $sql .= $this->db->order('dm', 'DESC'); @@ -152,6 +172,7 @@ class FactureStats extends Stats $sql = "SELECT date_format(datef,'%m') as dm, SUM(f.".$this->field.")"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -175,6 +196,7 @@ class FactureStats extends Stats $sql = "SELECT date_format(datef,'%m') as dm, AVG(f.".$this->field.")"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year))."' AND '".$this->db->idate(dol_get_last_day($year))."'"; $sql .= " AND ".$this->where; $sql .= " GROUP BY dm"; @@ -195,6 +217,7 @@ class FactureStats extends Stats $sql = "SELECT date_format(datef,'%Y') as year, COUNT(*) as nb, SUM(f.".$this->field.") as total, AVG(f.".$this->field.") as avg"; $sql .= " FROM ".$this->from; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " GROUP BY year"; $sql .= $this->db->order('year', 'DESC'); @@ -216,6 +239,7 @@ class FactureStats extends Stats $sql = "SELECT product.ref, COUNT(product.ref) as nb, SUM(tl.".$this->field_line.") as total, AVG(tl.".$this->field_line.") as avg"; $sql .= " FROM ".$this->from.", ".$this->from_line.", ".MAIN_DB_PREFIX."product as product"; if (!$user->rights->societe->client->voir && !$this->socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= $this->join; $sql .= " WHERE ".$this->where; $sql .= " AND f.rowid = tl.fk_facture AND tl.fk_product = product.rowid"; $sql .= " AND f.datef BETWEEN '".$this->db->idate(dol_get_first_day($year, 1, false))."' AND '".$this->db->idate(dol_get_last_day($year, 12, false))."'"; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 36dfab5a3c4..b1af8064d9f 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -4,6 +4,7 @@ * Copyright (C) 2012 Marcos García * Copyright (C) 2013 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2020 Maxime DEMAREST * * 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 @@ -27,6 +28,9 @@ require '../../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; $WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); @@ -40,6 +44,8 @@ if ($mode == 'customer' && !$user->rights->facture->lire) accessforbidden(); if ($mode == 'supplier' && !$user->rights->fournisseur->facture->lire) accessforbidden(); $object_status = GETPOST('object_status'); +$typent_id = GETPOST('typent_id', 'int'); +$categ_id = GETPOST('categ_id', 'categ_id'); $userid = GETPOST('userid', 'int'); $socid = GETPOST('socid', 'int'); @@ -62,6 +68,8 @@ $endyear = $year; */ $form = new Form($db); +$formcompany = new FormCompany($db); +$formother = new FormOther($db); llxHeader(); @@ -81,7 +89,7 @@ print load_fiche_titre($title, '', $picto); dol_mkdir($dir); -$stats = new FactureStats($db, $socid, $mode, ($userid > 0 ? $userid : 0)); +$stats = new FactureStats($db, $socid, $mode, ($userid > 0 ? $userid : 0), ($typent_id > 0 ? $typent_id : 0), ($categ_id > 0 ? $categ_id : 0)); if ($mode == 'customer') { if ($object_status != '' && $object_status >= 0) $stats->where .= ' AND f.fk_statut IN ('.$db->escape($object_status).')'; @@ -248,6 +256,26 @@ if ($mode == 'customer') $filter = 's.client in (1,2,3)'; if ($mode == 'supplier') $filter = 's.fournisseur = 1'; print $form->selectarray('socid', $companies, $socid, 1, 0, 0, 'style="width: 95%"', 0, 0, 0, '', '', 1); print ''; +// ThirdParty Type +print ''.$langs->trans("ThirdPartyType").''; +$sortparam_typent = (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT); // NONE means we keep sort of original array, so we sort on position. ASC, means next function will sort on label. +print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, 0, 0, 0, '', 0, 0, 0, $sortparam_typent); +if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); +print ''; +// Category +print ''.$cat_label.''; +if ($mode == 'customer') +{ + $cat_type = Categorie::TYPE_CUSTOMER; + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); +} +if ($mode == 'supplier') +{ + $cat_type = Categorie::TYPE_SUPPLIER; + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); +} +print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); +print ''; // User print ''.$langs->trans("CreatedBy").''; print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); @@ -256,7 +284,7 @@ print ''; print ''.$langs->trans("Status").''; if ($mode == 'customer') { - $liststatus = array('0'=>$langs->trans("BillStatusDraft"), '1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid"), '3'=>$langs->trans("BillStatusCanceled")); + $liststatus = array('0'=>$langs->trans("BillStatusDraft"), '1'=>$langs->trans("BillStatusNotPaid"), '2'=>$langs->trans("BillStatusPaid"), '1,2'=>$langs->trans("BillStatusNotPaid").' / '.$langs->trans("BillStatusPaid"), '3'=>$langs->trans("BillStatusCanceled")); print $form->selectarray('object_status', $liststatus, $object_status, 1); } if ($mode == 'supplier') From 1bd93720222243a017cd50822843849622149fd8 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Wed, 29 Apr 2020 10:00:29 +0200 Subject: [PATCH 2/8] Forgot comments to document news params for the modified methods --- htdocs/comm/propal/class/propalestats.class.php | 10 ++++++---- htdocs/commande/class/commandestats.class.php | 10 ++++++---- htdocs/compta/facture/class/facturestats.class.php | 3 ++- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/propal/class/propalestats.class.php b/htdocs/comm/propal/class/propalestats.class.php index 655ccda2a80..747bb75433c 100644 --- a/htdocs/comm/propal/class/propalestats.class.php +++ b/htdocs/comm/propal/class/propalestats.class.php @@ -53,10 +53,12 @@ class PropaleStats extends Stats /** * Constructor * - * @param DoliDB $db Database handler - * @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user. - * @param int $userid Id user for filter (creation user) - * @param string $mode Option ('customer', 'supplier') + * @param DoliDB $db Database handler + * @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user. + * @param int $userid Id user for filter (creation user) + * @param string $mode Option ('customer', 'supplier') + * @param int $typentid Id typent of thirdpary for filter + * @param int $categid Id category of thirdpary for filter */ public function __construct($db, $socid = 0, $userid = 0, $mode = 'customer', $typentid = 0, $categid = 0) { diff --git a/htdocs/commande/class/commandestats.class.php b/htdocs/commande/class/commandestats.class.php index e040a1b1ce1..cbb93b940de 100644 --- a/htdocs/commande/class/commandestats.class.php +++ b/htdocs/commande/class/commandestats.class.php @@ -52,10 +52,12 @@ class CommandeStats extends Stats /** * Constructor * - * @param DoliDB $db Database handler - * @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user. - * @param string $mode Option ('customer', 'supplier') - * @param int $userid Id user for filter (creation user) + * @param DoliDB $db Database handler + * @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user. + * @param string $mode Option ('customer', 'supplier') + * @param int $userid Id user for filter (creation user) + * @param int $typentid Id typent of thirdpary for filter + * @param int $categid Id category of thirdpary for filter */ public function __construct($db, $socid, $mode, $userid = 0, $typentid = 0, $categid = 0) { diff --git a/htdocs/compta/facture/class/facturestats.class.php b/htdocs/compta/facture/class/facturestats.class.php index d280b7745e2..6b95c939e2a 100644 --- a/htdocs/compta/facture/class/facturestats.class.php +++ b/htdocs/compta/facture/class/facturestats.class.php @@ -54,7 +54,8 @@ class FactureStats extends Stats * @param int $socid Id third party for filter. This value must be forced during the new to external user company if user is an external user. * @param string $mode Option ('customer', 'supplier') * @param int $userid Id user for filter (creation user) - * @param int $ Id user for filter (creation user) + * @param int $typentid Id typent of thirdpary for filter + * @param int $categid Id category of thirdpary for filter */ public function __construct($db, $socid, $mode, $userid = 0, $typentid = 0, $categid = 0) { From 398b0234ea95309a3d85245c1844bf3e51502527 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Wed, 29 Apr 2020 14:08:31 +0200 Subject: [PATCH 3/8] Correct label for select thirdparty categorie in invoice stats --- htdocs/compta/facture/stats/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index b1af8064d9f..513e1d6a0a2 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -263,7 +263,6 @@ print $form->selectarray("typent_id", $formcompany->typent_array(0), $typent_id, if ($user->admin) print ' '.info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print ''; // Category -print ''.$cat_label.''; if ($mode == 'customer') { $cat_type = Categorie::TYPE_CUSTOMER; @@ -274,6 +273,7 @@ if ($mode == 'supplier') $cat_type = Categorie::TYPE_SUPPLIER; $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); } +print ''.$cat_label.''; print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); print ''; // User From 790cffb7ae4e0b461b226044023fa360fea17809 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Wed, 29 Apr 2020 15:24:13 +0200 Subject: [PATCH 4/8] Correct select label for categories in stats pages --- htdocs/comm/propal/stats/index.php | 2 +- htdocs/commande/stats/index.php | 2 +- htdocs/compta/facture/stats/index.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 78fbf725929..add31f13f08 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -89,7 +89,7 @@ if ($mode == 'supplier') $title = $langs->trans("ProposalsStatisticsSuppliers").' ('.$langs->trans("SentToSuppliers").")"; $dir = $conf->supplier_proposal->dir_temp; $cat_type = Categorie::TYPE_SUPPLIER; - $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier")); } llxHeader('', $title); diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index d009621dc82..4e7ed481882 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -289,7 +289,7 @@ if ($mode == 'customer') if ($mode == 'supplier') { $cat_type = Categorie::TYPE_SUPPLIER; - $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); + $cat_label = $langs->trans("Supplier").' '.lcfirst($langs->trans("Customer")); } print ''.$cat_label.''; print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 513e1d6a0a2..f5472196cc2 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -271,7 +271,7 @@ if ($mode == 'customer') if ($mode == 'supplier') { $cat_type = Categorie::TYPE_SUPPLIER; - $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); + $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Supplier")); } print ''.$cat_label.''; print $formother->select_categories($cat_type, $categ_id, 'categ_id', true); From 4dbd16077e4de7228e436573904ced5f8f9bcfa6 Mon Sep 17 00:00:00 2001 From: "jove@bisquerra.com" Date: Thu, 30 Apr 2020 01:10:12 +0200 Subject: [PATCH 5/8] Finish send receipt by email from TakePOS --- htdocs/takepos/admin/setup.php | 2 +- htdocs/takepos/invoice.php | 4 +- htdocs/takepos/receipt.php | 2 +- htdocs/takepos/send.php | 141 +++++++++++---------------------- 4 files changed, 50 insertions(+), 99 deletions(-) diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index bf5c4671b13..3e12fdce5c9 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -362,7 +362,7 @@ if (is_array($formmail->lines_model)) { if (!empty($arrayofmessagename[$modelmail->label])) { $moreonlabel = ' ('.$langs->trans("SeveralLangugeVariatFound").')'; } - $arrayofmessagename[$modelmail->label] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->label)).$moreonlabel; + $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace('/\(|\)/', '', $modelmail->topic)).$moreonlabel; } } //var_dump($arraydefaultmessage); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index adbf403491e..fa5ca2f83be 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -597,7 +597,7 @@ if ($action == "valid" || $action == "history") } else { $sectionwithinvoicelink .= ' '; } - if ($conf->global->MAIN_FEATURES_LEVEL >= 2) + if ($conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE > 0) { $sectionwithinvoicelink .= ' '; } @@ -690,7 +690,7 @@ if ($action == "search") { function SendTicket(id) { console.log("Open box to select the Print/Send form"); - $.colorbox({href:"send.php?facid="+id, width:"90%", height:"50%", transition:"none", iframe:"true", title:"trans("SendTicket"); ?>"}); + $.colorbox({href:"send.php?facid="+id, width:"70%", height:"30%", transition:"none", iframe:"true", title:"trans("SendTicket"); ?>"}); } function Print(id){ diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index c025f504d73..90b3a5c1fee 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -25,7 +25,7 @@ * \brief Page to show a receipt. */ -require '../main.inc.php'; // Load $user and permissions +if (!isset($action)) require '../main.inc.php'; // If this file is called from send.php avoid load again include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $langs->loadLangs(array("main", "cashdesk", "companies")); diff --git a/htdocs/takepos/send.php b/htdocs/takepos/send.php index 5774c9bbaf1..720cd4e271c 100644 --- a/htdocs/takepos/send.php +++ b/htdocs/takepos/send.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2019 Thibault FOUCART + * Copyright (C) 2020 Andreu Bisquerra Gaya * * 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 @@ -35,123 +36,73 @@ require '../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -$invoiceid = GETPOST('facid', 'int'); +$facid = GETPOST('facid', 'int'); +$action = GETPOST('action', 'alpha'); +$email = GETPOST('email', 'alpha'); if (empty($user->rights->takepos->run)) { accessforbidden(); } - -/* - * View - */ - -$invoice = new Facture($db); -if ($invoiceid > 0) -{ - $invoice->fetch($invoiceid); -} -else -{ - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; - $resql = $db->query($sql); - $obj = $db->fetch_object($resql); - if ($obj) - { - $invoiceid = $obj->rowid; - } - if (!$invoiceid) - { - $invoiceid = 0; // Invoice does not exist yet - } - else - { - $invoice->fetch($invoiceid); - } -} - $langs->loadLangs(array("main", "bills", "cashdesk")); +$invoice = new Facture($db); +$invoice->fetch($facid); +$customer = new Societe($db); +$customer->fetch($invoice->socid); + +if ($action=="send") +{ + include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; + $formmail = new FormMail($db); + $outputlangs = new Translate('', $conf); + $model_id = $conf->global->TAKEPOS_EMAIL_TEMPLATE_INVOICE; + $arraydefaultmessage = $formmail->getEMailTemplate($db, 'facture_send', $user, $outputlangs, $model_id); + $subject = $arraydefaultmessage->topic; + ob_start(); // turn on output receipt + include('receipt.php'); + $receipt = ob_get_contents(); // get the contents of the output buffer + ob_end_clean(); + $msg="".$arraydefaultmessage->content."
".$receipt.""; + $sendto=$email; + $from=$mysoc->email; + $mail = new CMailFile($subject, $sendto, $from, $msg, array(), array(), array(), '', '', 0, 1); + if ($mail->error || $mail->errors) { + setEventMessages($mail->error, $mail->errors, 'errors'); + } else { + $result = $mail->sendfile(); + } + exit; +} +$arrayofcss = array('/takepos/css/pos.css.php'); +$arrayofjs = array(); +top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); ?> -
-
+
+

- +
From 281a97404a84c740fa4b7906ecc3126ca055f22d Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Thu, 30 Apr 2020 01:27:55 +0200 Subject: [PATCH 6/8] Fix travis --- htdocs/takepos/send.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/takepos/send.php b/htdocs/takepos/send.php index 720cd4e271c..3f59d4069b5 100644 --- a/htdocs/takepos/send.php +++ b/htdocs/takepos/send.php @@ -61,9 +61,9 @@ if ($action=="send") $arraydefaultmessage = $formmail->getEMailTemplate($db, 'facture_send', $user, $outputlangs, $model_id); $subject = $arraydefaultmessage->topic; ob_start(); // turn on output receipt - include('receipt.php'); + include 'receipt.php'; $receipt = ob_get_contents(); // get the contents of the output buffer - ob_end_clean(); + ob_end_clean(); $msg="".$arraydefaultmessage->content."
".$receipt.""; $sendto=$email; $from=$mysoc->email; From 14a3aa2165ad75986d4960b3ab881bdbd12e26a6 Mon Sep 17 00:00:00 2001 From: Maxime Lecoq Date: Thu, 30 Apr 2020 18:21:25 +0200 Subject: [PATCH 7/8] FIX: add auto incrementation to llx_c_typent.sql --- htdocs/install/mysql/tables/llx_c_typent.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_c_typent.sql b/htdocs/install/mysql/tables/llx_c_typent.sql index 0b15e70b15b..130e9d8784f 100644 --- a/htdocs/install/mysql/tables/llx_c_typent.sql +++ b/htdocs/install/mysql/tables/llx_c_typent.sql @@ -19,11 +19,11 @@ create table llx_c_typent ( - id integer PRIMARY KEY, - code varchar(12) NOT NULL, - libelle varchar(64), - fk_country integer NULL, -- Defined only to have specific list for countries that can't use generic list (like argentina that need type A or B) - active tinyint DEFAULT 1 NOT NULL, - module varchar(32) NULL, - position integer NOT NULL DEFAULT 0 + id integer AUTO_INCREMENT PRIMARY KEY, + code varchar(12) NOT NULL, + libelle varchar(64), + fk_country integer NULL, -- Defined only to have specific list for countries that can't use generic list (like argentina that need type A or B) + active tinyint DEFAULT 1 NOT NULL, + module varchar(32) NULL, + position integer NOT NULL DEFAULT 0 )ENGINE=innodb; From fddbe7c9292bbe2d808104e55e89b1df92b6274b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 1 May 2020 07:50:46 +0200 Subject: [PATCH 8/8] $tmpplugin was defined after use --- htdocs/core/class/html.form.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b2c677ed29d..5eaa7d5ede8 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6634,11 +6634,11 @@ class Form // Add code for jquery to use multiselect if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) { - $out .= "\n".' -