fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [16477] property: budget


From: sigurdne
Subject: [Fmsystem-commits] [16477] property: budget
Date: Fri, 24 Mar 2017 11:42:53 -0400 (EDT)

Revision: 16477
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16477
Author:   sigurdne
Date:     2017-03-24 11:42:52 -0400 (Fri, 24 Mar 2017)
Log Message:
-----------
property: budget

Modified Paths:
--------------
    trunk/property/inc/class.sogeneric.inc.php
    trunk/property/inc/class.soproject.inc.php
    trunk/property/inc/class.uiproject.inc.php
    trunk/property/inc/cron/default/oppdater_betalte_faktura_BK.php
    trunk/property/js/portico/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

Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php  2017-03-24 09:09:40 UTC (rev 
16476)
+++ trunk/property/inc/class.sogeneric.inc.php  2017-03-24 15:42:52 UTC (rev 
16477)
@@ -1031,6 +1031,12 @@
                                                                'name' => 
'closed',
                                                                'descr' => 
lang('closed'),
                                                                'type' => 
'checkbox'
+                                                       ),
+                                                       array
+                                                               (
+                                                               'name' => 
'canceled',
+                                                               'descr' => 
lang('canceled'),
+                                                               'type' => 
'checkbox'
                                                        )
                                                ),
                                                'edit_msg' => lang('edit 
status'),

Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php  2017-03-24 09:09:40 UTC (rev 
16476)
+++ trunk/property/inc/class.soproject.inc.php  2017-03-24 15:42:52 UTC (rev 
16477)
@@ -1039,11 +1039,11 @@
                        $filter_year = '';
                        if ($year)
                        {
-                               $filter_year = "AND (fm_workorder_budget.year = 
{$year} OR fm_workorder_status.closed IS NULL)";
+                               $filter_year = "AND (fm_workorder_budget.year = 
{$year})";// OR fm_workorder_status.closed IS NULL)";
                        }
 
                        $sql =  "SELECT DISTINCT fm_workorder.id AS 
workorder_id, fm_workorder.title, fm_workorder.vendor_id, 
fm_workorder.addition,"
-                               . " fm_workorder_status.descr as status, 
fm_workorder_status.closed, fm_workorder.account_id AS b_account_id, 
fm_workorder.charge_tenant,"
+                               . " fm_workorder_status.descr as status, 
fm_workorder_status.closed, fm_workorder_status.canceled, 
fm_workorder.account_id AS b_account_id, fm_workorder.charge_tenant,"
                                . " fm_workorder.mail_recipients"
                                . " FROM fm_workorder"
                                . " {$this->join} fm_workorder_status ON 
fm_workorder.status = fm_workorder_status.id"
@@ -1073,6 +1073,7 @@
                                        'charge_tenant' => 
$this->db->f('charge_tenant'),
                                        'status' => $this->db->f('status'),
                                        'closed' => !!$this->db->f('closed'),
+                                       'canceled' => 
!!$this->db->f('canceled'),
                                        'mail_recipients' => explode(',', 
trim($this->db->f('mail_recipients'), ',')),
                                        'b_account_id' => 
$this->db->f('b_account_id'),
                                        'addition_percentage' => 
