NEW Show total of time consumed in week in time spent entry page
This commit is contained in:
parent
cb45c86711
commit
de89893d57
@ -216,6 +216,21 @@ function updateTotal(days,mode)
|
|||||||
if (total.getHours() || total.getMinutes()) jQuery('.totalDay'+days).addClass("bold");
|
if (total.getHours() || total.getMinutes()) jQuery('.totalDay'+days).addClass("bold");
|
||||||
else jQuery('.totalDay'+days).removeClass("bold");
|
else jQuery('.totalDay'+days).removeClass("bold");
|
||||||
jQuery('.totalDay'+days).text(pad(total.getHours())+':'+pad(total.getMinutes()));
|
jQuery('.totalDay'+days).text(pad(total.getHours())+':'+pad(total.getMinutes()));
|
||||||
|
|
||||||
|
var total = new Date(0);
|
||||||
|
total.setHours(0);
|
||||||
|
total.setMinutes(0);
|
||||||
|
for (var i=0; i<7; i++)
|
||||||
|
{
|
||||||
|
var taskTime= new Date(0);
|
||||||
|
result=parseTime(jQuery('.totalDay'+i).text(),taskTime);
|
||||||
|
if (result >= 0)
|
||||||
|
{
|
||||||
|
total.setHours(total.getHours()+taskTime.getHours());
|
||||||
|
total.setMinutes(total.getMinutes()+taskTime.getMinutes());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
jQuery('.totalDayAll').text(pad(total.getHours())+':'+pad(total.getMinutes()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -260,7 +275,6 @@ function updateTotal(days,mode)
|
|||||||
else jQuery('.totalDay'+days).removeClass("bold");
|
else jQuery('.totalDay'+days).removeClass("bold");
|
||||||
jQuery('.totalDay'+days).text(total);
|
jQuery('.totalDay'+days).text(total);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3157,40 +3157,6 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Mise a jour de l'objet ligne de commande en base
|
|
||||||
*
|
|
||||||
* @return int <0 si ko, >0 si ok
|
|
||||||
*/
|
|
||||||
public function updateTotal()
|
|
||||||
{
|
|
||||||
$this->db->begin();
|
|
||||||
|
|
||||||
// Mise a jour ligne en base
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseurdet SET";
|
|
||||||
$sql.= " total_ht='".price2num($this->total_ht)."'";
|
|
||||||
$sql.= ",total_tva='".price2num($this->total_tva)."'";
|
|
||||||
$sql.= ",total_localtax1='".price2num($this->total_localtax1)."'";
|
|
||||||
$sql.= ",total_localtax2='".price2num($this->total_localtax2)."'";
|
|
||||||
$sql.= ",total_ttc='".price2num($this->total_ttc)."'";
|
|
||||||
$sql.= " WHERE rowid = ".$this->rowid;
|
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::updateTotal", LOG_DEBUG);
|
|
||||||
|
|
||||||
$resql=$this->db->query($sql);
|
|
||||||
if ($resql)
|
|
||||||
{
|
|
||||||
$this->db->commit();
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$this->error=$this->db->error();
|
|
||||||
$this->db->rollback();
|
|
||||||
return -2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Insert line into database
|
* Insert line into database
|
||||||
*
|
*
|
||||||
|
|||||||
@ -595,10 +595,15 @@ if (count($tasksarray) > 0)
|
|||||||
if ($isdiff)
|
if ($isdiff)
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven othertaskwithtime">';
|
print '<tr class="oddeven othertaskwithtime">';
|
||||||
print '<td colspan="'.$colspan.'">';
|
print '<td colspan="3">';
|
||||||
print $langs->trans("OtherFilteredTasks");
|
print $langs->trans("OtherFilteredTasks");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td align="center">';
|
print '<td align="right" class="leftborder plannedworkload"></td>';
|
||||||
|
print '<td></td>';
|
||||||
|
print '<td></td>';
|
||||||
|
print '<td></td>';
|
||||||
|
print '<td class="leftborder"></td>';
|
||||||
|
print '<td class="center">';
|
||||||
$timeonothertasks=($totalforeachday[$daytoparse] - $totalforvisibletasks[$daytoparse]);
|
$timeonothertasks=($totalforeachday[$daytoparse] - $totalforvisibletasks[$daytoparse]);
|
||||||
//if ($timeonothertasks)
|
//if ($timeonothertasks)
|
||||||
//{
|
//{
|
||||||
|
|||||||
@ -531,8 +531,8 @@ $colspan=7;
|
|||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print '<tr class="liste_total">
|
print '<tr class="liste_total">';
|
||||||
<td class="liste_total" colspan="'.$colspan.'">';
|
print '<td class="liste_total" colspan="'.$colspan.'">';
|
||||||
print $langs->trans("Total");
|
print $langs->trans("Total");
|
||||||
print ' - '.$langs->trans("ExpectedWorkedHours").': <strong>'.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).'</strong>';
|
print ' - '.$langs->trans("ExpectedWorkedHours").': <strong>'.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).'</strong>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -547,8 +547,8 @@ if ($conf->use_javascript_ajax)
|
|||||||
|
|
||||||
print '<td class="liste_total hide'.$idw.($cssweekend?' '.$cssweekend:'').'" align="center"><div class="totalDay'.$idw.'"> </div></td>';
|
print '<td class="liste_total hide'.$idw.($cssweekend?' '.$cssweekend:'').'" align="center"><div class="totalDay'.$idw.'"> </div></td>';
|
||||||
}
|
}
|
||||||
print '<td class="liste_total"></td>
|
print '<td class="liste_total center"><div class="totalDayAll"> </div></td>';
|
||||||
</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -625,7 +625,7 @@ if (count($tasksarray) > 0)
|
|||||||
$cssweekend='weekend';
|
$cssweekend='weekend';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td align="center'.($cssweekend?' '.$cssweekend:'').'">';
|
print '<td class="center hide'.$idw.' '.($cssweekend?' '.$cssweekend:'').'">';
|
||||||
$tmpday=dol_time_plus_duree($firstdaytoshow, $idw, 'd');
|
$tmpday=dol_time_plus_duree($firstdaytoshow, $idw, 'd');
|
||||||
$timeonothertasks=($totalforeachday[$tmpday] - $totalforvisibletasks[$tmpday]);
|
$timeonothertasks=($totalforeachday[$tmpday] - $totalforvisibletasks[$tmpday]);
|
||||||
if ($timeonothertasks)
|
if ($timeonothertasks)
|
||||||
@ -658,7 +658,7 @@ if (count($tasksarray) > 0)
|
|||||||
|
|
||||||
print '<td class="liste_total hide'.$idw.($cssweekend?' '.$cssweekend:'').'" align="center"><div class="totalDay'.$idw.'"> </div></td>';
|
print '<td class="liste_total hide'.$idw.($cssweekend?' '.$cssweekend:'').'" align="center"><div class="totalDay'.$idw.'"> </div></td>';
|
||||||
}
|
}
|
||||||
print '<td class="liste_total"></td>
|
print '<td class="liste_total center"><div class="totalDayAll"> </div></td>
|
||||||
</tr>';
|
</tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -79,11 +79,7 @@ $projectstatic = new Project($db);
|
|||||||
$extrafields_project = new ExtraFields($db);
|
$extrafields_project = new ExtraFields($db);
|
||||||
$extrafields_task = new ExtraFields($db);
|
$extrafields_task = new ExtraFields($db);
|
||||||
|
|
||||||
if ($projectid > 0 || ! empty($ref))
|
$extralabels_projet=$extrafields_project->fetch_name_optionals_label($projectstatic->table_element);
|
||||||
{
|
|
||||||
// fetch optionals attributes and labels
|
|
||||||
$extralabels_projet=$extrafields_project->fetch_name_optionals_label($projectstatic->table_element);
|
|
||||||
}
|
|
||||||
$extralabels_task=$extrafields_task->fetch_name_optionals_label($object->table_element);
|
$extralabels_task=$extrafields_task->fetch_name_optionals_label($object->table_element);
|
||||||
|
|
||||||
|
|
||||||
@ -278,10 +274,9 @@ if (! empty($project_ref) && ! empty($withproject))
|
|||||||
|
|
||||||
// To show all time lines for project
|
// To show all time lines for project
|
||||||
$projectidforalltimes=0;
|
$projectidforalltimes=0;
|
||||||
if (GETPOST('projectid'))
|
if (GETPOST('projectid','none'))
|
||||||
{
|
{
|
||||||
$projectidforalltimes=GETPOST('projectid','int');
|
$projectidforalltimes=GETPOST('projectid','int');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -407,6 +407,9 @@ td.onholidayallday {
|
|||||||
td.leftborder, td.hide0 {
|
td.leftborder, td.hide0 {
|
||||||
border-left: 1px solid #ccc;
|
border-left: 1px solid #ccc;
|
||||||
}
|
}
|
||||||
|
td.leftborder, td.hide6 {
|
||||||
|
border-right: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
td.actionbuttons a {
|
td.actionbuttons a {
|
||||||
padding-left: 6px;
|
padding-left: 6px;
|
||||||
|
|||||||
@ -411,6 +411,9 @@ td.actionbuttons a {
|
|||||||
td.leftborder, td.hide0 {
|
td.leftborder, td.hide0 {
|
||||||
border-left: 1px solid #ccc;
|
border-left: 1px solid #ccc;
|
||||||
}
|
}
|
||||||
|
td.leftborder, td.hide6 {
|
||||||
|
border-right: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
select.flat, form.flat select {
|
select.flat, form.flat select {
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user