fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11594] property: tweak bulk update


From: Sigurd Nes
Subject: [Fmsystem-commits] [11594] property: tweak bulk update
Date: Tue, 14 Jan 2014 19:02:03 +0000

Revision: 11594
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11594
Author:   sigurdne
Date:     2014-01-14 19:02:02 +0000 (Tue, 14 Jan 2014)
Log Message:
-----------
property: tweak bulk update

Modified Paths:
--------------
    trunk/property/inc/class.soproject.inc.php
    trunk/property/inc/class.uiproject.inc.php
    trunk/property/js/yahoo/project.bulk_update_status.js

Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php  2014-01-09 13:59:35 UTC (rev 
11593)
+++ trunk/property/inc/class.soproject.inc.php  2014-01-14 19:02:02 UTC (rev 
11594)
@@ -2673,14 +2673,23 @@
                                        {
                                                $join_method .=  " 
{$this->join} fm_orders_actual_cost_view ON fm_workorder.id = 
fm_orders_actual_cost_view.order_id";
                                                $actual_cost = 
',fm_orders_actual_cost_view.actual_cost';
+                                               $group_method ='';
                                        }
+                                       else
+                                       {
+                                               $start_period = (date('Y')-1) . 
'00';
+                                               $end_period = (date('Y')-1) . 
13;
+                                               $join_method .=  " 
{$this->left_join} fm_ecobilagoverf ON ( fm_workorder.id = 
fm_ecobilagoverf.pmwrkord_code AND fm_ecobilagoverf.periode > $start_period AND 
fm_ecobilagoverf.periode < $end_period)";
+                                               $actual_cost = 
',sum(fm_ecobilagoverf.godkjentbelop) AS actual_cost';
+                                               $group_method = "GROUP BY 
fm_workorder.id,fm_workorder_status.closed,fm_workorder_status.descr,fm_project.project_type_id";
+                                       }
 
                                        
$this->_update_status_workorder($execute, $status_new, $ids);
-                                       $sql = "SELECT {$table}.id, 
project_id,{$status_table}.closed, {$status_table}.descr as status 
,{$title_field},{$table}.start_date {$actual_cost},"
+                                       $sql = "SELECT {$table}.id, 
{$table}.project_id,{$status_table}.closed, {$status_table}.descr as status 
,{$title_field},{$table}.start_date {$actual_cost},"
                                        . " project_type_id, continuous"
                                        . " FROM {$table} {$join_method}"
                                        . " WHERE ({$table}.start_date > 
{$start_date} AND {$table}.start_date < {$end_date} {$filter}) OR 
{$table}.start_date is NULL"
-                                       . " ORDER BY {$table}.id DESC";
+                                       . " {$group_method} ORDER BY 
{$table}.id DESC";
                                        break;
                                default:
                                        return array();

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2014-01-09 13:59:35 UTC (rev 
11593)
+++ trunk/property/inc/class.uiproject.inc.php  2014-01-14 19:02:02 UTC (rev 
11594)
@@ -2668,13 +2668,15 @@
                                                                                
                                array('key' => 
'num_open','label'=>lang('open'),'sortable'=>true,'resizeable'=>true 
,'formatter'=>'FormatterRight'),
                                                                                
                                array('key' => 
'project_type','label'=>lang('project 
type'),'sortable'=>true,'resizeable'=>true),
                                                                                
                                array('key' => 
'budget','label'=>lang('budget'),'sortable'=>false,'resizeable'=>true),
-                                                                               
                                array('key' => 
'obligation','label'=>lang('obligation'),'sortable'=>true,'resizeable'=>true),
+                                                                               
                                array('key' => 
'obligation','label'=>lang('obligation'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterRight'),
                                                                                
                                array('key' => 
'new_budget','label'=>lang('new'),'sortable'=>false,'resizeable'=>true),
                                                                                
                                array('key' => 'select','label'=> 
lang('select'), 
'sortable'=>false,'resizeable'=>false,'formatter'=>'myFormatterCheck','width'=>30)
                                                                                
                                ))
                                        );
                                        break;
                                case 'workorder':
+                                       $lang_actual_cost = $paid ? 
lang('actual cost') . ' ' . lang('total') : lang('actual cost') . ' ' . 
(date('Y')-1);
+                                       
                                        $myColumnDefs[0] = array
                                        (
                                                'name'          => "0",
@@ -2686,10 +2688,10 @@
                                                                                
                                array('key' => 
'status','label'=>lang('status'),'sortable'=>true,'resizeable'=>true),
                                                                                
                                array('key' => 
'project_type','label'=>lang('project 
type'),'sortable'=>true,'resizeable'=>true),
                                                                                
                                array('key' => 
'budget','label'=>lang('budget'),'sortable'=>false,'resizeable'=>true),
-                                                                               
                                array('key' => 
'obligation','label'=>lang('obligation'),'sortable'=>true,'resizeable'=>true),
+                                                                               
                                array('key' => 
'obligation','label'=>lang('obligation'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterRight'),
                                                                                
                                array('key' => 
'continuous','label'=>lang('continuous'),'sortable'=>true,'resizeable'=>true),
                                                                                
                                array('key' => 
'new_budget','label'=>lang('new'),'sortable'=>false,'resizeable'=>true),
-                                                                               
                                array('key' => 
'actual_cost','label'=>lang('actual cost'),'sortable'=>true,'resizeable'=>true 
,'formatter'=>'FormatterRight'),
+                                                                               
                                array('key' => 
'actual_cost','label'=>$lang_actual_cost,'sortable'=>true,'resizeable'=>true 
,'formatter'=>'FormatterRight'),
                                                                                
                                array('key' => 'select','label'=> 
lang('select'), 
'sortable'=>false,'resizeable'=>false,'formatter'=>'myFormatterCheck','width'=>30)
                                                                                
                                ))
                                        );

Modified: trunk/property/js/yahoo/project.bulk_update_status.js
===================================================================
--- trunk/property/js/yahoo/project.bulk_update_status.js       2014-01-09 
13:59:35 UTC (rev 11593)
+++ trunk/property/js/yahoo/project.bulk_update_status.js       2014-01-14 
19:02:02 UTC (rev 11594)
@@ -9,13 +9,12 @@
        };
 
 
-
-
-/********************************************************************************/
     
+       
/********************************************************************************/
        var FormatterRight = function(elCell, oRecord, oColumn, oData)
        {
-               elCell.innerHTML = "<div align=\"right\">"+oData+"</div>";
+               elCell.innerHTML = "<div 
align=\"right\">"+YAHOO.util.Number.format(oData, {decimalPlaces:0, 
decimalSeparator:"", thousandsSeparator:" "})+"</div>";
        }       
+
        
 
/********************************************************************************/
     
        this.myParticularRenderEvent = function(num)




reply via email to

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