fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7076] property:contract_sum on order


From: Sigurd Nes
Subject: [Fmsystem-commits] [7076] property:contract_sum on order
Date: Mon, 07 Mar 2011 14:29:47 +0000

Revision: 7076
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7076
Author:   sigurdne
Date:     2011-03-07 14:29:47 +0000 (Mon, 07 Mar 2011)
Log Message:
-----------
property:contract_sum on order

Modified Paths:
--------------
    trunk/property/inc/class.boproject.inc.php
    trunk/property/inc/class.boworkorder.inc.php
    trunk/property/inc/class.soproject.inc.php
    trunk/property/inc/class.soworkorder.inc.php
    trunk/property/inc/class.uiproject.inc.php
    trunk/property/inc/class.uiworkorder.inc.php
    trunk/property/js/yahoo/project.edit.js
    trunk/property/setup/phpgw_no.lang
    trunk/property/setup/setup.inc.php
    trunk/property/setup/tables_current.inc.php
    trunk/property/setup/tables_update.inc.php
    trunk/property/templates/base/workorder.xsl

Modified: trunk/property/inc/class.boproject.inc.php
===================================================================
--- trunk/property/inc/class.boproject.inc.php  2011-03-07 14:23:53 UTC (rev 
7075)
+++ trunk/property/inc/class.boproject.inc.php  2011-03-07 14:29:47 UTC (rev 
7076)
@@ -477,6 +477,7 @@
 
                                
$values['workorder_budget'][$i]['title']=$workorder_data[$i]['title'];
                                
$values['workorder_budget'][$i]['workorder_id']=$workorder_data[$i]['workorder_id'];
+                               
$values['workorder_budget'][$i]['contract_sum']=number_format($workorder_data[$i]['contract_sum'],
 2, ',', '');
                                
$values['workorder_budget'][$i]['budget']=number_format($workorder_data[$i]['budget'],
 2, ',', '');
                                
$values['workorder_budget'][$i]['calculation']=number_format($workorder_data[$i]['calculation']*$tax,
 2, ',', '');
                                
$values['workorder_budget'][$i]['charge_tenant'] = 
$workorder_data[$i]['charge_tenant'];

Modified: trunk/property/inc/class.boworkorder.inc.php
===================================================================
--- trunk/property/inc/class.boworkorder.inc.php        2011-03-07 14:23:53 UTC 
(rev 7075)
+++ trunk/property/inc/class.boworkorder.inc.php        2011-03-07 14:29:47 UTC 
(rev 7076)
@@ -212,6 +212,12 @@
                                        'name'=> lang('billable hours'),
                                        'sortable'      => true
                                );
+                       $columns['contract_sum'] = array
+                               (
+                                       'id' => 'contract_sum',
+                                       'name'=> lang('contract sum'),
+                                       'sortable'      => true
+                               );
 
                        return $columns;
                }

Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php  2011-03-07 14:23:53 UTC (rev 
7075)
+++ trunk/property/inc/class.soproject.inc.php  2011-03-07 14:29:47 UTC (rev 
7076)
@@ -644,7 +644,7 @@
                {
                        $project_id = (int) $project_id;
                        $budget = array();
-                       $this->db->query("SELECT fm_workorder.title, 
act_mtrl_cost, act_vendor_cost, budget, fm_workorder.id as workorder_id,"
+                       $this->db->query("SELECT fm_workorder.title, 
act_mtrl_cost, act_vendor_cost, budget, fm_workorder.id as 
workorder_id,contract_sum,"
                                ." vendor_id, 
calculation,rig_addition,addition,deviation,charge_tenant,fm_workorder_status.descr
 as status, 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}");
                        while ($this->db->next_record())
@@ -661,6 +661,7 @@
                                        'charge_tenant'         => 
$this->db->f('charge_tenant'),
                                        'status'                        => 
$this->db->f('status'),
                                        'b_account_id'          => 
$this->db->f('b_account_id'),
+                                       'contract_sum'          => 
(int)$this->db->f('contract_sum'),
                                );
                        }
                        return $budget;

Modified: trunk/property/inc/class.soworkorder.inc.php
===================================================================
--- trunk/property/inc/class.soworkorder.inc.php        2011-03-07 14:23:53 UTC 
(rev 7075)
+++ trunk/property/inc/class.soworkorder.inc.php        2011-03-07 14:29:47 UTC 
(rev 7076)
@@ -197,7 +197,8 @@
                                $cols_return[]                          = 
