fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11806] property: configurable update of project budg


From: Sigurd Nes
Subject: [Fmsystem-commits] [11806] property: configurable update of project budget from orders
Date: Tue, 11 Mar 2014 19:22:15 +0000

Revision: 11806
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11806
Author:   sigurdne
Date:     2014-03-11 19:22:15 +0000 (Tue, 11 Mar 2014)
Log Message:
-----------
property: configurable update of project budget from orders

Modified Paths:
--------------
    trunk/property/inc/class.soproject.inc.php
    trunk/property/templates/base/config.tpl

Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php  2014-03-11 11:41:25 UTC (rev 
11805)
+++ trunk/property/inc/class.soproject.inc.php  2014-03-11 19:22:15 UTC (rev 
11806)
@@ -3073,7 +3073,7 @@
                        {
                                $this->db->transaction_begin();
 
-                               
$this->check_and_update_project_budget($value['project_id'], $value['year']);
+                               
$this->check_and_update_project_budget($value['project_id'], $value['year'], 
true);
 
                                $this->db->transaction_commit();
                        }
@@ -3084,9 +3084,17 @@
                 * Add budget to project if missing.
                 * @param integer $project_id
                 * @param integer $year
+                * @param boolean $force
                 */
-               public function check_and_update_project_budget($project_id, 
$year)
+               public function check_and_update_project_budget($project_id, 
$year, $force = false)
                {
+                       $update_project_budget_from_order = 
isset($this->config->config_data['update_project_budget_from_order']) && 
$this->config->config_data['update_project_budget_from_order'] ? 
$this->config->config_data['update_project_budget_from_order'] : false;
+
+                       if(!$force && !$update_project_budget_from_order)
+                       {
+                               return;
+                       }
+
                        $project_id              = (int) $project_id;
                        $year                    = $year ? (int) $year : 
date('Y');
                        $current_year    = date('Y');

Modified: trunk/property/templates/base/config.tpl
===================================================================
--- trunk/property/templates/base/config.tpl    2014-03-11 11:41:25 UTC (rev 
11805)
+++ trunk/property/templates/base/config.tpl    2014-03-11 19:22:15 UTC (rev 
11806)
@@ -510,7 +510,7 @@
                                </select>
                        </td>
                </tr>
-               <tr class="row_on">
+               <tr class="row_off">
                        <td>{lang_Use_location_at_workorder}.</td>
                        <td>
                                <select 
name="newsettings[location_at_workorder]">
@@ -519,7 +519,7 @@
                                </select>
                        </td>
                </tr>
-               <tr class="row_off">
+               <tr class="row_on">
                        <td>{lang_budget_at_project_level}.</td>
                        <td>
                                <select name="newsettings[budget_at_project]">
@@ -528,6 +528,15 @@
                                </select>
                        </td>
                </tr>
+               <tr class="row_off">
+                       <td>{lang_update_project_budget_from_order}.</td>
+                       <td>
+                               <select 
name="newsettings[update_project_budget_from_order]">
+                                       <option value="" 
{selected_update_project_budget_from_order_}>NO</option>
+                                       <option value="1" 
{selected_update_project_budget_from_order_1}>YES</option>
+                               </select>
+                       </td>
+               </tr>
 
                <tr class="row_off">
                        
<td>{lang_disallow_multiple_condition_types_at_demands}.</td>




reply via email to

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