fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10623] Property: update accounting reporting


From: Sigurd Nes
Subject: [Fmsystem-commits] [10623] Property: update accounting reporting
Date: Sun, 30 Dec 2012 20:21:06 +0000

Revision: 10623
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10623
Author:   sigurdne
Date:     2012-12-30 20:21:05 +0000 (Sun, 30 Dec 2012)
Log Message:
-----------
Property: update accounting reporting

Modified Paths:
--------------
    trunk/property/inc/class.boproject.inc.php
    trunk/property/inc/class.soproject.inc.php
    trunk/property/inc/class.uiproject.inc.php
    trunk/property/templates/base/project.xsl

Modified: trunk/property/inc/class.boproject.inc.php
===================================================================
--- trunk/property/inc/class.boproject.inc.php  2012-12-29 12:52:54 UTC (rev 
10622)
+++ trunk/property/inc/class.boproject.inc.php  2012-12-30 20:21:05 UTC (rev 
10623)
@@ -877,9 +877,9 @@
                        $this->so->delete($project_id);
                }
 
-               function bulk_update_status($start_date, $end_date, 
$status_filter, $status_new, $execute, $type, 
$user_id,$ids,$paid,$closed_orders)
+               function bulk_update_status($start_date, $end_date, 
$status_filter, $status_new, $execute, $type, 
$user_id,$ids,$paid,$closed_orders,$ecodimb)
                {
-                       return $this->so->bulk_update_status($start_date, 
$end_date, $status_filter, $status_new, $execute, $type, 
$user_id,$ids,$paid,$closed_orders);
+                       return $this->so->bulk_update_status($start_date, 
$end_date, $status_filter, $status_new, $execute, $type, 
$user_id,$ids,$paid,$closed_orders,$ecodimb);
                }
 
                public function get_user_list($selected = 0)

Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php  2012-12-29 12:52:54 UTC (rev 
10622)
+++ trunk/property/inc/class.soproject.inc.php  2012-12-30 20:21:05 UTC (rev 
10623)
@@ -927,7 +927,10 @@
                                        }
                                        $entry['obligation'] = $_obligation;
                                }
-                               $entry['diff'] =  $entry['budget'] - 
$entry['obligation'] - $entry['actual_cost'];
+
+                               $_diff_start = abs($entry['budget']) > 0 ? 
$entry['budget'] : $_combined_cost;
+                               $entry['diff'] = $_diff_start - 
$entry['obligation'] - $entry['actual_cost'];                           
+//                             $entry['diff'] =  $entry['budget'] - 
$entry['obligation'] - $entry['actual_cost'];
                        }
 
                        return $values;
@@ -1991,7 +1994,8 @@
                                $entry['month'] = $month == '00' ? '' : $month;
                                if($active_period[$entry['period']])
                                {
-                                       $entry['diff'] = $entry['budget'] - 
$entry['sum_oblications'] - $entry['actual_cost'];                          
+                                       $_diff_start = abs($entry['budget']) > 
0 ? $entry['budget'] : $entry['sum_orders'];
+                                       $entry['diff'] = $_diff_start - 
$entry['sum_oblications'] - $entry['actual_cost'];                              
                                }
                                else
                                {
@@ -2220,7 +2224,7 @@
                }
 
 
