fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [9498] property: actual cost / year


From: Sigurd Nes
Subject: [Fmsystem-commits] [9498] property: actual cost / year
Date: Mon, 04 Jun 2012 17:25:48 +0000

Revision: 9498
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=9498
Author:   sigurdne
Date:     2012-06-04 17:25:48 +0000 (Mon, 04 Jun 2012)
Log Message:
-----------
property: actual cost / year

Modified Paths:
--------------
    trunk/property/inc/class.soproject.inc.php

Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php  2012-06-04 16:31:28 UTC (rev 
9497)
+++ trunk/property/inc/class.soproject.inc.php  2012-06-04 17:25:48 UTC (rev 
9498)
@@ -867,6 +867,14 @@
                                        'addition_percentage'   => 
(int)$this->db->f('addition')
                                );
                        }
+
+                       foreach ($budget as &$entry)
+                       {
+                               $this->db->query("SELECT sum(godkjentbelop) AS 
actual_cost FROM fm_ecobilag WHERE pmwrkord_code = '{$entry['workorder_id']}' 
GROUP BY pmwrkord_code");
+                               $this->db->next_record();
+                               $entry['actual_cost'] 
+=$this->db->f('actual_cost');
+                       }
+
                        return $budget;
                }
 
@@ -1542,9 +1550,12 @@
                                while ($this->db->next_record())
                                {
                                        $year = substr( 
$this->db->f('periode'), 0, 4 );
+                                       if(!$year)
+                                       {
+                                               $year = date('Y');
+                                       }
                                        $cost_info[$year]['actual_cost'] += 
$this->db->f('actual_cost');
                                }
-
                        }
 
                        $config = CreateObject('phpgwapi.config','property');




reply via email to

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