fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11832] more on budget handling


From: Sigurd Nes
Subject: [Fmsystem-commits] [11832] more on budget handling
Date: Sun, 16 Mar 2014 21:35:04 +0000

Revision: 11832
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11832
Author:   sigurdne
Date:     2014-03-16 21:35:03 +0000 (Sun, 16 Mar 2014)
Log Message:
-----------
more on budget handling

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

Modified: trunk/property/inc/class.soworkorder.inc.php
===================================================================
--- trunk/property/inc/class.soworkorder.inc.php        2014-03-16 20:36:59 UTC 
(rev 11831)
+++ trunk/property/inc/class.soworkorder.inc.php        2014-03-16 21:35:03 UTC 
(rev 11832)
@@ -1784,7 +1784,7 @@
                        }
                        $continuous = false;
 
-                       $cached_info = phpgwapi_cache::system_get('property', 
"budget_order_{$order_id}");
+//                     $cached_info = phpgwapi_cache::system_get('property', 
"budget_order_{$order_id}");
 
                        if($cached_info)
                        {
@@ -1977,20 +1977,33 @@
                        $this->db->query($sql, __LINE__, __FILE__);
                        $orders_paid_or_pending          = array();
                        $orders_paid_or_pending_temp = array();
-
+//     _debug_array($sql);die();
                        while($this->db->next_record())
                        {
-                               $periode = $this->db->f('periode');
+                               $_periode       = $this->db->f('periode');
+                               $periode        = $_periode ? $_periode : 
'dummy';
 
-                               $orders_paid_or_pending_temp[] = array
-                               (
-                                       'periode'                               
 => $periode ? $periode : date('Ym'),
-                                       'actual_cost'                    => 
$this->db->f('actual_cost'),
-                                       'periodization'                  => 
(int) $this->db->f('periodization'),
-                                       'periodization_start'    => 
$this->db->f('periodization_start'),
-                               );
+                               //strange...
+                               if($periode == 'dummy')
+                               {
+                                       
$orders_paid_or_pending_temp[date('Ym')]['actual_cost'] += 
$this->db->f('actual_cost');
+                                       
$orders_paid_or_pending_temp[date('Ym')]['periode'] = date('Ym');
+                                       
$orders_paid_or_pending_temp[date('Ym')]['periodization'] = 
$this->db->f('periodization');
+                                       
$orders_paid_or_pending_temp[date('Ym')]['periodization_start'] = 
$this->db->f('periodization_start');
+                               }
+                               else
+                               {
+                                       $orders_paid_or_pending_temp[$periode] 
= array
+                                       (
+                                               'periode'                       
         => $periode,
+                                               'periodization'                 
 => (int) $this->db->f('periodization'),
+                                               'periodization_start'    => 
$this->db->f('periodization_start'),
+                                       );
+                                       
$orders_paid_or_pending_temp[$periode]['actual_cost'] += 
$this->db->f('actual_cost');
+
+                               }
                        }
-
+//     _debug_array($orders_paid_or_pending_temp);die();
                        foreach($orders_paid_or_pending_temp as $entry)
                        {
                                if($entry['periodization'])




reply via email to

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