fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [6541] Rental: changed column name rental_adjustment.


From: Joakim Hop
Subject: [Fmsystem-commits] [6541] Rental: changed column name rental_adjustment. interval to rental_adjustment.adjustment_interval
Date: Thu, 04 Nov 2010 10:07:35 +0000

Revision: 6541
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6541
Author:   joakim_hop
Date:     2010-11-04 10:07:35 +0000 (Thu, 04 Nov 2010)
Log Message:
-----------
Rental: changed column name rental_adjustment.interval to 
rental_adjustment.adjustment_interval

Modified Paths:
--------------
    trunk/rental/inc/class.soadjustment.inc.php
    trunk/rental/setup/setup.inc.php
    trunk/rental/setup/tables_current.inc.php
    trunk/rental/setup/tables_update.inc.php

Modified: trunk/rental/inc/class.soadjustment.inc.php
===================================================================
--- trunk/rental/inc/class.soadjustment.inc.php 2010-11-04 09:27:02 UTC (rev 
6540)
+++ trunk/rental/inc/class.soadjustment.inc.php 2010-11-04 10:07:35 UTC (rev 
6541)
@@ -65,7 +65,7 @@
                }
                else
                {
-                       $cols = 'id, price_item_id, responsibility_id, 
new_price, percent, interval, adjustment_date, adjustment_type, is_executed';
+                       $cols = 'id, price_item_id, responsibility_id, 
new_price, percent, adjustment_interval, adjustment_date, adjustment_type, 
is_executed';
                        $order = $sort_field ? "ORDER BY 
{$this->marshal($sort_field, 'field')} $dir ": ' ORDER BY adjustment_date DESC';
                }
                
@@ -81,7 +81,7 @@
                        
$adjustment->set_responsibility_id($this->unmarshal($this->db->f('responsibility_id',
 true), 'int'));
                        
$adjustment->set_new_price($this->unmarshal($this->db->f('new_price', true), 
'float'));
                        
$adjustment->set_percent($this->unmarshal($this->db->f('percent', true), 
'float'));
-                       
$adjustment->set_interval($this->unmarshal($this->db->f('interval', true), 
'int'));
+                       
$adjustment->set_interval($this->unmarshal($this->db->f('adjustment_interval', 
true), 'int'));
                        
$adjustment->set_adjustment_date($this->unmarshal($this->db->f('adjustment_date',
 true), 'int'));
                        
$adjustment->set_adjustment_type($this->unmarshal($this->db->f('adjustment_type'),
 'string'));
                        
$adjustment->set_is_manual($this->unmarshal($this->db->f('is_manual'),'bool'));
@@ -110,7 +110,7 @@
                        'responsibility_id = ' . 
$adjustment->get_responsibility_id(),
                        'new_price= ' . $adjustment->get_new_price(),
             'percent = '.$adjustment->get_percent(),
-                       'interval = '.$adjustment->get_interval(),
+                       'adjustment_interval = '.$adjustment->get_interval(),
             'adjustment_date = ' . $adjustment->get_adjustment_date(),
                        'adjustment_type = \'' . 
