fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11736] property: list obligation, percent


From: Sigurd Nes
Subject: [Fmsystem-commits] [11736] property: list obligation, percent
Date: Sat, 22 Feb 2014 18:12:03 +0000

Revision: 11736
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11736
Author:   sigurdne
Date:     2014-02-22 18:12:03 +0000 (Sat, 22 Feb 2014)
Log Message:
-----------
property: list obligation, percent

Modified Paths:
--------------
    trunk/property/inc/class.bobudget.inc.php
    trunk/property/inc/class.sobudget.inc.php
    trunk/property/inc/class.uibudget.inc.php

Modified: trunk/property/inc/class.bobudget.inc.php
===================================================================
--- trunk/property/inc/class.bobudget.inc.php   2014-02-22 17:19:22 UTC (rev 
11735)
+++ trunk/property/inc/class.bobudget.inc.php   2014-02-22 18:12:03 UTC (rev 
11736)
@@ -97,7 +97,7 @@
                        $this->direction                = $direction ? 
$direction : $this->direction;
                        if( !$this->direction )
                        {
-                               $this->direction = 'expences';
+                               $this->direction = 'expenses';
                        }
                        
                        $this->filter                   = isset($filter) && 
$filter ? $filter : '';

Modified: trunk/property/inc/class.sobudget.inc.php
===================================================================
--- trunk/property/inc/class.sobudget.inc.php   2014-02-22 17:19:22 UTC (rev 
11735)
+++ trunk/property/inc/class.sobudget.inc.php   2014-02-22 18:12:03 UTC (rev 
11736)
@@ -535,7 +535,7 @@
                        $details                = isset($data['details']) ? 
$data['details'] : '';
                        $dimb_id                = isset($data['dimb_id'])  && 
$data['dimb_id'] ? (int)$data['dimb_id'] : 0;
                        $department             = isset($data['department'])  
&& $data['department'] ? (int)$data['department'] : 0;
-                       $direction              = isset($data['direction'])  && 
$data['direction'] ? $data['direction'] : 'expences';
+                       $direction              = isset($data['direction'])  && 
$data['direction'] ? $data['direction'] : 'expenses';
 
                        if(!$year)
                        {
@@ -1134,6 +1134,10 @@
                                }
                        }
 
+                       foreach ($result as &$entry )
+                       {
+                               $entry['percent'] = 
round((($entry['actual_cost'] + 
$entry['obligation'])/$entry['budget_cost'])*100, 1);
+                       }
                        $this->total_records = count($result);
 
                        //cramirez

Modified: trunk/property/inc/class.uibudget.inc.php
===================================================================
--- trunk/property/inc/class.uibudget.inc.php   2014-02-22 17:19:22 UTC (rev 
11735)
+++ trunk/property/inc/class.uibudget.inc.php   2014-02-22 18:12:03 UTC (rev 
11736)
@@ -1106,9 +1106,9 @@
                                (
                                        array
                                        (
-                                               'id' => 'expences',
-                                               'name'  => lang('expences'),
-                                               'selected'      => 
$this->direction == 'expences' ? 1 : 0
+                                               'id' => 'expenses',
+                                               'name'  => lang('expenses'),
+                                               'selected'      => 
$this->direction == 'expenses' ? 1 : 0
                                        ),
                                        array
                                        (
@@ -1302,7 +1302,9 @@
                                array(
                                        'col_name'=>'diff_ex',          
'visible'=>false,       'label'=>'',                            
'className'=>'rightClasss',     'sortable'=>false,      'sort_field'=>'',       
                'formatter'=>''),
                                array(
-                                       'col_name'=>'diff',                     
'visible'=>true,        'label'=>lang('difference'),'className'=>'rightClasss', 
        'sortable'=>false,      'sort_field'=>'',                       
'formatter'=>'')
+                                       'col_name'=>'diff',                     
'visible'=>true,        'label'=>lang('difference'),'className'=>'rightClasss', 
        'sortable'=>false,      'sort_field'=>'',                       
'formatter'=>''),
+                               array(
+                                       'col_name'=>'percent',                  
'visible'=>true,        'label'=>lang('percent'),'className'=>'rightClasss',    
'sortable'=>false,      'sort_field'=>'',                       'formatter'=>'')
                                );
 
 
@@ -1356,7 +1358,8 @@
                                                        'actual_cost'           
=> number_format($entry['actual_cost'], 0, ',', ' '),
                                                        'link_actual_cost'      
=> $GLOBALS['phpgw']->link('/index.php',array('menuaction'=> 
'property.uiinvoice.consume', 'district_id'=> $entry['district_id'], 
'b_account_class'=> $entry['grouping'], 'b_account' =>$entry['b_account'],  
'start_date'=> $start_date, 'end_date'=> $end_date, 'ecodimb' => 
$entry['ecodimb'], 'submit_search'=>true)),
                                                        'diff_ex'               
        => $entry['budget_cost'] - $entry['actual_cost'] - $entry['obligation'],
-                                                       'diff'                  
        => number_format($entry['budget_cost'] - $entry['actual_cost'] - 
$entry['obligation'], 0, ',', ' ')
+                                                       'diff'                  
        => number_format($entry['budget_cost'] - $entry['actual_cost'] - 
$entry['obligation'], 0, ',', ' '),
+                                                       'percent'               
        => $entry['percent']
                                                );
                                }
 




reply via email to

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