fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10767] property: budget handling


From: Sigurd Nes
Subject: [Fmsystem-commits] [10767] property: budget handling
Date: Wed, 06 Feb 2013 10:29:26 +0000

Revision: 10767
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10767
Author:   sigurdne
Date:     2013-02-06 10:29:26 +0000 (Wed, 06 Feb 2013)
Log Message:
-----------
property: budget handling

Modified Paths:
--------------
    trunk/property/inc/class.soworkorder.inc.php
    trunk/property/inc/class.uiworkorder.inc.php

Modified: trunk/property/inc/class.soworkorder.inc.php
===================================================================
--- trunk/property/inc/class.soworkorder.inc.php        2013-02-06 10:02:15 UTC 
(rev 10766)
+++ trunk/property/inc/class.soworkorder.inc.php        2013-02-06 10:29:26 UTC 
(rev 10767)
@@ -1775,10 +1775,23 @@
                                        'closed_order'          => false,
                                );
 
-                               $closed_period[$period] = false;
                                $active_period[$period] = 
$this->db->f('active');
                        }
 
+                       foreach ($order_budget as $period => $_budget)
+                       {
+                               $this->db->query("SELECT closed FROM 
fm_workorder"
+                               . " {$this->join} fm_project ON 
fm_workorder.project_id = fm_project.id"
+                               . " {$this->join} fm_project_budget ON 
fm_project.id = fm_project_budget.project_id"
+                               . " WHERE fm_workorder.id = 
'{$_budget['order_id']}'"
+                               . " AND fm_project_budget.year = 
{$_budget['year']}"
+                               . " AND fm_project_budget.month = 
{$_budget['month']}" ,__LINE__,__FILE__);
+                               $this->db->next_record();
+                               $closed_period[$period] = 
$this->db->f('closed');
+                       }
+
+                       reset($order_budget);
+
 //                     if ( $order_budget )
                        {
                                $sql = "SELECT order_id, periode, amount AS 
actual_cost"

Modified: trunk/property/inc/class.uiworkorder.inc.php
===================================================================
--- trunk/property/inc/class.uiworkorder.inc.php        2013-02-06 10:02:15 UTC 
(rev 10766)
+++ trunk/property/inc/class.uiworkorder.inc.php        2013-02-06 10:29:26 UTC 
(rev 10767)
@@ -1815,15 +1815,13 @@
 
                        foreach($content_budget as & $b_entry)
                        {
-                               $checked = $b_entry['closed'] ? 
'checked="checked"' : '';
-                               $checked2 = $b_entry['active'] ? 
'checked="checked"' : '';
-
+                               $checked = $b_entry['active'] ? 
'checked="checked"' : '';
                                $b_entry['flag_active'] = $b_entry['active'];
                                $b_entry['delete_period'] = "<input 
type='checkbox' name='values[delete_b_period][]' 
value='{$b_entry['year']}_{$b_entry['month']}' title='{$lang_delete}'>";
-                               $b_entry['closed'] = "<input type='checkbox' 
name='values[closed_b_period][]' value='{$b_entry['year']}_{$b_entry['month']}' 
title='{$lang_close}' $checked>";
+                               $b_entry['closed'] = $b_entry['closed'] ? 'X' : 
'';
                                $b_entry['closed_orig'] = "<input 
type='checkbox' name='values[closed_orig_b_period][]' 
value='{$b_entry['year']}_{$b_entry['month']}' $checked>";
-                               $b_entry['active'] = "<input type='checkbox' 
name='values[active_b_period][]' value='{$b_entry['year']}_{$b_entry['month']}' 
title='{$lang_active}' $checked2>";
-                               $b_entry['active_orig'] = "<input 
type='checkbox' name='values[active_orig_b_period][]' 
value='{$b_entry['year']}_{$b_entry['month']}' $checked2>";
+                               $b_entry['active'] = "<input type='checkbox' 
name='values[active_b_period][]' value='{$b_entry['year']}_{$b_entry['month']}' 
title='{$lang_active}' $checked>";
+                               $b_entry['active_orig'] = "<input 
type='checkbox' name='values[active_orig_b_period][]' 
value='{$b_entry['year']}_{$b_entry['month']}' $checked>";
 
                        }
                        unset($b_entry);
@@ -1853,7 +1851,7 @@
                                                                                
                                array('key' => 
'deviation_acc','label'=>lang('deviation'). '::' . 
lang('accumulated'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterAmount0'),
                                                                                
                                array('key' => 
'deviation_percent_period','label'=>lang('deviation') . '::' . 
lang('percent'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterAmount2'),
                                                                                
                                array('key' => 
'deviation_percent_acc','label'=>lang('percent'). '::' . 
lang('accumulated'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterAmount2'),
-                                                                               
                                //~ array('key' => 
'closed','label'=>lang('closed'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter'),
+                                                                               
                                array('key' => 
'closed','label'=>lang('closed'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter'),
                                                                                
                                //~ array('key' => 'closed_orig','hidden' => 
true),
                                                                                
                                array('key' => 
'active','label'=>lang('active'),'sortable'=>false,'resizeable'=>true,'formatter'=>'FormatterCenter'),
                                                                                
                                array('key' => 'active_orig','hidden' => true),




reply via email to

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