'end_date';
                                $cols.= ",fm_workorder.ecodimb";
                                $cols_return[]                          = 
'ecodimb';
-
+                               $cols.= ",fm_workorder.contract_sum";
+                               $cols_return[]                          = 
'contract_sum';
 /*
                                $uicols['input_type'][]         = 'text';
                                $uicols['name'][]                       = 
'entry_date';
@@ -675,6 +676,7 @@
                                                'cat_id'                        
        => $this->db->f('category'),
                                                'grants'                        
        => (int)$this->grants[$this->db->f('user_id')],
                                                'billable_hours'                
=> $this->db->f('billable_hours'),
+                                               'contract_sum'                  
=> $this->db->f('contract_sum'),
                                        );
                        }
 
@@ -923,13 +925,14 @@
                                        $this->account,
                                        $workorder['ecodimb'],
                                        $workorder['cat_id'],
-                                       $workorder['billable_hours']
+                                       $workorder['billable_hours'],
+                                       $workorder['contract_sum']
                                );
 
                        $values = $this->bocommon->validate_db_insert($values);
 
                        $this->db->query("INSERT INTO fm_workorder 
(id,num,project_id,title,access,entry_date,start_date,end_date,status,"
-                               . 
"descr,budget,combined_cost,account_id,rig_addition,addition,key_deliver,key_fetch,vendor_id,charge_tenant,user_id,ecodimb,category,billable_hours
 $cols) "
+                               . 
"descr,budget,combined_cost,account_id,rig_addition,addition,key_deliver,key_fetch,vendor_id,charge_tenant,user_id,ecodimb,category,billable_hours,contract_sum
 $cols) "
                                . "VALUES ( $values $vals)",__LINE__,__FILE__);
 
                        $this->db->query("INSERT INTO fm_orders (id,type) 
VALUES ({$id},'workorder')");
@@ -1039,7 +1042,8 @@
                                        'vendor_id'             => 
$workorder['vendor_id'],
                                        'ecodimb'               => 
$workorder['ecodimb'],
                                        'category'              => 
$workorder['cat_id'],
-                                       'billable_hours'=> 
$workorder['billable_hours']
+                                       'billable_hours'=> 
$workorder['billable_hours'],
+                                       'contract_sum'  => 
$workorder['contract_sum'],
                                );
 
                        if($workorder['status'] == 'closed')

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2011-03-07 14:23:53 UTC (rev 
7075)
+++ trunk/property/inc/class.uiproject.inc.php  2011-03-07 14:29:47 UTC (rev 
7076)
@@ -1554,6 +1554,7 @@
                                        'values'        =>      
json_encode(array(      array('key' => 
'workorder_id','label'=>lang('Workorder'),'sortable'=>true,'resizeable'=>true,'formatter'=>'YAHOO.widget.DataTable.formatLink'),
                                                                                
                                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' => 
'contract_sum','label'=>lang('contract 
sum'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterRight'),
                                                                                
                                array('key' => 
'budget','label'=>lang('Budget'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterRight'),
                                                                                
                                array('key' => 
'calculation','label'=>lang('Calculation'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterRight'),
                                                                                
                                array('key' => 
'actual_cost','label'=>lang('actual 
cost'),'sortable'=>true,'resizeable'=>true,'formatter'=>'FormatterRight'),

Modified: trunk/property/inc/class.uiworkorder.inc.php
===================================================================
--- trunk/property/inc/class.uiworkorder.inc.php        2011-03-07 14:23:53 UTC 
(rev 7075)
+++ trunk/property/inc/class.uiworkorder.inc.php        2011-03-07 14:29:47 UTC 
(rev 7076)
@@ -1595,6 +1595,8 @@
                                        'lang_calculation'                      
                        => lang('Calculation'),
                                        'value_calculation'                     
                        => 
(isset($values['calculation'])?$values['calculation']:''),
                                        'value_sum_estimated_cost'              
                => $sum_estimated_cost,
+                                       
+                                       'value_contract_sum'                    
                => $values['contract_sum'],
 
                                        'actual_cost'                           
                        => 
(isset($values['actual_cost'])?$values['actual_cost']:''),
                                        'lang_actual_cost'                      
                        => lang('Actual cost'),

Modified: trunk/property/js/yahoo/project.edit.js
===================================================================
--- trunk/property/js/yahoo/project.edit.js     2011-03-07 14:23:53 UTC (rev 
7075)
+++ trunk/property/js/yahoo/project.edit.js     2011-03-07 14:29:47 UTC (rev 
7076)
@@ -42,6 +42,7 @@
                tmp_sum1 = getSumPerPage('budget',2,paginator,datatable);
                tmp_sum2 = getSumPerPage('calculation',2,paginator,datatable);
                tmp_sum3 = getSumPerPage('actual_cost',2,paginator,datatable);
+               tmp_sum4 = getSumPerPage('contract_sum',2,paginator,datatable);
 
                if(typeof(tableYUI)=='undefined')
                {
@@ -58,6 +59,7 @@
 
                td_sum('Sum');
                td_empty(2);
+               td_sum(tmp_sum4);
                td_sum(tmp_sum1);
                td_sum(tmp_sum2);
                td_sum(tmp_sum3);

Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang  2011-03-07 14:23:53 UTC (rev 7075)
+++ trunk/property/setup/phpgw_no.lang  2011-03-07 14:29:47 UTC (rev 7076)
@@ -354,6 +354,7 @@
 content        property        no      innhold
 contractual obligations        property        no      regnskap
 contracts      property        no      Kontrakter
+contract sum   property        no      Kontrakt sum
 conversion     property        no      format
 coordination   property        no      Koordinering
 coordinator    property        no      Koordinator

Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php  2011-03-07 14:23:53 UTC (rev 7075)
+++ trunk/property/setup/setup.inc.php  2011-03-07 14:29:47 UTC (rev 7076)
@@ -12,7 +12,7 @@
        */
 
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.611';
+       $setup_info['property']['version']              = '0.9.17.612';
        $setup_info['property']['app_order']    = 8;
        $setup_info['property']['enable']               = 1;
        $setup_info['property']['app_group']    = 'office';

