From 93b1b4c66e5e2cd25f1a6fe29fd8889252902286 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 21 Feb 2016 21:02:25 +0100 Subject: [PATCH 1/6] FIX #4580 --- htdocs/comm/prospect/list.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index 7259cff218e..e58694fa0f8 100644 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -438,10 +438,10 @@ if ($resql) // Prospect status print ''; $arraystcomm=array(); - foreach($prospectstatic->cacheprospectstatus as $key => $val) - { - $arraystcomm[$val['id']]=$val['label']; - } + foreach($prospectstatic->cacheprospectstatus as $key => $val) + { + $arraystcomm[$val['id']]=($langs->trans("StatusProspect".$val['id']) != "StatusProspect".$val['id'] ? $langs->trans("StatusProspect".$val['id']) : $val['label']); + } print $form->selectarray('search_stcomm', $arraystcomm, $search_stcomm, -2); print ''; From ac6001cec89ae7857be0426accc9a2cda17ff039 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 22 Feb 2016 09:27:18 +0100 Subject: [PATCH 2/6] Fix do not show warning if account defined --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index a02ad089c5b..9716b6bd968 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -881,8 +881,8 @@ class pdf_crabe extends ModelePDFFactures $this->error = $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"); } // Avoid having any valid PDF with setup that is not complete - elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER)) - || ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER))) + elseif (($object->mode_reglement_code == 'CHQ' && empty($conf->global->FACTURE_CHQ_NUMBER) && empty($object->fk_account) && empty($object->fk_bank)) + || ($object->mode_reglement_code == 'VIR' && empty($conf->global->FACTURE_RIB_NUMBER) && empty($object->fk_account) && empty($object->fk_bank))) { $outputlangs->load("errors"); From 30d6aa0b96231c855692957a63745305a9aca153 Mon Sep 17 00:00:00 2001 From: fmarcet Date: Fri, 26 Feb 2016 13:14:23 +0100 Subject: [PATCH 3/6] FIX: Some filters are lost when paging --- htdocs/commande/list.php | 21 ++++++++++++++------- htdocs/compta/facture/list.php | 11 +++++++++-- htdocs/fourn/facture/list.php | 10 +++++++++- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 517cd95e536..237cd9c0c29 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -9,6 +9,7 @@ * Copyright (C) 2015 Frederic France * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2016 Ferran Marcet * * 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 @@ -44,8 +45,10 @@ $langs->load('companies'); $orderyear=GETPOST("orderyear","int"); $ordermonth=GETPOST("ordermonth","int"); +$orderday=GETPOST("orderday","int"); $deliveryyear=GETPOST("deliveryyear","int"); $deliverymonth=GETPOST("deliverymonth","int"); +$deliveryday=GETPOST("deliveryday","int"); $search_product_category=GETPOST('search_product_category','int'); $search_ref=GETPOST('search_ref','alpha')!=''?GETPOST('search_ref','alpha'):GETPOST('sref','alpha'); $search_ref_customer=GETPOST('search_ref_customer','alpha'); @@ -87,7 +90,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_total_ht=''; $orderyear=''; $ordermonth=''; - $deliverymonth=''; + $orderday=''; + $deliveryday=''; + $deliverymonth=''; $deliveryyear=''; } @@ -168,10 +173,10 @@ if ($viewstatut <> '') } if ($ordermonth > 0) { - if ($orderyear > 0 && empty($day)) + if ($orderyear > 0 && empty($orderday)) $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_get_first_day($orderyear,$ordermonth,false))."' AND '".$db->idate(dol_get_last_day($orderyear,$ordermonth,false))."'"; - else if ($orderyear > 0 && ! empty($day)) - $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $ordermonth, $day, $orderyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $ordermonth, $day, $orderyear))."'"; + else if ($orderyear > 0 && ! empty($orderday)) + $sql.= " AND c.date_commande BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $ordermonth, $orderday, $orderyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $ordermonth, $orderday, $orderyear))."'"; else $sql.= " AND date_format(c.date_commande, '%m') = '".$ordermonth."'"; } @@ -181,10 +186,10 @@ else if ($orderyear > 0) } if ($deliverymonth > 0) { - if ($deliveryyear > 0 && empty($day)) + if ($deliveryyear > 0 && empty($deliveryday)) $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_get_first_day($deliveryyear,$deliverymonth,false))."' AND '".$db->idate(dol_get_last_day($deliveryyear,$deliverymonth,false))."'"; - else if ($deliveryyear > 0 && ! empty($day)) - $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $deliverymonth, $day, $deliveryyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $deliverymonth, $day, $deliveryyear))."'"; + else if ($deliveryyear > 0 && ! empty($deliveryday)) + $sql.= " AND c.date_livraison BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $deliverymonth, $deliveryday, $deliveryyear))."' AND '".$db->idate(dol_mktime(23, 59, 59, $deliverymonth, $deliveryday, $deliveryyear))."'"; else $sql.= " AND date_format(c.date_livraison, '%m') = '".$deliverymonth."'"; } @@ -240,8 +245,10 @@ if ($resql) $title.=' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled)?'':$langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill'); $param='&socid='.$socid.'&viewstatut='.$viewstatut; + if ($orderday) $param.='&orderday='.$orderday; if ($ordermonth) $param.='&ordermonth='.$ordermonth; if ($orderyear) $param.='&orderyear='.$orderyear; + if ($deliveryday) $param.='&deliveryday='.$deliveryday; if ($deliverymonth) $param.='&deliverymonth='.$deliverymonth; if ($deliveryyear) $param.='&deliveryyear='.$deliveryyear; if ($search_ref) $param.='&search_ref='.$search_ref; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 2581bb382ca..772abae8362 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -10,7 +10,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2015 Ferran Marcet + * Copyright (C) 2015-2016 Ferran Marcet * * 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 @@ -119,7 +119,6 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e // Do we click on purge search criteria ? if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { - $search_categ=''; $search_user=''; $search_sale=''; $search_product_category=''; @@ -132,6 +131,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $day=''; $year=''; $month=''; + $day_lim=''; + $year_lim=''; + $month_lim=''; } @@ -261,13 +263,18 @@ if ($resql) } $param='&socid='.$socid; + if ($day) $param.='&day='.$day; if ($month) $param.='&month='.$month; if ($year) $param.='&year=' .$year; + if ($day_lim) $param.='&day_lim='.$day_lim; + if ($month_lim) $param.='&month_lim='.$month_lim; + if ($year_lim) $param.='&year_lim=' .$year_lim; if ($search_ref) $param.='&search_ref=' .$search_ref; if ($search_refcustomer) $param.='&search_refcustomer=' .$search_refcustomer; if ($search_societe) $param.='&search_societe=' .$search_societe; if ($search_sale > 0) $param.='&search_sale=' .$search_sale; if ($search_user > 0) $param.='&search_user=' .$search_user; + if ($search_product_category > 0) $param.='$search_product_category=' .$search_product_category; if ($search_montant_ht != '') $param.='&search_montant_ht='.$search_montant_ht; if ($search_montant_ttc != '') $param.='&search_montant_ttc='.$search_montant_ttc; if ($search_status != '') $param.='&search_status='.$search_status; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index a2b48c253df..a02f2f78440 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -8,7 +8,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2015 juanjo Menent * Copyright (C) 2015 Abbes Bahfir - * Copyright (C) 2015 Ferran Marcet + * Copyright (C) 2015-2016 Ferran Marcet * * 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 @@ -93,6 +93,10 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_status=""; $year=""; $month=""; + $day=""; + $year_lim=""; + $month_lim=""; + $day_lim=""; } /* @@ -230,8 +234,12 @@ if ($resql) } $param='&socid='.$socid; + if ($day) $param.='&day='.urlencode($day); if ($month) $param.='&month='.urlencode($month); if ($year) $param.='&year=' .urlencode($year); + if ($day_lim) $param.='&day_lim='.urlencode($day_lim); + if ($month_lim) $param.='&month_lim='.urlencode($month_lim); + if ($year_lim) $param.='&year_lim=' .urlencode($year_lim); if ($search_ref) $param.='&search_ref='.urlencode($search_ref); if ($search_ref_supplier) $param.='&search_ref_supplier'.urlencode($search_ref_supplier); if ($search_label) $param.='&search_label='.urlencode($search_label); From 4dd50460d36a4b490bdf11681a8a46158048b19f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Feb 2016 15:50:06 +0100 Subject: [PATCH 4/6] Fix MAIN_THIRDPARTY_CREATION_INDIVIDUAL syntax error in name --- htdocs/societe/soc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index b376a8c2765..4bad452110b 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -763,7 +763,7 @@ else * Creation */ $private=GETPOST("private","int"); - if (! empty($conf->global->MAIN_THIRPARTY_CREATION_INDIVIDUAL) && ! isset($_GET['private']) && ! isset($_POST['private'])) $private=1; + if (! empty($conf->global->MAIN_THIRDPARTY_CREATION_INDIVIDUAL) && ! isset($_GET['private']) && ! isset($_POST['private'])) $private=1; if (empty($private)) $private=0; // Load object modCodeTiers From 526ea743e060c7a7ba865d37c8a29ecc6d61dfc2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Feb 2016 17:56:59 +0100 Subject: [PATCH 5/6] Fix: the view my task must show only task you are assigned to --- htdocs/projet/activity/index.php | 63 ++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 11 deletions(-) diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index 39f728263ad..7d87dbae298 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -49,6 +49,7 @@ $now = dol_now(); $projectstatic=new Project($db); $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1); // Return all projects I have permission on because I want my tasks and some of my task may be on a public projet that is not my project +$taskstatic=new Task($db); $tasktmp=new Task($db); $title=$langs->trans("Activities"); @@ -125,7 +126,7 @@ if ( $resql ) $projectstatic->title=$row->title; print $projectstatic->getNomUrl(1, '', 1); print ''; - print ''.convertSecondToTime($row->nb).''; + print ''.convertSecondToTime($row->nb, 'allhourmin').''; print "\n"; $total += $row->nb; } @@ -138,7 +139,7 @@ else } print ''; print ''.$langs->trans('Total').''; -print ''.convertSecondToTime($total).''; +print ''.convertSecondToTime($total, 'allhourmin').''; print "\n"; print ""; @@ -181,7 +182,7 @@ if ($db->type != 'pgsql') $projectstatic->title=$row->title; print $projectstatic->getNomUrl(1, '', 1); print ''; - print ''.convertSecondToTime($row->nb).''; + print ''.convertSecondToTime($row->nb, 'allhourmin').''; print "\n"; $total += $row->nb; } @@ -194,7 +195,7 @@ if ($db->type != 'pgsql') } print ''; print ''.$langs->trans('Total').''; - print ''.convertSecondToTime($total).''; + print ''.convertSecondToTime($total, 'allhourmin').''; print "\n"; print ""; } @@ -240,7 +241,7 @@ if ( $resql ) $projectstatic->title=$row->title; print $projectstatic->getNomUrl(1, '', 1); print ''; - print ''.convertSecondToTime($row->nb).''; + print ''.convertSecondToTime($row->nb, 'allhourmin').''; print "\n"; $total += $row->nb; } @@ -253,7 +254,7 @@ else } print ''; print ''.$langs->trans('Total').''; -print ''.convertSecondToTime($total).''; +print ''.convertSecondToTime($total, 'allhourmin').''; print "\n"; print "
"; @@ -292,7 +293,7 @@ if ( $resql ) $projectstatic->title=$row->title; print $projectstatic->getNomUrl(1, '', 1); print ''; - print ''.convertSecondToTime($row->nb).''; + print ''.convertSecondToTime($row->nb, 'allhourmin').''; print "\n"; $var=!$var; } @@ -304,7 +305,7 @@ else } print ''; print ''.$langs->trans('Total').''; -print ''.convertSecondToTime($total).''; +print ''.convertSecondToTime($total, 'allhourmin').''; print "\n"; print ""; @@ -342,7 +343,7 @@ if (! empty($conf->global->PROJECT_TASK_TIME_YEAR)) $projectstatic->title=$row->title; print $projectstatic->getNomUrl(1, '', 1); print ''; - print ''.convertSecondToTime($row->nb).''; + print ''.convertSecondToTime($row->nb, 'allhourmin').''; print "\n"; $var=!$var; } @@ -354,7 +355,7 @@ if (! empty($conf->global->PROJECT_TASK_TIME_YEAR)) } print ''; print ''.$langs->trans('Total').''; - print ''.convertSecondToTime($total).''; + print ''.convertSecondToTime($total, 'allhourmin').''; print "\n"; print ""; } @@ -366,6 +367,38 @@ print '
'; if (empty($conf->global->PROJECT_HIDE_TASKS)) { + // Get id of types of contacts for projects (This list never contains a lot of elements) + $listofprojectcontacttype=array(); + $sql = "SELECT ctc.rowid, ctc.code FROM ".MAIN_DB_PREFIX."c_type_contact as ctc"; + $sql.= " WHERE ctc.element = '" . $projectstatic->element . "'"; + $sql.= " AND ctc.source = 'internal'"; + $resql = $db->query($sql); + if ($resql) + { + while($obj = $db->fetch_object($resql)) + { + $listofprojectcontacttype[$obj->rowid]=$obj->code; + } + } + else dol_print_error($db); + if (count($listofprojectcontacttype) == 0) $listofprojectcontacttype[0]='0'; // To avoid sql syntax error if not found + // Get id of types of contacts for tasks (This list never contains a lot of elements) + $listoftaskcontacttype=array(); + $sql = "SELECT ctc.rowid, ctc.code FROM ".MAIN_DB_PREFIX."c_type_contact as ctc"; + $sql.= " WHERE ctc.element = '" . $taskstatic->element . "'"; + $sql.= " AND ctc.source = 'internal'"; + $resql = $db->query($sql); + if ($resql) + { + while($obj = $db->fetch_object($resql)) + { + $listoftaskcontacttype[$obj->rowid]=$obj->code; + } + } + else dol_print_error($db); + if (count($listoftaskcontacttype) == 0) $listoftaskcontacttype[0]='0'; // To avoid sql syntax error if not found + + // Tasks for all resources of all opened projects and time spent for each task/resource $max = (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?1000:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA); @@ -376,8 +409,16 @@ if (empty($conf->global->PROJECT_HIDE_TASKS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t on t.fk_projet = p.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task_time as tasktime on tasktime.fk_task = t.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on tasktime.fk_user = u.rowid"; + if ($mine) + { + $sql.= ", " . MAIN_DB_PREFIX . "element_contact as ect"; + } $sql.= " WHERE p.entity = ".$conf->entity; - if ($mine || empty($user->rights->projet->all->lire)) $sql.= " AND p.rowid IN (".$projectsListId.")"; + if ($mine || empty($user->rights->projet->all->lire)) $sql.= " AND p.rowid IN (".$projectsListId.")"; // project i have permission on + if ($mine) // this may duplicate record if we are contact twice + { + $sql.= " AND ect.fk_c_type_contact IN (".join(',',array_keys($listoftaskcontacttype)).") AND ect.element_id = t.rowid AND ect.fk_socpeople = ".$user->id; + } if ($socid) $sql.= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = ".$socid.")"; $sql.= " AND p.fk_statut=1"; $sql.= " GROUP BY p.ref, p.title, p.rowid, t.label, t.rowid, t.planned_workload, t.duration_effective, t.progress, t.dateo, t.datee"; From 15503f12b917629bc7cee091ad3d646dc8ecda39 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Feb 2016 18:29:01 +0100 Subject: [PATCH 6/6] FIX Removed a bugged list. Fixed another one to not count data of previous year. --- htdocs/projet/activity/index.php | 115 ++++++++++++++++--------------- 1 file changed, 59 insertions(+), 56 deletions(-) diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index 7d87dbae298..480294607f6 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -201,65 +201,68 @@ if ($db->type != 'pgsql') } -// TODO Do not use week function to be compatible with all database +/* if ($db->type != 'pgsql') { + print '
'; + + // Affichage de la liste des projets de la semaine + print ''; + print ''; + print ''; + print ''; + print "\n"; + + $sql = "SELECT p.rowid, p.ref, p.title, SUM(tt.task_duration) as nb"; + $sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; + $sql.= " , ".MAIN_DB_PREFIX."projet_task as t"; + $sql.= " , ".MAIN_DB_PREFIX."projet_task_time as tt"; + $sql.= " WHERE t.fk_projet = p.rowid"; + $sql.= " AND p.entity = ".$conf->entity; + $sql.= " AND tt.fk_task = t.rowid"; + $sql.= " AND tt.fk_user = ".$user->id; + $sql.= " AND task_date >= '".dol_get_first_day($year, $month).'" AND ..."; + $sql.= " AND p.rowid in (".$projectsListId.")"; + $sql.= " GROUP BY p.rowid, p.ref, p.title"; + + $resql = $db->query($sql); + if ( $resql ) + { + $total = 0; + $var=true; + + while ($row = $db->fetch_object($resql)) + { + $var=!$var; + print ""; + print ''; + print ''; + print "\n"; + $total += $row->nb; + } + + $db->free($resql); + } + else + { + dol_print_error($db); + } + print ''; + print ''; + print ''; + print "\n"; + print "
'.$langs->trans("ActivityOnProjectThisWeek").''.$langs->trans("Time").'
'; + $projectstatic->id=$row->rowid; + $projectstatic->ref=$row->ref; + $projectstatic->title=$row->title; + print $projectstatic->getNomUrl(1, '', 1); + print ''.convertSecondToTime($row->nb, 'allhourmin').'
'.$langs->trans('Total').''.convertSecondToTime($total, 'allhourmin').'