(int)$this->db->f('addition'),
@@ -1099,10 +1100,18 @@
                        {
                                foreach ($order_budgets[$entry['workorder_id']] 
as $budget)
                                {
-                                       if ($budget['active'] == 2)
+                                       if ($budget['active'] == 2)// || 
$entry['canceled'])
                                        {
                                                continue;
                                        }
+                                       else if($entry['canceled'])
+                                       {
+                                               $entry['actual_cost'] = 0;
+                                               $entry['combined_cost'] = 0;
+                                               $entry['budget'] = 0;
+                                               $entry['obligation'] = 0;
+                                               continue;
+                                       }
 
                                        if ($year)
                                        {
@@ -2245,6 +2254,11 @@
                                . " FROM fm_workorder"
                                . " WHERE project_id = {$project_id}";
 
+                       $sql = "SELECT fm_workorder.id AS order_id, 
vendor_id,fm_workorder_status.canceled"
+                               . " FROM fm_workorder"
+                               . " {$this->join} fm_workorder_status ON 
fm_workorder.status = fm_workorder_status.id"
+                               . " WHERE project_id = {$project_id} AND 
fm_workorder_status.canceled IS NULL";
+
                        $this->db->query($sql, __LINE__, __FILE__);
                        $_order_list = array();
                        $_vendor_list = array();

Modified: trunk/property/inc/class.uiproject.inc.php
===================================================================
--- trunk/property/inc/class.uiproject.inc.php  2017-03-24 09:09:40 UTC (rev 
16476)
+++ trunk/property/inc/class.uiproject.inc.php  2017-03-24 15:42:52 UTC (rev 
16477)
@@ -1661,9 +1661,7 @@
                                                $sum_actual_cost += 
$b_entry['actual_cost'];
                                                $sum_oblications += 
$b_entry['sum_oblications'];
                                                $values['sum'] += 
$b_entry['budget'];
-                                       }
-                                       if ($b_entry['active'])
-                                       {
+
                                                $s_budget += $b_entry['budget'];
                                                $s_orders += 
$b_entry['sum_orders'];
                                                $s_actual_cost += 
$b_entry['actual_cost'];

Modified: trunk/property/inc/cron/default/oppdater_betalte_faktura_BK.php
===================================================================
--- trunk/property/inc/cron/default/oppdater_betalte_faktura_BK.php     
2017-03-24 09:09:40 UTC (rev 16476)
+++ trunk/property/inc/cron/default/oppdater_betalte_faktura_BK.php     
2017-03-24 15:42:52 UTC (rev 16477)
@@ -44,6 +44,13 @@
                        $this->function_name = get_class($this);
                        $this->sub_location = lang('property');
                        $this->function_msg = 'oppdater bestillinger med 
grunnlag i betalte faktura';
+                       /**
+                        * Bruker konffigurasjon fra '.ticket' - fordi denne 
definerer oppslaget mot fullmaktsregisteret ved bestilling.
+                        */
+                       $config                                 = 
CreateObject('admin.soconfig', $GLOBALS['phpgw']->locations->get_id('property', 
'.ticket'));
+                       $this->soap_url                 = 
$config->config_data['external_register']['url'];
+                       $this->soap_username    = 
$config->config_data['external_register']['username'];
+                       $this->soap_password    = 
$config->config_data['external_register']['password'];
                }
 
                function execute()
@@ -164,8 +171,26 @@
 
                function check_payment( $voucher_id )
                {
-                                       //curl -s -u portico:BgPor790gfol 
http://tjenester.usrv.ubergenkom.no/api/agresso/tjeneste?id=88010
+                       //curl -s -u portico:BgPor790gfol 
http://tjenester.usrv.ubergenkom.no/api/agresso/tjeneste?id=88010
+                       $url            = $this->soap_url;
+                       $username       = $this->soap_username; //'portico';
+                       $password       = $this->soap_password; 
//'BgPor790gfol';
 
+                       $ch = curl_init();
+                       curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
+                       curl_setopt($ch, CURLOPT_URL, $url);
+                       curl_setopt($ch, CURLOPT_USERPWD, 
"{$username}:{$password}");
+                       curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
+                       curl_setopt($ch, CURLOPT_HTTPHEADER, array( 
'Content-Type: application/json'));
+                       curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
+
+                       $result = curl_exec($ch);
+
+                       $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
+                       curl_close($ch);
+
+                       $result = json_decode($result, true);
+
                        return false;
 
                }

Modified: trunk/property/js/portico/project.edit.js
===================================================================
--- trunk/property/js/portico/project.edit.js   2017-03-24 09:09:40 UTC (rev 
16476)
+++ trunk/property/js/portico/project.edit.js   2017-03-24 15:42:52 UTC (rev 
16477)
@@ -67,7 +67,7 @@
        }
 };
 
