fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [15167] property: calculate accumulmate deviation per


From: sigurdne
Subject: [Fmsystem-commits] [15167] property: calculate accumulmate deviation percentage
Date: Sat, 14 May 2016 09:42:18 +0000 (UTC)

Revision: 15167
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15167
Author:   sigurdne
Date:     2016-05-14 09:42:18 +0000 (Sat, 14 May 2016)
Log Message:
-----------
property: calculate accumulmate deviation percentage

Modified Paths:
--------------
    branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php

Modified: branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php  
2016-05-14 09:41:13 UTC (rev 15166)
+++ branches/Version-1_0-branch/property/inc/class.soworkorder.inc.php  
2016-05-14 09:42:18 UTC (rev 15167)
@@ -2406,19 +2406,23 @@
                                }
 
                                $entry['deviation_period'] = $deviation;
-                               $budget_acc +=$entry['budget'];
 
+                               $entry['active'] = 
isset($active_period[$entry['period']]) && $active_period[$entry['period']] ? 
$active_period[$entry['period']] : 0;
+                               if ($entry['active'] != 2)
+                               {
+                                       $budget_acc +=$entry['budget'];
+                               }
+
+                               $entry['budget_acc'] = $budget_acc;
                                $entry['deviation_acc'] = abs($deviation) > 0 ? 
$deviation_acc : 0;
 
+                               $entry['deviation_percent_period'] = $deviation 
/ $entry['budget'] * 100;
+                               $entry['deviation_percent_acc'] = 
$entry['deviation_acc'] / $budget_acc * 100;
 
-                               $entry['deviation_percent_period']       = 
$deviation / $entry['budget'] * 100;
-                               $entry['deviation_percent_acc']          = 
$entry['deviation_acc'] / $budget_acc * 100;
-
-                               $entry['closed']         = 
isset($closed_period[$entry['period']]) && $closed_period[$entry['period']];
-                               $entry['active']         = 
isset($active_period[$entry['period']]) && $active_period[$entry['period']] ? 
$active_period[$entry['period']] : 0;
-                               $entry['fictive']        = 
isset($fictive_period[$entry['period']]) && $fictive_period[$entry['period']];
+                               $entry['closed'] = 
isset($closed_period[$entry['period']]) && $closed_period[$entry['period']];
+                               $entry['fictive'] = 
isset($fictive_period[$entry['period']]) && $fictive_period[$entry['period']];
                        }
-
+//                     _debug_array($values);die();
                        phpgwapi_cache::system_set('property', 
"budget_order_{$order_id}", $values);
 
                        return $values;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]