Merge branch 'zentaopms279'

This commit is contained in:
wangyidong
2023-01-03 08:39:33 +08:00
10 changed files with 526 additions and 65 deletions
+4 -2
View File
@@ -1237,7 +1237,8 @@ class block extends control
$this->view->sv = $this->weekly->getSV($this->view->ev, $this->view->pv);
$this->view->cv = $this->weekly->getCV($this->view->ev, $this->view->ac);
$progress = !empty($this->view->pv) ? floor($this->view->ac / $this->view->pv * 1000) / 1000 * 100 : 0;
$left = (float)$this->weekly->getLeft($this->session->project, $today);
$progress = (!empty($this->view->ac) or !empty($left)) ? floor($this->view->ac / ($this->view->ac + $left) * 1000) / 1000 * 100 : 0;
$this->view->progress = $progress > 100 ? 100 : $progress;
$this->view->current = $current;
}
@@ -1261,7 +1262,8 @@ class block extends control
$this->view->sv = $this->weekly->getSV($this->view->ev, $this->view->pv);
$this->view->cv = $this->weekly->getCV($this->view->ev, $this->view->ac);
$progress = !empty($this->view->pv) ? floor($this->view->ac / $this->view->pv * 1000) / 1000 * 100 : 0;
$left = (float)$data['left'];
$progress = (!empty($this->view->ac) or !empty($left)) ? floor($this->view->ac / ($this->view->ac + $left) * 1000) / 1000 * 100 : 0;
$this->view->progress = $progress > 100 ? 100 : $progress;
}
@@ -14,9 +14,30 @@
.block-waterfallreport .progress {position: absolute; left: 45px; top: 90px; right: 40px;}
.block-waterfallreport .progress-num {font-size: 20px; font-weight: 700;}
.block-waterfallreport .col-right .tile-amount {font-size: 20px;}
</style>
<div class="panel-move-handler"><span class='stage text-muted'><?php echo $current;?></span></div>
.block-waterfallreport #helpDropdown{display:inline-block; padding-left:5px; padding-right:10px;}
.block-waterfallreport #helpDropdown .dropdown-menu{width:600px; text-align:left; height:300px; overflow:auto; background: #fff; padding-left:8px;font-weight: normal;}
.block-waterfallreport #helpDropdown h2{font-size:14px; padding:0px; margin:0px; margin-top:10px;}
.block-waterfallreport #helpDropdown p{padding:0px; margin:0px; margin-top:10px;}
</style>
<script>
$(function()
{
$('.block-waterfallreport').each(function()
{
$(this).find('.panel-heading .panel-title #helpDropdown').remove();
$(this).find('.panel-heading .panel-title').append($('#helpDropdown.hidden'));
$(this).find('.panel-heading .panel-title #helpDropdown').removeClass('hidden');
})
})
</script>
<div id='helpDropdown' class="dropdown dropdown-hover hidden">
<a data-toggle="dropdown"><i class="icon-help"></i></a>
<div class="dropdown-menu">
<?php echo $lang->weekly->blockHelpNotice;?>
</div>
</div>
<div class="panel-body conatiner-fluid">
<div class='table-row'>
<div class="col col-left hide-in-sm">
+13 -9
View File
@@ -457,17 +457,15 @@ class projectModel extends model
public function getWaterfallPVEVAC($projectID)
{
$executions = $this->dao->select('id,begin,end,realEnd,status')->from(TABLE_EXECUTION)->where('deleted')->eq(0)->andWhere('vision')->eq($this->config->vision)->andWhere('project')->eq($projectID)->fetchAll('id');
$stmt = $this->dao->select('id,status,estimate,consumed,`left`,closedReason')->from(TABLE_TASK)->where('execution')->in(array_keys($executions))->andWhere("parent")->ge(0)->andWhere("deleted")->eq(0)->query();
$stmt = $this->dao->select('id,status,estimate,consumed,`left`,closedReason')->from(TABLE_TASK)->where('execution')->in(array_keys($executions))->andWhere("parent")->ge(0)->andWhere("deleted")->eq(0)->andWhere('status')->ne('cancel')->query();
$PV = 0;
$EV = 0;
$AC = 0;
$PV = 0;
$EV = 0;
$left = 0;
while($task = $stmt->fetch())
{
if(empty($task->estimate)) continue;
$PV += $task->estimate;
$AC += $task->consumed;
$PV += $task->estimate;
$left += $task->left;
if($task->status == 'done' or $task->closedReason == 'done')
{
$EV += $task->estimate;
@@ -480,7 +478,13 @@ class projectModel extends model
}
}
return array('PV' => sprintf("%.2f", $PV), 'EV' => sprintf("%.2f", $EV), 'AC' => sprintf("%.2f", $AC));
$AC = $this->dao->select('SUM(consumed) as consumed')->from(TABLE_EFFORT)
->where('deleted')->eq(0)
->andWhere('project')->eq($projectID)
->fetch('consumed');
if(is_null($AC)) $AC = 0;
return array('PV' => sprintf("%.2f", $PV), 'EV' => sprintf("%.2f", $EV), 'AC' => sprintf("%.2f", $AC), 'left' => sprintf("%.2f", $left));
}
/**
+5
View File
@@ -1,3 +1,8 @@
#mainContent td.projectName {white-space: nowrap; overflow-x: hidden;}
#pageNav .angle-btn:first-child a.btn {max-width: 300px; overflow: hidden;}
.totalCount {height: 36px !important; line-height: 30px; font-weight: bold; text-align: right !important; padding: 0px 50px 0px 8px !important; width: 100%;}
#helpDropdown{display:inline-block; padding-left:5px; padding-right:10px;}
#helpDropdown .dropdown-menu{width:600px; text-align:left; height:300px; overflow:auto; background: #fff; padding-left:8px;}
#helpDropdown h2{font-size:14px; padding:0px; margin:0px; margin-top:10px;}
#helpDropdown p{padding:0px; margin:0px; margin-top:10px;}
+102
View File
@@ -41,3 +41,105 @@ $lang->weekly->cv = 'Cost Variance(CV%)';
$lang->weekly->totalCount = 'Total : %u tasks';
$lang->weekly->exportWeeklyReport = 'Export Weekly Report';
$lang->weekly->reportHelpNotice = <<<EOD
<h2>PV Planned Value</h2>
Calculation method:
<br />1) The estimated start date and end date of the task are within the range of the start and end dates of this week, and the estimated work hours are accumulated
<br />2) The estimated start date and end date of the task are before the start and end date of this week, and the estimated work hours are accumulated
<br />3) The scheduled start date of the task is earlier than the start date of this week, the end date is later than the start date of this week, and the scheduled work hours are accumulated when it is earlier than the end date of this week
<br />4) The expected start date of a task is later than the start date of this week, less than the end date of this week, and the end date is later than the end date of this week. The cumulative (expected work hours of the task ÷ task duration days) x the days from the expected start date of the task to the end date of this week
<br />5) The estimated start date of a task is equal to the start date of this week, and the end date is greater than the end date of this week. The cumulative (estimated work hours of the task ÷ task duration days) x the number of days from the estimated start date of the task to the end date of this week
<br />6) The scheduled start date of the task is earlier than the start date of this week, and the end date is equal to the end date of this week. The scheduled work hours are accumulated
<br />7) If the expected start date of a task is earlier than the start date of this week and the end date is later than the end date of this week, the cumulative (expected work hours of the task ÷ task duration days) x the days from the expected start date of the task to the end date of this week
<p>Statistical range:</p>
1) Start date of this week: 00:00:00 on Monday End date of this week: determined according to the calculation of working days and holidays
<br />2) To avoid repeated calculation, only child tasks are included, not parent tasks
<br />3) Exclude deleted tasks
<br />4) Exclude canceled tasks
<br />5) Exclude tasks in deleted execution
<br />6) No expected start date is filled in the task. The expected start date defaults to the planned start date of the phase to which the task belongs
<br />7) No expected end date is filled in the task. By default, the expected end date is the planned completion date of the phase to which the task belongs
<br />8) Calculation formula only calculates working days
<h2>EV Earned Value</h2>
Calculation method:
<br />1) The task status is done, and the estimated work hours are accumulated
<br />2) The task status is closed and the reason for closing is done, and the estimated work hours are accumulated
<br />3) The task status is in doing, suspended, and the estimated work hours are accumulated × progress
<p>Statistical range:</p>
1) Tasks whose work consumption is not 0 before the end date of this week
<br />2) To avoid repeated calculation, only child tasks are included, not parent tasks
<br />3) Exclude deleted tasks
<br />4) Exclude canceled tasks
<br />5) Exclude tasks in deleted execution
<br />6) Progress= consumed man hours ÷(consumed man hours+remaining man hours)
<h2>AC Actual Cost</h2>
Calculation method:
<br />1) Accumulate all consumed work hours before the end date of this week
<p>Statistical range:</p>
1) All consumed man hours include task, requirement, bug, use case, version, test sheet, problem, risk, document and review time
<br />2) To avoid repeated calculation, only child tasks are included, not parent tasks
<br />3) Including deleted tasks, requirements, bugs, use cases, versions, test sheets, problems, risks, documents, and time consuming of reviews
<br />4) Including the time consumption of deleted tasks, requirements, bugs, use cases, versions, test sheets and documents in execution
<br />5) Including the time consumption of cancelled tasks, problems and risks
<h2>SV(%) Schedule Variance</h2>
Calculation method: SV(%) = -1 * (1 - (EV / PV))%
<h2>CV(%) Cost Variance</h2>
Calculation method: CV(%) = -1 * (1 - (EV / AC))%
EOD;
$lang->weekly->blockHelpNotice = <<<EOD
<h2>Progress this week</h2>
Calculation method:
<br />1) Progress of this week=total consumed man hours/(total consumed man hours+remaining man hours)
<p>Statistical range:</p>
1) The total consumed man hours include task, demand, bug, use case, version, test sheet, problem, risk, document and review time
<br />2) To avoid repeated calculation, the task only contains child tasks, not parent tasks
<br />3) Including deleted tasks, requirements, bugs, use cases, versions, test sheets, problems, risks, documents, and consumed man hours in reviews
<br />4) This includes the work hours consumed by deleted tasks, requirements, bugs, use cases, versions, test sheets, and documents
<br />5) Including work hours consumed by cancelled tasks, problems and risks
<br />6) Exclude remaining work on canceled tasks
<br />7) Exclude remaining work for deleted tasks in progress
<h2>PV Planned Value</h2>
Calculation method:
<br />1) The estimated start date and end date of the task are within the range of the start and end dates of this week, and the estimated work hours are accumulated
<br />2) The estimated start date and end date of the task are before the start and end date of this week, and the estimated work hours are accumulated
<br />3) The scheduled start date of the task is earlier than the start date of this week, the end date is later than the start date of this week, and the scheduled work hours are accumulated when it is earlier than the end date of this week
<br />4) The expected start date of a task is later than the start date of this week, less than the end date of this week, and the end date is later than the end date of this week. The cumulative (expected work hours of the task ÷ task duration days) x the days from the expected start date of the task to the end date of this week
<br />5) The estimated start date of a task is equal to the start date of this week, and the end date is greater than the end date of this week. Accumulate (estimated work hours of a task ÷ task duration days) × The number of days from the expected start of the task to the end of this week
<br />6) The scheduled start date of the task is earlier than the start date of this week, and the end date is equal to the end date of this week. The scheduled work hours are accumulated
<br />7) The expected start date of a task is earlier than the start date of this week, and the end date is later than the end date of this week. Accumulate (the expected work hours of the task ÷ the task duration days) × The number of days from the expected start of the task to the end of this week
<p>Statistical range:</p>
1) Start date of this week: 00:00:00 on Monday End date of this week: determined according to the calculation of working days and holidays
<br />2) To avoid repeated calculation, only child tasks are included, not parent tasks
<br />3) Exclude deleted tasks
<br />4) Exclude canceled tasks
<br />5) Exclude tasks in deleted execution
<br />6) No expected start date is filled in the task. The expected start date defaults to the planned start date of the phase to which the task belongs
<br />7) No expected end date is filled in the task. By default, the expected end date is the planned completion date of the phase to which the task belongs
<br />8) Calculation formula only calculates working days
<h2>EV Earned Value</h2>
Calculation method:
<br />1) The task status is done, and the estimated work hours are accumulated
<br />2) The task status is closed and the reason for closing is done, and the estimated work hours are accumulated
<br />3) The task status is in doing, suspended, and the estimated work hours are accumulated ×progress
<p>Statistical range:</p>
1) Tasks whose work consumption is not 0 before the end date of this week
<br />2) To avoid repeated calculation, only child tasks are included, not parent tasks
<br />3) Exclude deleted tasks
<br />4) Exclude canceled tasks
<br />5) Exclude deleted tasks in progress
<br />6) Progress=consumed man hours ÷ (consumed man hours+remaining man hours)
<h2>AC Actual Cost</h2>
Calculation method:
<br />1) Accumulate all consumed work hours before the end date of this week
<p>Statistical range:</p>
1) All consumed man hours include task, requirement, bug, use case, version, test sheet, problem, risk, document and review time
<br />2) To avoid repeated calculation, only child tasks are included, not parent tasks
<br />3) Including deleted tasks, requirements, bugs, use cases, versions, test sheets, problems, risks, documents, and time consuming of reviews
<br />4) Including the time consumption of deleted tasks, requirements, bugs, use cases, versions, test sheets and documents in execution
<br />5) Including the time consumption of cancelled tasks, problems and risks
<h2>SV(%) Schedule Variance</h2>
Calculation method: SV(%) = -1 * (1 - (EV / PV))%
<h2>CV(%) Schedule Variance</h2>
Calculation method: CV(%) = -1 * (1 - (EV / AC))%
EOD;
+102
View File
@@ -41,3 +41,105 @@ $lang->weekly->cv = 'Cost Variance(CV%)';
$lang->weekly->totalCount = 'Total : %u tasks';
$lang->weekly->exportWeeklyReport = 'Export Weekly Report';
$lang->weekly->reportHelpNotice = <<<EOD
<h2>PV Planned Value</h2>
Calculation method:
<br />1) The estimated start date and end date of the task are within the range of the start and end dates of this week, and the estimated work hours are accumulated
<br />2) The estimated start date and end date of the task are before the start and end date of this week, and the estimated work hours are accumulated
<br />3) The scheduled start date of the task is earlier than the start date of this week, the end date is later than the start date of this week, and the scheduled work hours are accumulated when it is earlier than the end date of this week
<br />4) The expected start date of a task is later than the start date of this week, less than the end date of this week, and the end date is later than the end date of this week. The cumulative (expected work hours of the task ÷ task duration days) x the days from the expected start date of the task to the end date of this week
<br />5) The estimated start date of a task is equal to the start date of this week, and the end date is greater than the end date of this week. The cumulative (estimated work hours of the task ÷ task duration days) x the number of days from the estimated start date of the task to the end date of this week
<br />6) The scheduled start date of the task is earlier than the start date of this week, and the end date is equal to the end date of this week. The scheduled work hours are accumulated
<br />7) If the expected start date of a task is earlier than the start date of this week and the end date is later than the end date of this week, the cumulative (expected work hours of the task ÷ task duration days) x the days from the expected start date of the task to the end date of this week
<p>Statistical range:</p>
1) Start date of this week: 00:00:00 on Monday End date of this week: determined according to the calculation of working days and holidays
<br />2) To avoid repeated calculation, only child tasks are included, not parent tasks
<br />3) Exclude deleted tasks
<br />4) Exclude canceled tasks
<br />5) Exclude tasks in deleted execution
<br />6) No expected start date is filled in the task. The expected start date defaults to the planned start date of the phase to which the task belongs
<br />7) No expected end date is filled in the task. By default, the expected end date is the planned completion date of the phase to which the task belongs
<br />8) Calculation formula only calculates working days
<h2>EV Earned Value</h2>
Calculation method:
<br />1) The task status is done, and the estimated work hours are accumulated
<br />2) The task status is closed and the reason for closing is done, and the estimated work hours are accumulated
<br />3) The task status is in doing, suspended, and the estimated work hours are accumulated × progress
<p>Statistical range:</p>
1) Tasks whose work consumption is not 0 before the end date of this week
<br />2) To avoid repeated calculation, only child tasks are included, not parent tasks
<br />3) Exclude deleted tasks
<br />4) Exclude canceled tasks
<br />5) Exclude tasks in deleted execution
<br />6) Progress= consumed man hours ÷(consumed man hours+remaining man hours)
<h2>AC Actual Cost</h2>
Calculation method:
<br />1) Accumulate all consumed work hours before the end date of this week
<p>Statistical range:</p>
1) All consumed man hours include task, requirement, bug, use case, version, test sheet, problem, risk, document and review time
<br />2) To avoid repeated calculation, only child tasks are included, not parent tasks
<br />3) Including deleted tasks, requirements, bugs, use cases, versions, test sheets, problems, risks, documents, and time consuming of reviews
<br />4) Including the time consumption of deleted tasks, requirements, bugs, use cases, versions, test sheets and documents in execution
<br />5) Including the time consumption of cancelled tasks, problems and risks
<h2>SV(%) Schedule Variance</h2>
Calculation method: SV(%) = -1 * (1 - (EV / PV))%
<h2>CV(%) Cost Variance</h2>
Calculation method: CV(%) = -1 * (1 - (EV / AC))%
EOD;
$lang->weekly->blockHelpNotice = <<<EOD
<h2>Progress this week</h2>
Calculation method:
<br />1) Progress of this week=total consumed man hours/(total consumed man hours+remaining man hours)
<p>Statistical range:</p>
1) The total consumed man hours include task, demand, bug, use case, version, test sheet, problem, risk, document and review time
<br />2) To avoid repeated calculation, the task only contains child tasks, not parent tasks
<br />3) Including deleted tasks, requirements, bugs, use cases, versions, test sheets, problems, risks, documents, and consumed man hours in reviews
<br />4) This includes the work hours consumed by deleted tasks, requirements, bugs, use cases, versions, test sheets, and documents
<br />5) Including work hours consumed by cancelled tasks, problems and risks
<br />6) Exclude remaining work on canceled tasks
<br />7) Exclude remaining work for deleted tasks in progress
<h2>PV Planned Value</h2>
Calculation method:
<br />1) The estimated start date and end date of the task are within the range of the start and end dates of this week, and the estimated work hours are accumulated
<br />2) The estimated start date and end date of the task are before the start and end date of this week, and the estimated work hours are accumulated
<br />3) The scheduled start date of the task is earlier than the start date of this week, the end date is later than the start date of this week, and the scheduled work hours are accumulated when it is earlier than the end date of this week
<br />4) The expected start date of a task is later than the start date of this week, less than the end date of this week, and the end date is later than the end date of this week. The cumulative (expected work hours of the task ÷ task duration days) x the days from the expected start date of the task to the end date of this week
<br />5) The estimated start date of a task is equal to the start date of this week, and the end date is greater than the end date of this week. Accumulate (estimated work hours of a task ÷ task duration days) × The number of days from the expected start of the task to the end of this week
<br />6) The scheduled start date of the task is earlier than the start date of this week, and the end date is equal to the end date of this week. The scheduled work hours are accumulated
<br />7) The expected start date of a task is earlier than the start date of this week, and the end date is later than the end date of this week. Accumulate (the expected work hours of the task ÷ the task duration days) × The number of days from the expected start of the task to the end of this week
<p>Statistical range:</p>
1) Start date of this week: 00:00:00 on Monday End date of this week: determined according to the calculation of working days and holidays
<br />2) To avoid repeated calculation, only child tasks are included, not parent tasks
<br />3) Exclude deleted tasks
<br />4) Exclude canceled tasks
<br />5) Exclude tasks in deleted execution
<br />6) No expected start date is filled in the task. The expected start date defaults to the planned start date of the phase to which the task belongs
<br />7) No expected end date is filled in the task. By default, the expected end date is the planned completion date of the phase to which the task belongs
<br />8) Calculation formula only calculates working days
<h2>EV Earned Value</h2>
Calculation method:
<br />1) The task status is done, and the estimated work hours are accumulated
<br />2) The task status is closed and the reason for closing is done, and the estimated work hours are accumulated
<br />3) The task status is in doing, suspended, and the estimated work hours are accumulated ×progress
<p>Statistical range:</p>
1) Tasks whose work consumption is not 0 before the end date of this week
<br />2) To avoid repeated calculation, only child tasks are included, not parent tasks
<br />3) Exclude deleted tasks
<br />4) Exclude canceled tasks
<br />5) Exclude deleted tasks in progress
<br />6) Progress=consumed man hours ÷ (consumed man hours+remaining man hours)
<h2>AC Actual Cost</h2>
Calculation method:
<br />1) Accumulate all consumed work hours before the end date of this week
<p>Statistical range:</p>
1) All consumed man hours include task, requirement, bug, use case, version, test sheet, problem, risk, document and review time
<br />2) To avoid repeated calculation, only child tasks are included, not parent tasks
<br />3) Including deleted tasks, requirements, bugs, use cases, versions, test sheets, problems, risks, documents, and time consuming of reviews
<br />4) Including the time consumption of deleted tasks, requirements, bugs, use cases, versions, test sheets and documents in execution
<br />5) Including the time consumption of cancelled tasks, problems and risks
<h2>SV(%) Schedule Variance</h2>
Calculation method: SV(%) = -1 * (1 - (EV / PV))%
<h2>CV(%) Schedule Variance</h2>
Calculation method: CV(%) = -1 * (1 - (EV / AC))%
EOD;
+102
View File
@@ -41,3 +41,105 @@ $lang->weekly->cv = 'Cost Variance(CV%)';
$lang->weekly->totalCount = 'Total : %u tasks';
$lang->weekly->exportWeeklyReport = 'Export Weekly Report';
$lang->weekly->reportHelpNotice = <<<EOD
<h2>PV Planned Value</h2>
Calculation method:
<br />1) The estimated start date and end date of the task are within the range of the start and end dates of this week, and the estimated work hours are accumulated
<br />2) The estimated start date and end date of the task are before the start and end date of this week, and the estimated work hours are accumulated
<br />3) The scheduled start date of the task is earlier than the start date of this week, the end date is later than the start date of this week, and the scheduled work hours are accumulated when it is earlier than the end date of this week
<br />4) The expected start date of a task is later than the start date of this week, less than the end date of this week, and the end date is later than the end date of this week. The cumulative (expected work hours of the task ÷ task duration days) x the days from the expected start date of the task to the end date of this week
<br />5) The estimated start date of a task is equal to the start date of this week, and the end date is greater than the end date of this week. The cumulative (estimated work hours of the task ÷ task duration days) x the number of days from the estimated start date of the task to the end date of this week
<br />6) The scheduled start date of the task is earlier than the start date of this week, and the end date is equal to the end date of this week. The scheduled work hours are accumulated
<br />7) If the expected start date of a task is earlier than the start date of this week and the end date is later than the end date of this week, the cumulative (expected work hours of the task ÷ task duration days) x the days from the expected start date of the task to the end date of this week
<p>Statistical range:</p>
1) Start date of this week: 00:00:00 on Monday End date of this week: determined according to the calculation of working days and holidays
<br />2) To avoid repeated calculation, only child tasks are included, not parent tasks
<br />3) Exclude deleted tasks
<br />4) Exclude canceled tasks
<br />5) Exclude tasks in deleted execution
<br />6) No expected start date is filled in the task. The expected start date defaults to the planned start date of the phase to which the task belongs
<br />7) No expected end date is filled in the task. By default, the expected end date is the planned completion date of the phase to which the task belongs
<br />8) Calculation formula only calculates working days
<h2>EV Earned Value</h2>
Calculation method:
<br />1) The task status is done, and the estimated work hours are accumulated
<br />2) The task status is closed and the reason for closing is done, and the estimated work hours are accumulated
<br />3) The task status is in doing, suspended, and the estimated work hours are accumulated × progress
<p>Statistical range:</p>
1) Tasks whose work consumption is not 0 before the end date of this week
<br />2) To avoid repeated calculation, only child tasks are included, not parent tasks
<br />3) Exclude deleted tasks
<br />4) Exclude canceled tasks
<br />5) Exclude tasks in deleted execution
<br />6) Progress= consumed man hours ÷(consumed man hours+remaining man hours)
<h2>AC Actual Cost</h2>
Calculation method:
<br />1) Accumulate all consumed work hours before the end date of this week
<p>Statistical range:</p>
1) All consumed man hours include task, requirement, bug, use case, version, test sheet, problem, risk, document and review time
<br />2) To avoid repeated calculation, only child tasks are included, not parent tasks
<br />3) Including deleted tasks, requirements, bugs, use cases, versions, test sheets, problems, risks, documents, and time consuming of reviews
<br />4) Including the time consumption of deleted tasks, requirements, bugs, use cases, versions, test sheets and documents in execution
<br />5) Including the time consumption of cancelled tasks, problems and risks
<h2>SV(%) Schedule Variance</h2>
Calculation method: SV(%) = -1 * (1 - (EV / PV))%
<h2>CV(%) Cost Variance</h2>
Calculation method: CV(%) = -1 * (1 - (EV / AC))%
EOD;
$lang->weekly->blockHelpNotice = <<<EOD
<h2>Progress this week</h2>
Calculation method:
<br />1) Progress of this week=total consumed man hours/(total consumed man hours+remaining man hours)
<p>Statistical range:</p>
1) The total consumed man hours include task, demand, bug, use case, version, test sheet, problem, risk, document and review time
<br />2) To avoid repeated calculation, the task only contains child tasks, not parent tasks
<br />3) Including deleted tasks, requirements, bugs, use cases, versions, test sheets, problems, risks, documents, and consumed man hours in reviews
<br />4) This includes the work hours consumed by deleted tasks, requirements, bugs, use cases, versions, test sheets, and documents
<br />5) Including work hours consumed by cancelled tasks, problems and risks
<br />6) Exclude remaining work on canceled tasks
<br />7) Exclude remaining work for deleted tasks in progress
<h2>PV Planned Value</h2>
Calculation method:
<br />1) The estimated start date and end date of the task are within the range of the start and end dates of this week, and the estimated work hours are accumulated
<br />2) The estimated start date and end date of the task are before the start and end date of this week, and the estimated work hours are accumulated
<br />3) The scheduled start date of the task is earlier than the start date of this week, the end date is later than the start date of this week, and the scheduled work hours are accumulated when it is earlier than the end date of this week
<br />4) The expected start date of a task is later than the start date of this week, less than the end date of this week, and the end date is later than the end date of this week. The cumulative (expected work hours of the task ÷ task duration days) x the days from the expected start date of the task to the end date of this week
<br />5) The estimated start date of a task is equal to the start date of this week, and the end date is greater than the end date of this week. Accumulate (estimated work hours of a task ÷ task duration days) × The number of days from the expected start of the task to the end of this week
<br />6) The scheduled start date of the task is earlier than the start date of this week, and the end date is equal to the end date of this week. The scheduled work hours are accumulated
<br />7) The expected start date of a task is earlier than the start date of this week, and the end date is later than the end date of this week. Accumulate (the expected work hours of the task ÷ the task duration days) × The number of days from the expected start of the task to the end of this week
<p>Statistical range:</p>
1) Start date of this week: 00:00:00 on Monday End date of this week: determined according to the calculation of working days and holidays
<br />2) To avoid repeated calculation, only child tasks are included, not parent tasks
<br />3) Exclude deleted tasks
<br />4) Exclude canceled tasks
<br />5) Exclude tasks in deleted execution
<br />6) No expected start date is filled in the task. The expected start date defaults to the planned start date of the phase to which the task belongs
<br />7) No expected end date is filled in the task. By default, the expected end date is the planned completion date of the phase to which the task belongs
<br />8) Calculation formula only calculates working days
<h2>EV Earned Value</h2>
Calculation method:
<br />1) The task status is done, and the estimated work hours are accumulated
<br />2) The task status is closed and the reason for closing is done, and the estimated work hours are accumulated
<br />3) The task status is in doing, suspended, and the estimated work hours are accumulated ×progress
<p>Statistical range:</p>
1) Tasks whose work consumption is not 0 before the end date of this week
<br />2) To avoid repeated calculation, only child tasks are included, not parent tasks
<br />3) Exclude deleted tasks
<br />4) Exclude canceled tasks
<br />5) Exclude deleted tasks in progress
<br />6) Progress=consumed man hours ÷ (consumed man hours+remaining man hours)
<h2>AC Actual Cost</h2>
Calculation method:
<br />1) Accumulate all consumed work hours before the end date of this week
<p>Statistical range:</p>
1) All consumed man hours include task, requirement, bug, use case, version, test sheet, problem, risk, document and review time
<br />2) To avoid repeated calculation, only child tasks are included, not parent tasks
<br />3) Including deleted tasks, requirements, bugs, use cases, versions, test sheets, problems, risks, documents, and time consuming of reviews
<br />4) Including the time consumption of deleted tasks, requirements, bugs, use cases, versions, test sheets and documents in execution
<br />5) Including the time consumption of cancelled tasks, problems and risks
<h2>SV(%) Schedule Variance</h2>
Calculation method: SV(%) = -1 * (1 - (EV / PV))%
<h2>CV(%) Schedule Variance</h2>
Calculation method: CV(%) = -1 * (1 - (EV / AC))%
EOD;
+103
View File
@@ -41,3 +41,106 @@ $lang->weekly->cv = '成本偏差率(CV%)';
$lang->weekly->totalCount = '总计 : %u 个任务';
$lang->weekly->exportWeeklyReport = '导出周报';
$lang->weekly->reportHelpNotice = <<<EOD
<h2>PV 计划完成的工作</h2>
计算方式:
<br />1)任务预计开始日期、截止日期在本周起止日期范围内,累加预计工时
<br />2)任务预计开始日期、截止日期在本周起止日期之前,累加预计工时
<br />3)任务预计开始日期小于本周开始日期,截止日期大于本周开始日期,小于本周结束日期,累加预计工时
<br />4)任务预计开始日期大于本周开始日期,小于本周截止日期,截止日期大于本周结束日期,累加 (任务的预计工时÷任务工期天数)× 任务预计开始到本周结束日期的天数
<br />5)任务预计开始日期等于本周开始日期,截止日期大于本周结束日期,累加 (任务的预计工时÷任务工期天数)× 任务预计开始到本周结束日期的天数
<br />6)任务预计开始日期小于本周开始日期,截止日期等于本周结束日期,累加预计工时
<br />7)任务预计开始日期小于本周开始日期,截止日期大于本周结束日期,累加 (任务的预计工时÷任务工期天数)× 任务预计开始到本周结束日期的天数
<p>统计范围:</p>
1)本周开始日期:周一 00:00:00 本周结束日期:根据工作日和节假日的计算来确定
<br />2)为避免重复计算,只包含子任务,不包括父任务
<br />3)不包括已删除的任务
<br />4)不包括已取消的任务
<br />5)不包括已删除执行中的任务
<br />6)任务未填写预计开始日期,预计开始日期默认取任务所属阶段的计划开始日期
<br />7)任务未填写预计截止日期,预计截止日期默认取任务所属阶段的计划完成日期
<br />8)计算公式只计算工作日
<h2>EV实际完成的工作</h2>
计算方式:
<br />1)任务状态为已完成,累加预计工时
<br />2)任务状态为已关闭且关闭原因为已完成,累加预计工时
<br />3)任务状态为进行中、已暂停,累加 预计工时×完成进度
<p>统计范围:</p>
1)本周结束日期之前消耗工时不为0的任务
<br />2)为避免重复计算,只包含子任务,不包括父任务
<br />3)不包括已删除的任务
<br />4)不包括已取消的任务
<br />5)不包括已删除执行中的任务
<br />6)完成进度=已消耗工时÷(已消耗工时+剩余工时)
<h2>AC 实际花费(消耗)的成本</h2>
计算方式:
<br />1)累加本周结束日期之前所有消耗的工时
<p>统计范围:</p>
1)所有消耗的工时包括任务、需求、Bug、用例、版本、测试单、问题、风险、文档、评审的耗时
<br />2)为避免重复计算,只包含子任务,不包括父任务
<br />3)包括已删除的任务、需求、Bug、用例、版本、测试单、问题、风险、文档、评审的耗时
<br />4)包括已删除执行中任务、需求、Bug、用例、版本、测试单、文档的耗时
<br />5)包括取消的任务、问题、风险的耗时
<h2>SV(%)进度偏差率</h2>
计算方式:SV(%) = -1 * (1 - (EV / PV))%
<h2>CV(%) 成本偏差率</h2>
计算方式:CV(%) = -1 * (1 - (EV / AC))%
EOD;
$lang->weekly->blockHelpNotice = <<<EOD
<h2>本周进度</h2>
计算方式:
<br />1)本周进度=总消耗工时/(总消耗工时+剩余工时)
<p>统计范围:</p>
1)总消耗的工时包括任务、需求、Bug、用例、版本、测试单、问题、风险、文档、评审的耗时
<br />2)为避免重复计算,任务只包含子任务,不包括父任务
<br />3)包括已删除任务、需求、Bug、用例、版本、测试单、问题、风险、文档、评审中已消耗的工时
<br />4)包括已删除执行中任务、需求、Bug、用例、版本、测试单、文档已消耗的工时
<br />5)包括已取消任务、问题、风险已消耗的工时
<br />6)不包括已取消任务的剩余工时
<br />7)不包括已删除执行中任务的剩余工时
<h2>PV 计划完成的工作</h2>
计算方式:
<br />1)任务预计开始日期、截止日期在本周起止日期范围内,累加预计工时
<br />2)任务预计开始日期、截止日期在本周起止日期之前,累加预计工时
<br />3)任务预计开始日期小于本周开始日期,截止日期大于本周开始日期,小于本周结束日期,累加预计工时
<br />4)任务预计开始日期大于本周开始日期,小于本周截止日期,截止日期大于本周结束日期,累加 (任务的预计工时÷任务工期天数)× 任务预计开始到本周结束日期的天数
<br />5)任务预计开始日期等于本周开始日期,截止日期大于本周结束日期,累加 (任务的预计工时÷任务工期天数)× 任务预计开始到本周结束日期的天数
<br />6)任务预计开始日期小于本周开始日期,截止日期等于本周结束日期,累加预计工时
<br />7)任务预计开始日期小于本周开始日期,截止日期大于本周结束日期,累加 (任务的预计工时÷任务工期天数)× 任务预计开始到本周结束日期的天数
<p>统计范围:</p>
1)本周开始日期:周一 00:00:00 本周结束日期:根据工作日和节假日的计算来确定
<br />2)为避免重复计算,只包含子任务,不包括父任务
<br />3)不包括已删除的任务
<br />4)不包括已取消的任务
<br />5)不包括已删除执行中的任务
<br />6)任务未填写预计开始日期,预计开始日期默认取任务所属阶段的计划开始日期
<br />7)任务未填写预计截止日期,预计截止日期默认取任务所属阶段的计划完成日期
<br />8)计算公式只计算工作日
<h2>EV实际完成的工作</h2>
计算方式:
<br />1)任务状态为已完成,累加预计工时
<br />2)任务状态为已关闭且关闭原因为已完成,累加预计工时
<br />3)任务状态为进行中、已暂停,累加 预计工时×完成进度
<p>统计范围:</p>
1)本周结束日期之前消耗工时不为0的任务
<br />2)为避免重复计算,只包含子任务,不包括父任务
<br />3)不包括已删除的任务
<br />4)不包括已取消的任务
<br />5)不包括已删除执行中的任务
<br />6)完成进度=已消耗工时÷(已消耗工时+剩余工时)
<h2>AC 实际花费(消耗)的成本</h2>
计算方式:
<br />1)累加本周结束日期之前所有消耗的工时
<p>统计范围:</p>
1)所有消耗的工时包括任务、需求、Bug、用例、版本、测试单、问题、风险、文档、评审的耗时
<br />2)为避免重复计算,只包含子任务,不包括父任务
<br />3)包括已删除的任务、需求、Bug、用例、版本、测试单、问题、风险、文档、评审的耗时
<br />4)包括已删除执行中任务、需求、Bug、用例、版本、测试单、文档的耗时
<br />5)包括取消的任务、问题、风险的耗时
<br />
<h2>SV(%)进度偏差率</h2>
计算方式:SV(%) = -1 * (1 - (EV / PV))%
<h2>CV(%) 成本偏差率</h2>
计算方式:CV(%) = -1 * (1 - (EV / AC))%
EOD;
+62 -47
View File
@@ -116,13 +116,9 @@ class weeklyModel extends model
public function save($project, $date)
{
$weekStart = $this->getThisMonday($date);
$this->dao->delete()->from(TABLE_WEEKLYREPORT)
->where('project')->eq($project)
->andWhere('weekStart')->eq($weekStart)
->exec();
$report = new stdclass();
$PVEV = $this->getPVEV($project, $date);
$report = new stdclass;
$PVEV = $this->getPVEV($project, $date);
$report->pv = $PVEV['PV'];
$report->ev = $PVEV['EV'];
$report->ac = $this->getAC($project, $date);
@@ -385,61 +381,49 @@ class weeklyModel extends model
if(!empty($report)) return array('PV' => $report->pv, 'EV' => $report->ev);
if(!$date) $date = date('Y-m-d');
$monday = $this->getThisMonday($date);
$sunday = $this->getThisSunday($date);
$lastDay = $this->getLastDay($date);
$nextMonday = date('Y-m-d', strtotime($sunday) + 24 * 3600);
$workdays = $this->loadModel('holiday')->getActualWorkingDays($monday, $sunday);
$executions = $this->dao->select('id,begin,end,realEnd,status')->from(TABLE_EXECUTION)->where('deleted')->eq(0)->andWhere('vision')->eq($this->config->vision)->andWhere('project')->eq($projectID)->fetchAll('id');
$lastDay = $this->getLastDay($date);
$monday = $this->getThisMonday($date);
if(empty($lastDay)) $lastDay = $monday;
$tasks = $this->dao->select('*')->from(TABLE_TASK)
$executions = $this->dao->select('id,begin,end,realBegan,realEnd,status')->from(TABLE_EXECUTION)->where('deleted')->eq(0)->andWhere('vision')->eq($this->config->vision)->andWhere('project')->eq($projectID)->fetchAll('id');
$stmt = $this->dao->select('*')->from(TABLE_TASK)
->where('execution')->in(array_keys($executions))
->andWhere("parent")->ge(0)
->andWhere("deleted")->eq(0)
->andWhere("((estStarted >= '$monday' AND estStarted < '$nextMonday') OR (deadline >= '$monday' AND deadline < '$nextMonday') OR (estStarted < '$monday' AND deadline > '$nextMonday'))")
->fetchAll('id');
->andWhere("status")->ne('cancel')
->query();
$PV = 0;
$EV = 0;
$this->loadModel('holiday');
foreach($tasks as $task)
while($task = $stmt->fetch())
{
if(empty($task->execution)) continue;
$execution = $executions[$task->execution];
if(helper::isZeroDate($task->estStarted)) $task->estStarted = helper::isZeroDate($task->openedDate) ? $execution->begin : date('Y-m-d', strtotime($task->openedDate));
if(helper::isZeroDate($task->deadline))
{
$task->deadline = helper::isZeroDate($execution->realEnd) ? $execution->end : $execution->realEnd;
if(!helper::isZeroDate($task->finishedDate)) $task->deadline = date('Y-m-d', strtotime($task->finishedDate));
}
if(helper::isZeroDate($task->estStarted)) $task->estStarted = $execution->begin;
if(helper::isZeroDate($task->deadline)) $task->deadline = $execution->end;
$fullDays = $this->holiday->getActualWorkingDays($task->estStarted, $task->deadline);
if($task->estStarted < $monday and $task->deadline >= $nextMonday)
if($task->deadline <= $lastDay)
{
$weekActualDays = $workdays;
$PV += $task->estimate;
}
elseif($task->estStarted >= $monday and $task->estStarted < $nextMonday)
elseif($task->estStarted <= $lastDay)
{
$weekActualDays = $this->holiday->getActualWorkingDays($task->estStarted, $task->deadline >= $nextMonday ? $sunday : $task->deadline);
$fullDays = $this->holiday->getActualWorkingDays($task->estStarted, $task->deadline);
$weekActualDays = $this->holiday->getActualWorkingDays($task->estStarted, $lastDay);
if(!empty($fullDays) and !empty($weekActualDays)) $PV += round(count($weekActualDays) / count($fullDays) * $task->estimate, 2);
}
elseif($task->deadline >= $monday and $task->deadline < $nextMonday)
{
$weekActualDays = $this->holiday->getActualWorkingDays($monday, $task->deadline);
}
if(empty($fullDays) or empty($weekActualDays) or empty($task->estimate)) continue;
$thisPV = round(count($weekActualDays) / count($fullDays) * $task->estimate, 2);
if($task->status == 'done' or $task->closedReason == 'done')
{
$EV += $thisPV;
$EV += $task->estimate;
}
else
{
$task->progress = 0;
if(($task->consumed + $task->left) > 0) $task->progress = round($task->consumed / ($task->consumed + $task->left) * 100, 2);
$EV += round($thisPV * $task->progress / 100, 2);
$EV += round($task->estimate * $task->progress / 100, 2);
}
$PV += $thisPV;
}
return array('PV' => sprintf("%.2f", $PV), 'EV' => sprintf("%.2f", $EV));
@@ -459,19 +443,14 @@ class weeklyModel extends model
if(!empty($report)) return $report->ac;
if(!$date) $date = date('Y-m-d');
$monday = $this->getThisMonday($date);
$nextMonday = date('Y-m-d', strtotime($monday) + (7 * 24 * 3600));
$executions = $this->dao->select('id,begin,end,realEnd,status')->from(TABLE_EXECUTION)->where('deleted')->eq(0)->andWhere('vision')->eq($this->config->vision)->andWhere('project')->eq($project)->fetchAll('id');
$taskIdList = $this->dao->select('id')->from(TABLE_TASK)->where('execution')->in(array_keys($executions))->andWhere("parent")->ge(0)->andWhere("deleted")->eq(0)->fetchPairs();
$lastDay = $this->getLastDay($date);
if(empty($lastDay)) $lastDay = $this->getThisMonday($date);
$AC = $this->dao->select('sum(consumed) as consumed')
->from(TABLE_EFFORT)
->where('objectType')->eq('task')
->andWhere('objectID')->in($taskIdList)
->andWhere('date')->ge($monday)
->andWhere('date')->lt($nextMonday)
->andWhere('deleted')->eq('0')
->where('project')->eq($project)
->andWhere('date')->le($lastDay)
->andWhere('deleted')->eq(0)
->fetch('consumed');
if(is_null($AC)) $AC = 0;
@@ -479,6 +458,42 @@ class weeklyModel extends model
return sprintf("%.2f", $AC);
}
/**
* Get left.
*
* @param int $projectID
* @param string $date
* @access public
* @return float
*/
public function getLeft($projectID, $date = '')
{
if(!$date) $date = date('Y-m-d');
$lastDay = $this->getLastDay($date);
$monday = $this->getThisMonday($date);
if(empty($lastDay)) $lastDay = $monday;
$executions = $this->dao->select('id,begin,end,realBegan,realEnd,status')->from(TABLE_EXECUTION)->where('deleted')->eq(0)->andWhere('vision')->eq($this->config->vision)->andWhere('project')->eq($projectID)->fetchAll('id');
$stmt = $this->dao->select('*')->from(TABLE_TASK)
->where('execution')->in(array_keys($executions))
->andWhere("parent")->ge(0)
->andWhere("deleted")->eq(0)
->andWhere("status")->ne('cancel')
->query();
$left = 0;
while($task = $stmt->fetch())
{
$execution = $executions[$task->execution];
if(helper::isZeroDate($task->estStarted)) $task->estStarted = $execution->begin;
if(helper::isZeroDate($task->deadline)) $task->deadline = $execution->end;
if($task->deadline <= $lastDay or ($task->estStarted <= $lastDay and $task->deadline > $lastDay)) $left += $task->left;
}
return sprintf("%.2f", $left);
}
/**
* Get SV data.
*
+10 -5
View File
@@ -13,10 +13,7 @@
<?php js::set('selectedWeekBegin', $date);?>
<?php if(common::hasPriv('weekly', 'exportweeklyreport')):?>
<script>
$(function()
{
$('#exportreport').modalTrigger();
});
$(function(){$('#exportreport').modalTrigger();});
</script>
<?php endif;?>
<div id="mainMenu" class="clearfix text-center">
@@ -39,7 +36,15 @@ $(function()
<div class='page-title'><h4><?php echo $lang->weekly->summary;?></h4></div>
<table class='table table-bordered'>
<tr>
<td><?php echo $lang->weekly->progress;?></td>
<td>
<?php echo $lang->weekly->progress;?>
<div id='helpDropdown' class="dropdown dropdown-hover">
<a data-toggle="dropdown"><i class="icon-help"></i></a>
<div class="dropdown-menu">
<?php echo $lang->weekly->reportHelpNotice;?>
</div>
</div>
</td>
<td></td>
<td><?php echo $lang->weekly->analysisResult;?></td>
<td></td>