fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15746] property: invoice handling


From: sigurdne
Subject: [Fmsystem-commits] [15746] property: invoice handling
Date: Wed, 28 Sep 2016 08:42:41 +0000 (UTC)

Revision: 15746
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15746
Author:   sigurdne
Date:     2016-09-28 08:42:40 +0000 (Wed, 28 Sep 2016)
Log Message:
-----------
property: invoice handling

Modified Paths:
--------------
    trunk/property/inc/class.soinvoice.inc.php
    trunk/property/inc/class.sotts.inc.php
    trunk/property/inc/class.uitts.inc.php
    trunk/property/setup/setup.inc.php
    trunk/property/setup/tables_current.inc.php
    trunk/property/setup/tables_update.inc.php

Modified: trunk/property/inc/class.soinvoice.inc.php
===================================================================
--- trunk/property/inc/class.soinvoice.inc.php  2016-09-28 08:40:34 UTC (rev 
15745)
+++ trunk/property/inc/class.soinvoice.inc.php  2016-09-28 08:42:40 UTC (rev 
15746)
@@ -602,9 +602,9 @@
                        $sql = "SELECT DISTINCT 
pmwrkord_code,bilagsnr,bilagsnr_ut,fakturanr,sum(belop) as belop, 
sum(godkjentbelop) as godkjentbelop,"
                                . " 
currency,budsjettansvarligid,org_name,periode,periodization,periodization_start"
                                . " FROM {$table}"
-                               . " {$this->join} fm_ecoart ON fm_ecoart.id = 
$table.artid"
-                               . " {$this->join} fm_workorder ON 
fm_workorder.id = $table.pmwrkord_code"
-                               . " {$this->join} fm_project ON 
fm_workorder.project_id = fm_project.id"
+//                             . " {$this->join} fm_ecoart ON fm_ecoart.id = 
$table.artid"
+//                             . " {$this->join} fm_workorder ON 
fm_workorder.id = $table.pmwrkord_code"
+//                             . " {$this->join} fm_project ON 
fm_workorder.project_id = fm_project.id"
                                . " {$this->join} fm_vendor ON 
{$table}.spvend_code = fm_vendor.id {$filtermethod} {$groupmethod}";
 
                        $this->db->query($sql . $ordermethod, __LINE__, 
__FILE__);

Modified: trunk/property/inc/class.sotts.inc.php
===================================================================
--- trunk/property/inc/class.sotts.inc.php      2016-09-28 08:40:34 UTC (rev 
15745)
+++ trunk/property/inc/class.sotts.inc.php      2016-09-28 08:42:40 UTC (rev 
15746)
@@ -1565,7 +1565,8 @@
                                $order_id = 
execMethod('property.socommon.increment_id', 'order');
                                if ($order_id)
                                {
-                                       $this->db->query("UPDATE fm_tts_tickets 
SET order_id = {$order_id} WHERE id={$id}", __LINE__, __FILE__);
+                                       $this->db->query("UPDATE fm_tts_tickets 
SET order_id = {$order_id}, ordered_by = {$this->account} WHERE id={$id}", 
__LINE__, __FILE__);
+                                       $this->db->query("INSERT INTO fm_orders 
(id,type) VALUES ({$order_id},'ticket')");
                                }
                        }
 

Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php      2016-09-28 08:40:34 UTC (rev 
15745)
+++ trunk/property/inc/class.uitts.inc.php      2016-09-28 08:42:40 UTC (rev 
15746)
@@ -2515,9 +2515,9 @@
                        // start invoice
                        $invoices = array();
                        $active_invoices = 
execMethod('property.soinvoice.read_invoice_sub_sum', array(
-                               'order_id' => $id));
+                               'order_id' => $ticket['order_id']));
                        $historical_invoices = 
execMethod('property.soinvoice.read_invoice_sub_sum', array(
-                               'order_id' => $id,
+                               'order_id' => $ticket['order_id'],
                                'paid' => true));
                        $invoices = array_merge($active_invoices, 
$historical_invoices);
 
@@ -2636,7 +2636,7 @@
                                        'sortable' => false,
                                        'className' => 'right',
                                        'value_footer' => 
number_format($approved_amount, 2, $this->decimal_separator, '.')),
-                               array(
+/*                             array(
                                        'key' => 'period',
                                        'label' => lang('period'),
                                        'sortable' => false),
@@ -2647,7 +2647,7 @@
                                array(
                                        'key' => 'periodization_start',
                                        'label' => lang('periodization start'),
-                                       'sortable' => false),
+                                       'sortable' => false),*/
                                array(
                                        'key' => 'currency',
                                        'label' => lang('currency'),

Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php  2016-09-28 08:40:34 UTC (rev 15745)
+++ trunk/property/setup/setup.inc.php  2016-09-28 08:42:40 UTC (rev 15746)
@@ -11,7 +11,7 @@
         * @version $Id$
        */
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.705';
+       $setup_info['property']['version']              = '0.9.17.706';
        $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 2016-09-28 08:40:34 UTC (rev 
15745)
+++ trunk/property/setup/tables_current.inc.php 2016-09-28 08:42:40 UTC (rev 
15746)
@@ -1146,6 +1146,7 @@
                                'finnish_date2' => array('type' => 'int', 
'precision' => '4', 'nullable' => True),
                                'contact_id' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
                                'order_id' => array('type' => 'int', 
'precision' => 8, 'nullable' => True),
+                               'ordered_by' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),
                                'vendor_id' => array('type' => 'int', 
'precision' => '4', 'nullable' => True),
                                'contract_id' => array('type' => 'varchar', 
'precision' => '30', 'nullable' => True),
                                'tax_code' => array('type' => 'int', 
'precision' => 4, 'nullable' => True),

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2016-09-28 08:40:34 UTC (rev 
15745)
+++ trunk/property/setup/tables_update.inc.php  2016-09-28 08:42:40 UTC (rev 
15746)
@@ -9249,7 +9249,6 @@
                );
 
                $GLOBALS['phpgw_setup']->oProc->query("SELECT DISTINCT 
account_id, project_id FROM fm_workorder WHERE account_id IS NOT NULL AND 
account_id != '0'");
-               $GLOBALS['phpgw_setup']->oProc->next_record();
                $projects = array();
                while($GLOBALS['phpgw_setup']->oProc->next_record())
                {
@@ -9309,3 +9308,41 @@
                        return $GLOBALS['setup_info']['property']['currentver'];
                }
        }
+
+       /**
+       * Update property version from 0.9.17.705 to 0.9.17.706
+       *
+       */
+       $test[] = '0.9.17.705';
+
+       function property_upgrade0_9_17_705()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               $GLOBALS['phpgw_setup']->oProc->query("SELECT DISTINCT order_id 
FROM fm_tts_tickets WHERE order_id IS NOT NULL");
+               $orders = array();
+               while($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $orders[] = 
$GLOBALS['phpgw_setup']->oProc->f('order_id');
+               }
+
+               foreach ($orders as $order_id)
+               {
+                       $GLOBALS['phpgw_setup']->oProc->query("INSERT INTO 
fm_orders (id,type) VALUES ({$order_id},'ticket')");
+               }
+
+               $GLOBALS['phpgw_setup']->oProc->AddColumn("fm_tts_tickets", 
'ordered_by', array(
+                       'type' => 'int',
+                       'precision' => 4,
+                       'nullable' => True
+                       )
+               );
+
+               $GLOBALS['phpgw_setup']->oProc->query("UPDATE fm_tts_tickets 
SET ordered_by = assignedto WHERE order_id IS NOT NULL");
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.706';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }




reply via email to

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