fix calculation of already receipt documents

This commit is contained in:
Uwe Steinmann 2016-10-05 11:16:26 +02:00
parent 42de7bb0c9
commit 35e6625601

View File

@ -1049,7 +1049,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print "<td width='20%'></td>\n";
print "</tr>\n";
$stat = array('-1'=>0, '0'=>0, '1'=>0);
$stat = array('-1'=>0, '0'=>0, '1'=>0, '2'=>0);
foreach ($receiptStatus as $r) {
$required = null;
$is_recipient = false;
@ -1104,13 +1104,15 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
<?php
$this->contentContainerEnd();
if($user->isAdmin()) {
/* Do not count entries '2' as they are removed userѕ */
$totalreceipts = $stat['-1'] + $stat['0'] + $stat['1'];
?>
<div class="row-fluid">
<div class="span12">
<div class="progress">
<div class="bar bar-success" style="width: <?php echo round($stat['1']/count($receiptStatus)*100); ?>%;"></div>
<!-- div class="bar bar-warning" style="width: <?php echo round($stat['0']/count($receiptStatus)*100); ?>%;"></div -->
<div class="bar bar-danger" style="width: <?php echo round($stat['-1']/count($receiptStatus)*100); ?>%;"></div>
<div class="bar bar-success" style="width: <?php echo round($stat['1']/$totalreceipts*100); ?>%;"></div>
<!-- div class="bar bar-warning" style="width: <?php echo round($stat['0']/$totalreceipts*100); ?>%;"></div -->
<div class="bar bar-danger" style="width: <?php echo round($stat['-1']/$totalreceipts*100); ?>%;"></div>
</div>
</div>
</div>