From e1fa86914e1c81259a38ae09e14464160057f43b Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 16 May 2016 18:41:41 +0200 Subject: [PATCH 1/7] The approved status is enough to expense appear in the report --- htdocs/compta/resultat/clientfourn.php | 6 +++--- htdocs/compta/resultat/index.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 2d9241301a6..204fab4477c 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2014 Raphaël Dourseanud - * Copyright (C) 2014 Ferran Marcet + * Copyright (C) 2014-2106 Ferran Marcet * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2014 Florian Henry * @@ -633,7 +633,7 @@ if (! empty($conf->expensereport->enabled)) $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; $sql.= " WHERE p.entity = ".getEntity('expensereport',1); - $sql.= " AND p.fk_statut>5"; + $sql.= " AND p.fk_statut>=5"; $column='p.date_valid'; @@ -644,7 +644,7 @@ if (! empty($conf->expensereport->enabled)) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = p.rowid"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; $sql.= " WHERE p.entity = ".getEntity('expensereport',1); - $sql.= " AND p.fk_statut=6"; + $sql.= " AND p.fk_statut>=5"; $column='pe.datep'; } diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index a98ce53ae81..861b44edd6c 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2014 Ferran Marcet + * Copyright (C) 2014-2016 Ferran Marcet * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2014 Florian Henry * @@ -529,7 +529,7 @@ if (! empty($conf->expensereport->enabled)) $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; $sql.= " WHERE p.entity = ".getEntity('expensereport',1); - $sql.= " AND p.fk_statut>5"; + $sql.= " AND p.fk_statut>=5"; $column='p.date_valid'; @@ -540,7 +540,7 @@ if (! empty($conf->expensereport->enabled)) $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = p.rowid"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."c_paiement as c ON pe.fk_typepayment = c.id"; $sql.= " WHERE p.entity = ".getEntity('expensereport',1); - $sql.= " AND p.fk_statut=6"; + $sql.= " AND p.fk_statut>=5"; $column='pe.datep'; } From c30a3a5f7eb7318e9ade664889681f5a51777f90 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 17 May 2016 10:02:36 +0200 Subject: [PATCH 2/7] Expense report grouped by user --- htdocs/compta/resultat/clientfourn.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 204fab4477c..81e4346440d 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -638,7 +638,7 @@ if (! empty($conf->expensereport->enabled)) $column='p.date_valid'; } else { - $sql = "SELECT p.rowid, p.ref, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; + $sql = "SELECT p.rowid, p.ref, u.rowid as userid, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user_author"; $sql.= " INNER JOIN ".MAIN_DB_PREFIX."payment_expensereport as pe ON pe.fk_expensereport = p.rowid"; @@ -654,7 +654,7 @@ if (! empty($conf->expensereport->enabled)) if (! empty($date_start) && ! empty($date_end)) $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; - $sql.= " GROUP BY p.rowid, p.ref, u.firstname, u.lastname, dm"; + $sql.= " GROUP BY u.rowid"; $sql.= " ORDER BY p.ref"; dol_syslog("get expense report outcome"); @@ -677,7 +677,7 @@ if (! empty($conf->expensereport->enabled)) $var = !$var; print " "; - print "".$langs->trans("ExpenseReport")." rowid."\">".$obj->ref.' ('.$obj->firstname." ".$obj->lastname.")\n"; + print "".$langs->trans("ExpenseReport")." userid."\">".$obj->firstname." ".$obj->lastname."\n"; if ($modecompta == 'CREANCES-DETTES') print ''.price(-$obj->amount_ht).''; print ''.price(-$obj->amount_ttc).''; From c2b958a039fbd828679d2421ea6bb167c5e02319 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 18 May 2016 18:52:38 +0200 Subject: [PATCH 3/7] Correction compatibility Postgresql --- htdocs/compta/resultat/clientfourn.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 81e4346440d..3c54a7b1e86 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -654,7 +654,7 @@ if (! empty($conf->expensereport->enabled)) if (! empty($date_start) && ! empty($date_end)) $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; - $sql.= " GROUP BY u.rowid"; + $sql.= " GROUP BY u.rowid, p.rowid, p.ref, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m')"; $sql.= " ORDER BY p.ref"; dol_syslog("get expense report outcome"); From 106f456c6b22838385fb050255de8878a44700da Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 19 May 2016 16:50:18 +0200 Subject: [PATCH 4/7] Last change --- htdocs/compta/resultat/clientfourn.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 3c54a7b1e86..9b4d37d6335 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -654,7 +654,7 @@ if (! empty($conf->expensereport->enabled)) if (! empty($date_start) && ! empty($date_end)) $sql.= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'"; - $sql.= " GROUP BY u.rowid, p.rowid, p.ref, u.firstname, u.lastname, date_format(pe.datep,'%Y-%m')"; + $sql.= " GROUP BY u.rowid, p.rowid, p.ref, u.firstname, u.lastname, dm"; $sql.= " ORDER BY p.ref"; dol_syslog("get expense report outcome"); From d8897214cdfef18aaae1f557923fa3a8b8410b0a Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Thu, 19 May 2016 21:01:52 +0200 Subject: [PATCH 5/7] Fix issues with strict mode --- htdocs/product/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index d8adf66bcc1..0fdafd64ae5 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012-2013 Marcos García - * Copyright (C) 2013 Juanjo Menent + * Copyright (C) 2013-2016 Juanjo Menent * Copyright (C) 2013-2015 Raphaël Doursenaud * Copyright (C) 2013 Jean Heimburger * Copyright (C) 2013 Cédric Salvador @@ -282,7 +282,7 @@ else $sql.=$hookmanager->resPrint; $sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,"; $sql.= " p.fk_product_type, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,"; - $sql.= ' p.datec, p.tms'; + $sql.= ' p.datec, p.tms, p.entity, p.tobatch, p.accountancy_code_sell, p.accountancy_code_buy'; // Add fields from extrafields foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : ''); // Add fields from hooks From 651b1e1d3ad76713c2cae83369e4a34c4bef79d8 Mon Sep 17 00:00:00 2001 From: Ion Agorria Date: Sat, 21 May 2016 02:45:46 +0200 Subject: [PATCH 6/7] Hook for adding new email templates on list --- htdocs/admin/dict.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 7045695c1c2..353389c98a8 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -551,6 +551,14 @@ if ($id == 25) if ($conf->fournisseur->enabled) $elementList['order_supplier_send']=$langs->trans('MailToSendSupplierOrder'); if ($conf->fournisseur->enabled) $elementList['invoice_supplier_send']=$langs->trans('MailToSendSupplierInvoice'); if ($conf->societe->enabled) $elementList['thirdparty']=$langs->trans('MailToThirdparty'); + + $parameters=array('elementList'=>$elementList); + $reshook=$hookmanager->executeHooks('emailElementlist',$parameters); // Note that $action and $object may have been modified by some hooks + if ($reshook == 0) { + foreach ($hookmanager->resArray as $item => $value) { + $elementList[$item] = $value; + } + } } // Define localtax_typeList (used for dictionary "llx_c_tva") From 704819181550760e792ee9dc32b44ae766c7f5ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 22 May 2016 08:57:23 +0200 Subject: [PATCH 7/7] Update commande.class.php --- htdocs/commande/class/commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index a2788ba9808..cd730352d79 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1536,7 +1536,7 @@ class Commande extends CommonOrder $this->id = $obj->rowid; $this->ref = $obj->ref; $this->ref_client = $obj->ref_client; - $this->ref_customer = $obj->ref_customer; + $this->ref_customer = $obj->ref_client; $this->ref_ext = $obj->ref_ext; $this->ref_int = $obj->ref_int; $this->socid = $obj->fk_soc;