"; + +} +*/ + print '
'; -/* Affichage de la liste des projets de la semaine */ -print ''; -print ''; -print ''; -print ''; -print "\n"; - -$sql = "SELECT p.rowid, p.ref, p.title, SUM(tt.task_duration) as nb"; -$sql.= " FROM ".MAIN_DB_PREFIX."projet as p"; -$sql.= " , ".MAIN_DB_PREFIX."projet_task as t"; -$sql.= " , ".MAIN_DB_PREFIX."projet_task_time as tt"; -$sql.= " WHERE t.fk_projet = p.rowid"; -$sql.= " AND p.entity = ".$conf->entity; -$sql.= " AND tt.fk_task = t.rowid"; -$sql.= " AND tt.fk_user = ".$user->id; -$sql.= " AND week(task_date) = '".strftime("%W",time())."'"; -$sql.= " AND p.rowid in (".$projectsListId.")"; -$sql.= " GROUP BY p.rowid, p.ref, p.title"; - -$resql = $db->query($sql); -if ( $resql ) -{ - $total = 0; - $var=true; - - while ($row = $db->fetch_object($resql)) - { - $var=!$var; - print ""; - print ''; - print ''; - print "\n"; - $total += $row->nb; - } - - $db->free($resql); -} -else -{ - dol_print_error($db); -} -print ''; -print ''; -print ''; -print "\n"; -print "
'.$langs->trans("ActivityOnProjectThisWeek").''.$langs->trans("Time").'
'; - $projectstatic->id=$row->rowid; - $projectstatic->ref=$row->ref; - $projectstatic->title=$row->title; - print $projectstatic->getNomUrl(1, '', 1); - print ''.convertSecondToTime($row->nb, 'allhourmin').'
'.$langs->trans('Total').''.convertSecondToTime($total, 'allhourmin').'

"; - -} - /* Affichage de la liste des projets du mois */ print ''; print ''; @@ -275,7 +278,7 @@ $sql.= " WHERE t.fk_projet = p.rowid"; $sql.= " AND p.entity = ".$conf->entity; $sql.= " AND tt.fk_task = t.rowid"; $sql.= " AND tt.fk_user = ".$user->id; -$sql.= " AND date_format(task_date,'%y-%m') = '".strftime("%y-%m",$now)."'"; +$sql.= " AND task_date BETWEEN '".dol_get_first_day($year, $month).'" AND "'.dol_get_last_day($year, $month)."'"; $sql.= " AND p.rowid in (".$projectsListId.")"; $sql.= " GROUP BY p.rowid, p.ref, p.title";