$adjustment->get_adjustment_type() . '\'',
                        'is_manual = ' . ($adjustment->is_manual() ? "true" : 
"false"),
@@ -131,7 +131,7 @@
        public function add(&$adjustment)
        {
                // Build a db-friendly array of the adjustment object
-               $cols = array('price_item_id', 'responsibility_id', 
'new_price', 'percent', 'interval', 'adjustment_date', 'adjustment_type', 
'is_manual', 'is_executed');
+               $cols = array('price_item_id', 'responsibility_id', 
'new_price', 'percent', 'adjustment_interval', 'adjustment_date', 
'adjustment_type', 'is_manual', 'is_executed');
                $values = array(
                        $adjustment->get_price_item_id(),
                        $adjustment->get_responsibility_id(),
@@ -157,7 +157,7 @@
                $query = "SELECT * FROM rental_adjustment WHERE " .
                                 "responsibility_id = 
{$adjustment->get_responsibility_id()} " .
                                 "AND adjustment_date = 
{$adjustment->get_adjustment_date()} " . 
-                                "AND interval = {$adjustment->get_interval()} 
" .
+                                "AND adjustment_interval = 
{$adjustment->get_interval()} " .
                                 "AND percent = {$adjustment->get_percent()}";
                $result = $this->db->query($query);
                if($this->db->next_record())
@@ -214,7 +214,7 @@
                        
$adjustment->set_responsibility_id($this->unmarshal($this->db->f('responsibility_id',
 true), 'int'));
                        
$adjustment->set_new_price($this->unmarshal($this->db->f('new_price', true), 
'float'));
                        
$adjustment->set_percent($this->unmarshal($this->db->f('percent', true), 
'float'));
-                       
$adjustment->set_interval($this->unmarshal($this->db->f('interval', true), 
'int'));
+                       
$adjustment->set_interval($this->unmarshal($this->db->f('adjustment_interval', 
true), 'int'));
                        
$adjustment->set_adjustment_date($this->unmarshal($this->db->f('adjustment_date',
 true), 'int'));
                        
$adjustment->set_adjustment_type($this->unmarshal($this->db->f('adjustment_type'),
 'string'));
                        
$adjustment->set_is_manual($this->unmarshal($this->db->f('is_manual'),'bool'));

Modified: trunk/rental/setup/setup.inc.php
===================================================================
--- trunk/rental/setup/setup.inc.php    2010-11-04 09:27:02 UTC (rev 6540)
+++ trunk/rental/setup/setup.inc.php    2010-11-04 10:07:35 UTC (rev 6541)
@@ -1,6 +1,6 @@
 <?php
        $setup_info['rental']['name'] = 'rental';               // Module 
identifier
-       $setup_info['rental']['version'] = '0.1.0.10';  // Current module 
version
+       $setup_info['rental']['version'] = '0.1.0.11';  // Current module 
version
        $setup_info['rental']['app_order'] = 51;                // (?)
        $setup_info['rental']['tables'] = array(
                'rental_party',                                         // All 
contract participants, tenants etc.

Modified: trunk/rental/setup/tables_current.inc.php
===================================================================
--- trunk/rental/setup/tables_current.inc.php   2010-11-04 09:27:02 UTC (rev 
6540)
+++ trunk/rental/setup/tables_current.inc.php   2010-11-04 10:07:35 UTC (rev 
6541)
@@ -423,16 +423,16 @@
                
                'rental_adjustment' => array(
                        'fd' => array(
-                               'id' =>                 array('type' => 'auto', 
'nullable' => false),
-                               'price_item_id' =>              array('type' => 
'int', 'precision' => '4', 'nullable' => true),
-                               'responsibility_id' =>  array('type' => 'int', 
'precision' => '4', 'nullable' => false),
-                               'adjustment_date' =>    array('type' => 'int', 
'precision' => '8', 'nullable' => true),
-                               'adjustment_type' =>    array('type' => 
'varchar','precision' => '255','nullable' => true),
-                               'new_price' =>                  array('type' => 
'decimal', 'precision' => '20','scale' => '2', 'nullable' => true),
-                               'percent' =>                    array('type' => 
'decimal', 'precision' => '20','scale' => '2', 'nullable' => true),
-                               'interval' =>                   array('type' => 
'int', 'precision' => '4', 'nullable' => true),
-                               'is_manual' =>                  array('type' => 
'bool','nullable' => false,'default' => 'false'),
-                               'is_executed' =>                array('type' => 
'bool','nullable' => false,'default' => 'false')        
+                               'id' =>                         array('type' => 
'auto', 'nullable' => false),
+                               'price_item_id' =>                      
array('type' => 'int', 'precision' => '4', 'nullable' => true),
+                               'responsibility_id' =>          array('type' => 
'int', 'precision' => '4', 'nullable' => false),
+                               'adjustment_date' =>            array('type' => 
'int', 'precision' => '8', 'nullable' => true),
+                               'adjustment_type' =>            array('type' => 
'varchar','precision' => '255','nullable' => true),
+                               'new_price' =>                          
array('type' => 'decimal', 'precision' => '20','scale' => '2', 'nullable' => 
true),
+                               'percent' =>                            
array('type' => 'decimal', 'precision' => '20','scale' => '2', 'nullable' => 
true),
+                               'adjustment_interval' =>        array('type' => 
'int', 'precision' => '4', 'nullable' => true),
+                               'is_manual' =>                          
array('type' => 'bool','nullable' => false,'default' => 'false'),
+                               'is_executed' =>                        
array('type' => 'bool','nullable' => false,'default' => 'false')        
                        ),
                        'pk' => array('id'),
                                'fk' => array(),

Modified: trunk/rental/setup/tables_update.inc.php
===================================================================
--- trunk/rental/setup/tables_update.inc.php    2010-11-04 09:27:02 UTC (rev 
6540)
+++ trunk/rental/setup/tables_update.inc.php    2010-11-04 10:07:35 UTC (rev 
6541)
@@ -195,5 +195,13 @@
                return $GLOBALS['setup_info']['rental']['currentver'];
        }
 
+       $test[] = '0.1.0.10';
+       function rental_upgrade0_1_0_10()
+       {
+               
$GLOBALS['phpgw_setup']->oProc->RenameColumn('rental_adjustment', 'interval', 
'adjustment_interval');
+
+               $GLOBALS['setup_info']['rental']['currentver'] = '0.1.0.11';
+               return $GLOBALS['setup_info']['rental']['currentver'];
+       }
        
 ?>
\ No newline at end of file




reply via email to

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