Skip to content

Commit ca085dd

Browse files
committed
[Bug #150] Moved hours are taken into account when calculating deviations in hours and cost per hour.
1 parent 4aaef00 commit ca085dd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

model/vo/CustomProjectVO.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function getWorkedHours() {
8989
*/
9090
public function getPercDev() {
9191
if ($this->estHours > 0)
92-
return (($this->workedHours/$this->estHours)-1)*100;
92+
return (($this->workedHours/($this->estHours+$this->movedHours))-1)*100;
9393
else return null;
9494
}
9595

@@ -100,7 +100,7 @@ public function getPercDev() {
100100
* @return double the deviation of the estimated work hours according to the worked ones.
101101
*/
102102
public function getAbsDev() {
103-
return ($this->workedHours-$this->estHours);
103+
return ($this->workedHours-$this->estHours-$this->movedHours);
104104
}
105105

106106
/** Get Estimated Hours Invoice
@@ -111,7 +111,7 @@ public function getAbsDev() {
111111
*/
112112
public function getEstHourInvoice() {
113113
if ($this->estHours > 0)
114-
return ($this->invoice/$this->estHours);
114+
return ($this->invoice/($this->estHours+$this->movedHours));
115115
else return null;
116116
}
117117

0 commit comments

Comments
 (0)