Modified: trunk/property/setup/tables_current.inc.php
===================================================================
--- trunk/property/setup/tables_current.inc.php 2011-03-07 14:23:53 UTC (rev 
7075)
+++ trunk/property/setup/tables_current.inc.php 2011-03-07 14:29:47 UTC (rev 
7076)
@@ -519,7 +519,8 @@
                                'contact_phone' => array('type' => 
'varchar','precision' => '20','nullable' => True),
                                'paid_percent' => array('type' => 
'int','precision' => 4,'nullable' => True,'default' => 0),
                                'event_id' => array('type' => 'int','precision' 
=> 4,'nullable' => True),
-                               'billable_hours' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True)
+                               'billable_hours' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True),
+                               'contract_sum' => array('type' => 
'decimal','precision' => '20','scale' => '2','nullable' => True,'default' => 
'0.00'),
                        ),
                        'pk' => array('id'),
                        'fk' => array(),

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2011-03-07 14:23:53 UTC (rev 
7075)
+++ trunk/property/setup/tables_update.inc.php  2011-03-07 14:29:47 UTC (rev 
7076)
@@ -5088,6 +5088,28 @@
        }
 
        /**
+       * Update property version from 0.9.17.611 to 0.9.17.612
+       * Add contract sum to orders
+       * 
+       */
+
+       $test[] = '0.9.17.611';
+       function property_upgrade0_9_17_611()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_workorder','contract_sum',array('type'
 => 'decimal','precision' => '20','scale' => '2','nullable' => True,'default' 
=> '0.00'));
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.612';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }
+
+
+
+       /**
        * Update property version from 0.9.17.607 to 0.9.17.608
        * Add more room for address at tickets
        * 

Modified: trunk/property/templates/base/workorder.xsl
===================================================================
--- trunk/property/templates/base/workorder.xsl 2011-03-07 14:23:53 UTC (rev 
7075)
+++ trunk/property/templates/base/workorder.xsl 2011-03-07 14:29:47 UTC (rev 
7076)
@@ -703,6 +703,16 @@
 
                        <tr>
                                <td valign="top">
+                                       <xsl:value-of 
select="php:function('lang', 'contract sum')" />
+                               </td>
+                               <td>
+                                       <input type="text" 
name="values[contract_sum]" value="{value_contract_sum}" >
+                                       </input>
+                                       <xsl:text> </xsl:text> [ <xsl:value-of 
select="currency"/> ]
+                               </td>
+                       </tr>
+                       <tr>
+                               <td valign="top">
                                        <xsl:value-of select="lang_budget"/>
                                </td>
                                <td>




reply via email to

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