-               function bulk_update_status($start_date, $end_date, 
$status_filter, $status_new, $execute, $type, $user_id = 0,$ids,$paid = false, 
$closed_orders = false)
+               function bulk_update_status($start_date, $end_date, 
$status_filter, $status_new, $execute, $type, $user_id = 0,$ids,$paid = false, 
$closed_orders = false, $ecodimb = 0)
                {
                        $start_date = $start_date ? 
phpgwapi_datetime::date_to_timestamp($start_date) : time();
                        $end_date = $end_date ? 
phpgwapi_datetime::date_to_timestamp($end_date) : time();
@@ -2229,9 +2233,15 @@
                        if($user_id)
                        {
                                $user_id = (int) $user_id;
-                               $filter = "AND fm_{$type}.user_id = $user_id";
+                               $filter .= "AND fm_{$type}.user_id = $user_id";
                        }
 
+                       if($ecodimb)
+                       {
+                               $ecodimb = (int) $ecodimb;
+                               $filter .= "AND fm_{$type}.ecodimb = $ecodimb";
+                       }
+
                        if($status_filter)
                        {
                                $user_id = (int) $user_id;

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2012-12-29 12:52:54 UTC (rev 
10622)
+++ trunk/property/inc/class.uiproject.inc.php  2012-12-30 20:21:05 UTC (rev 
10623)
@@ -54,6 +54,7 @@
                var $district_id;
                var $criteria_id;
                var $project_type_id;
+               var $ecodimb;
 
                var $public_functions = array
                        (
@@ -1635,6 +1636,7 @@
                                                        $prefs2 = 
$this->bocommon->create_preferences('property', $prefs['approval_from']);
 
 
+
                                                        
if(isset($prefs2['email']))
                                                        {
                                                                
$supervisor_email[] = array
@@ -2217,6 +2219,7 @@
                        $status_filter  = phpgw::get_var('status_filter');
                        $status_new     = phpgw::get_var('status_new');
                        $type                   = phpgw::get_var('type');
+                       $ecodimb                = phpgw::get_var('ecodimb');
                        $id_to_update   = phpgw::get_var('id_to_update');
                        $paid                   = phpgw::get_var('paid', 
'bool', 'POST');
                        $closed_orders  = phpgw::get_var('closed_orders', 
'bool', 'POST');
@@ -2250,7 +2253,7 @@
 
                        if(($execute || $get_list) && $type)
                        {
-                               $list = 
$this->bo->bulk_update_status($start_date, $end_date, $status_filter, 
$status_new, $execute, $type, $user_id,$ids,$paid,$closed_orders);
+                               $list = 
$this->bo->bulk_update_status($start_date, $end_date, $status_filter, 
$status_new, $execute, $type, $user_id,$ids,$paid,$closed_orders,$ecodimb);
                        }
 
                        $total_records  = count($list);
@@ -2348,6 +2351,7 @@
                                'status_list_new'               => 
array('options' => $status_list_new),
                                'type_list'                             => 
array('options' => $type_array),
                                'user_list'                             => 
array('options' => $user_list),
+                               'ecodimb_list'                  => 
array('options' => 
$this->bocommon->select_category_list(array('type'=>'dimb','selected' => 
$ecodimb))),
                                'start_date'                    => $start_date,
                                'end_date'                              => 
$end_date,
                                'total_records'                 => 
$total_records,

Modified: trunk/property/templates/base/project.xsl
===================================================================
--- trunk/property/templates/base/project.xsl   2012-12-29 12:52:54 UTC (rev 
10622)
+++ trunk/property/templates/base/project.xsl   2012-12-30 20:21:05 UTC (rev 
10623)
@@ -844,6 +844,22 @@
                                        </tr>
                                        <tr>
                                                <td>
+                                                       <xsl:value-of 
select="php:function('lang', 'dimb')"/>
+                                               </td>
+                                               <td>
+                                                       <select name="ecodimb">
+                                                               <xsl:attribute 
name="title">
+                                                                       
<xsl:value-of select="php:function('lang', 'select')"/>
+                                                               </xsl:attribute>
+                                                               <option 
value="0">
+                                                                       
<xsl:value-of select="php:function('lang', 'select')"/>
+                                                               </option>
+                                                               
<xsl:apply-templates select="ecodimb_list/options"/>
+                                                       </select>
+                                               </td>
+                                       </tr>
+                                       <tr>
+                                               <td>
                                                        <xsl:value-of 
select="php:function('lang', 'user')"/>
                                                </td>
                                                <td>




reply via email to

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