-function sum_columns_table_orders()
+this.local_DrawCallback1 = function ()
 {
        var api = oTable1.api();
        // Remove the formatting to get integer data for summation
@@ -95,7 +95,7 @@
        });
 }
 
-function sum_columns_table_invoice()
+this.local_DrawCallback2 = function ()
 {
        var api = oTable2.api();
        // Remove the formatting to get integer data for summation
@@ -180,17 +180,17 @@
                JqueryPortico.updateinlineTableHelper(oTable2, requestUrl2);
        });
 
-       if (typeof (oTable1) !== 'undefined')
-       {
-               var api1 = oTable1.api();
-               api1.on('draw', sum_columns_table_orders);
-       }
+//     if (typeof (oTable1) !== 'undefined')
+//     {
+//             var api1 = oTable1.api();
+//             api1.on('draw', sum_columns_table_orders);
+//     }
 
-       if (typeof (oTable2) !== 'undefined')
-       {
-               var api2 = oTable2.api();
-               api2.on('draw', sum_columns_table_invoice);
-       }
+//     if (typeof (oTable2) !== 'undefined')
+//     {
+//             var api2 = oTable2.api();
+//             api2.on('draw', sum_columns_table_invoice);
+//     }
 
 
 // -- buttons--//

Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang  2017-03-24 09:09:40 UTC (rev 16476)
+++ trunk/property/setup/phpgw_no.lang  2017-03-24 15:42:52 UTC (rev 16477)
@@ -2103,4 +2103,5 @@
 category template      property        no      Kategori mal
 profile        property        no      Profil
 new attribute  property        no      Ny attributt
-report property        no      Rapport
\ No newline at end of file
+report property        no      Rapport
+canceled       property        no      Kansellert
\ No newline at end of file

Modified: trunk/property/setup/setup.inc.php
===================================================================
--- trunk/property/setup/setup.inc.php  2017-03-24 09:09:40 UTC (rev 16476)
+++ trunk/property/setup/setup.inc.php  2017-03-24 15:42:52 UTC (rev 16477)
@@ -11,7 +11,7 @@
         * @version $Id$
        */
        $setup_info['property']['name']                 = 'property';
-       $setup_info['property']['version']              = '0.9.17.709';
+       $setup_info['property']['version']              = '0.9.17.710';
        $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 2017-03-24 09:09:40 UTC (rev 
16476)
+++ trunk/property/setup/tables_current.inc.php 2017-03-24 15:42:52 UTC (rev 
16477)
@@ -620,7 +620,8 @@
                                'approved' => array('type' => 'int', 
'precision' => '2', 'nullable' => True),
                                'in_progress' => array('type' => 'int', 
'precision' => '2', 'nullable' => True),
                                'delivered' => array('type' => 'int', 
'precision' => '2', 'nullable' => True),
-                               'closed' => array('type' => 'int', 'precision' 
=> '2', 'nullable' => True)
+                               'closed' => array('type' => 'int', 'precision' 
=> '2', 'nullable' => True),
+                               'canceled' => array('type' => 'int', 
'precision' => '2', 'nullable' => True)
                        ),
                        'pk' => array('id'),
                        'fk' => array(),

Modified: trunk/property/setup/tables_update.inc.php
===================================================================
--- trunk/property/setup/tables_update.inc.php  2017-03-24 09:09:40 UTC (rev 
16476)
+++ trunk/property/setup/tables_update.inc.php  2017-03-24 15:42:52 UTC (rev 
16477)
@@ -9436,3 +9436,22 @@
                }
        }
 
+       /**
+       * Update property version from 0.9.17.709 to 0.9.17.710
+       *
+       */
+       $test[] = '0.9.17.709';
+
+       function property_upgrade0_9_17_709()
+       {
+               $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('fm_workorder_status', 'canceled', 
array(
+                       'type' => 'int', 'precision' => 2, 'nullable' => True));
+
+               if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+               {
+                       $GLOBALS['setup_info']['property']['currentver'] = 
'0.9.17.710';
+                       return $GLOBALS['setup_info']['property']['currentver'];
+               }
+       }




reply via email to

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