Fix: col balance
This commit is contained in:
parent
dfe0052e27
commit
b8b56e2d26
@ -77,10 +77,8 @@ class box_project extends ModeleBoxes
|
|||||||
{
|
{
|
||||||
|
|
||||||
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut ";
|
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut ";
|
||||||
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."projet as p";
|
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||||
$sql.= ")";
|
$sql.= " WHERE p.entity = ".$conf->entity;
|
||||||
$sql.= " WHERE p.fk_soc = s.rowid";
|
|
||||||
$sql.= " AND s.entity = ".$conf->entity;
|
|
||||||
$sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts
|
$sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts
|
||||||
$sql.= " ORDER BY p.datec DESC";
|
$sql.= " ORDER BY p.datec DESC";
|
||||||
$sql.= $db->plimit($max, 0);
|
$sql.= $db->plimit($max, 0);
|
||||||
@ -107,16 +105,16 @@ class box_project extends ModeleBoxes
|
|||||||
);
|
);
|
||||||
|
|
||||||
$sql ="SELECT count(*) as nb, sum(progress) as totprogress";
|
$sql ="SELECT count(*) as nb, sum(progress) as totprogress";
|
||||||
$sql.=" FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet as p";
|
$sql.=" FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."projet_task as pt on pt.fk_projet = p.rowid";
|
||||||
$sql.=" WHERE pt.fk_projet = p.rowid";
|
$sql.=" WHERE p.entity = ".$conf->entity;
|
||||||
$sql.=" AND p.entity = ".$conf->entity;
|
|
||||||
$resultTask = $db->query($sql);
|
$resultTask = $db->query($sql);
|
||||||
if ($resultTask)
|
if ($resultTask)
|
||||||
{
|
{
|
||||||
$objTask = $db->fetch_object($resultTask);
|
$objTask = $db->fetch_object($resultTask);
|
||||||
$this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => number_format($objTask->nb, 0, ',', ' ')." ".$langs->trans("Tasks"));
|
$this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => number_format($objTask->nb, 0, ',', ' ')." ".$langs->trans("Tasks"));
|
||||||
if ($objTask->nb > 0 )
|
if ($objTask->nb > 0 )
|
||||||
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => number_format(($objTask->totprogress/$objTask->nb), 0, ',', ' ')." % ".$langs->trans("Progress"));
|
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => number_format(($objTask->totprogress/$objTask->nb), 0, ',', ' ')."%");
|
||||||
else
|
else
|
||||||
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A ");
|
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A ");
|
||||||
$totalnbTask += $objTask->nb;
|
$totalnbTask += $objTask->nb;
|
||||||
@ -134,10 +132,11 @@ class box_project extends ModeleBoxes
|
|||||||
|
|
||||||
|
|
||||||
// Add the sum à the bottom of the boxes
|
// Add the sum à the bottom of the boxes
|
||||||
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'colspan=2 align="left" ', 'text' => $langs->trans("Total")." ".$textHead);
|
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" ', 'text' => $langs->trans("Total")." ".$textHead);
|
||||||
$this->info_box_contents[$i][1] = array('td' => 'align="right" ', 'text' => number_format($num, 0, ',', ' ')." ".$langs->trans("Projects"));
|
$this->info_box_contents[$i][1] = array('td' => '', 'text' => "");
|
||||||
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnbTask, 0, ',', ' ')." ".$langs->trans("Tasks"));
|
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($num, 0, ',', ' ')." ".$langs->trans("Projects"));
|
||||||
$this->info_box_contents[$i][4] = array('td' => 'colspan=2', 'text' => "");
|
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => number_format($totalnbTask, 0, ',', ' ')." ".$langs->trans("Tasks"));
|
||||||
|
$this->info_box_contents[$i][4] = array('td' => '', 'text' => "");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -120,11 +120,12 @@ class box_task extends ModeleBoxes
|
|||||||
|
|
||||||
|
|
||||||
// Add the sum à the bottom of the boxes
|
// Add the sum à the bottom of the boxes
|
||||||
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'colspan=2 align="left" ', 'text' => $langs->trans("Total")." ".$textHead);
|
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" ', 'text' => $langs->trans("Total")." ".$textHead);
|
||||||
$this->info_box_contents[$i][1] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks"));
|
$this->info_box_contents[$i][1] = array('td' => '', 'text' => "");
|
||||||
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5));
|
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')." ".$langs->trans("Tasks"));
|
||||||
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5));
|
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5));
|
||||||
$this->info_box_contents[$i][4] = array('td' => 'colspan=2', 'text' => "");
|
$this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5));
|
||||||
|
$this->info_box_contents[$i][5] = array('td' => '', 'text' => "");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user