fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10062] property: more on budgets


From: Sigurd Nes
Subject: [Fmsystem-commits] [10062] property: more on budgets
Date: Sat, 29 Sep 2012 17:54:09 +0000

Revision: 10062
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10062
Author:   sigurdne
Date:     2012-09-29 17:54:08 +0000 (Sat, 29 Sep 2012)
Log Message:
-----------
property: more on budgets

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/js/yahoo/project.edit.js
    trunk/property/js/yahoo/property2.js

Modified: trunk/property/inc/class.boproject.inc.php
===================================================================
--- trunk/property/inc/class.boproject.inc.php  2012-09-29 16:16:45 UTC (rev 
10061)
+++ trunk/property/inc/class.boproject.inc.php  2012-09-29 17:54:08 UTC (rev 
10062)
@@ -512,6 +512,8 @@
                        $workorder_data                 = 
$this->so->project_workorder_data($project_id);
 
                        $sum_deviation = 0;
+//combined_cost
+//diff
 
                        for ($i=0;$i<count($workorder_data);$i++)
                        {
@@ -545,6 +547,10 @@
 //                             $values['workorder_budget'][$i]['paid_percent'] 
= (int)$workorder_data[$i]['paid_percent'];
                                
$values['workorder_budget'][$i]['addition_percentage'] = 
$workorder_data[$i]['addition_percentage'];
 
+
+                               
$values['workorder_budget'][$i]['combined_cost'] = 
$workorder_data[$i]['closed'] ? 0 : ($_cost - 
$workorder_data[$i]['actual_cost']);
+                               $values['workorder_budget'][$i]['diff'] = 
$_cost - $values['workorder_budget'][$i]['combined_cost'] - 
$values['workorder_budget'][$i]['actual_cost'];
+
                                if(isset($workorder_data[$i]['vendor_id']) && 
$workorder_data[$i]['vendor_id'])
                                {
                                        $vendor['attributes'] = 
$this->custom->find('property','.vendor', 0, '', 'ASC', 'attrib_sort', true, 
true);

Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php  2012-09-29 16:16:45 UTC (rev 
10061)
+++ trunk/property/inc/class.soproject.inc.php  2012-09-29 17:54:08 UTC (rev 
10062)
@@ -863,13 +863,13 @@
                        return $this->db->f('power_meter');
                }
 
-               function project_workorder_data($project_id = '')
+               function project_workorder_data($project_id = 0)
                {
                        $project_id = (int) $project_id;
                        $budget = array();
                        $this->db->query("SELECT fm_workorder.title, 
fm_workorder.actual_cost, fm_workorder.budget, fm_workorder.id as 
workorder_id,fm_workorder.contract_sum,"
                                . " fm_workorder.vendor_id, 
fm_workorder.calculation,fm_workorder.rig_addition,fm_workorder.addition,fm_workorder.deviation,fm_workorder.charge_tenant,"
-                               . " fm_workorder_status.descr as status, 
fm_workorder.account_id as b_account_id"
+                               . " fm_workorder_status.descr as status, 
fm_workorder_status.closed, fm_workorder.account_id as b_account_id"
                                . " FROM fm_workorder {$this->join} 
fm_workorder_status ON fm_workorder.status = fm_workorder_status.id"
                                . " WHERE project_id={$project_id}");
 
@@ -885,6 +885,7 @@
                                        'vendor_id'                     => 
$this->db->f('vendor_id'),
                                        'charge_tenant'         => 
$this->db->f('charge_tenant'),
                                        'status'                        => 
$this->db->f('status'),
+                                       'closed'                        => 
!!$this->db->f('closed'),
                                        'b_account_id'          => 
$this->db->f('b_account_id'),
                                        'contract_sum'          => 
(int)$this->db->f('contract_sum'),
                                        'addition_percentage'   => 
(int)$this->db->f('addition')

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2012-09-29 16:16:45 UTC (rev 
10061)
+++ trunk/property/inc/class.uiproject.inc.php  2012-09-29 17:54:08 UTC (rev 
10062)
@@ -1736,12 +1736,10 @@
                                                                                
                                array('key' => 
'title','label'=>lang('title'),'sortable'=>true,'resizeable'=>true),
                                                                                
                                array('key' => 
'b_account_id','label'=>lang('Budget 
account'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterRight'),
                                                                                
                                array('key' => 
'cost','label'=>lang('cost'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterAmount2'),
-                                                                               
                //              array('key' => 
'budget','label'=>lang('Budget'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterAmount0'),
-                                                                               
                //              array('key' => 
'calculation','label'=>lang('Calculation'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterRight'),
-                                                                               
                //              array('key' => 
'contract_sum','label'=>lang('contract 
sum'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterAmount2'),
                                                                                
                                array('key' => 'addition_percentage','label'=> 
'%','sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterRight'),
+                                                                               
                                array('key' => 
'combined_cost','label'=>lang('sum 
orders'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterAmount0'),
                                                                                
                                array('key' => 
'actual_cost','label'=>lang('actual 
cost'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterAmount2'),
-                                                                               
                //              array('key' => 
'charge_tenant','label'=>lang('charge 
tenant'),'sortable'=>true,'resizeable'=>true),
+                                                                               
                                array('key' => 
'diff','label'=>lang('difference'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterAmount0'),
                                                                                
                                array('key' => 
'vendor_name','label'=>lang('Vendor'),'sortable'=>true,'resizeable'=>true),
                                                                                
                                array('key' => 
'status','label'=>lang('Status'),'sortable'=>true,'resizeable'=>true)))
                                );

Modified: trunk/property/js/yahoo/project.edit.js
===================================================================
--- trunk/property/js/yahoo/project.edit.js     2012-09-29 16:16:45 UTC (rev 
10061)
+++ trunk/property/js/yahoo/project.edit.js     2012-09-29 17:54:08 UTC (rev 
10062)
@@ -133,8 +133,11 @@
                tmp_sum2 = getTotalSum('calculation',2,paginator,datatable);
                tmp_sum3 = getTotalSum('contract_sum',2,paginator,datatable);
 */
-               tmp_sum4 = getTotalSum('actual_cost',2,paginator,datatable);
+               tmp_sum4 = getTotalSum('combined_cost',2,paginator,datatable);
+               tmp_sum5 = getTotalSum('actual_cost',2,paginator,datatable);
+               tmp_sum6 = getTotalSum('diff',2,paginator,datatable);
 
+
                if(typeof(tableYUI1)=='undefined')
                {
                        tableYUI1 = 
YAHOO.util.Dom.getElementsByClassName("yui-dt-data","tbody")[1].parentNode;
@@ -156,6 +159,8 @@
 //             td_sum(tmp_sum3);
                td_empty(1);
                td_sum(tmp_sum4);
+               td_sum(tmp_sum5);
+               td_sum(tmp_sum6);
                td_empty(5);
 
                myfoot = tableYUI1.createTFoot();

Modified: trunk/property/js/yahoo/property2.js
===================================================================
--- trunk/property/js/yahoo/property2.js        2012-09-29 16:16:45 UTC (rev 
10061)
+++ trunk/property/js/yahoo/property2.js        2012-09-29 17:54:08 UTC (rev 
10062)
@@ -345,6 +345,7 @@
                newTD.style.fontWeight = 'bolder';
                newTD.style.textAlign = 'right';
                newTD.style.paddingRight = '0.8em';
+               newTD.style.whiteSpace = 'nowrap';
                newTD.appendChild(document.createTextNode(sum));
                newTR.appendChild(newTD);
        }




reply via email to

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