fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10929] Property: budget handling


From: Sigurd Nes
Subject: [Fmsystem-commits] [10929] Property: budget handling
Date: Tue, 19 Feb 2013 20:24:09 +0000

Revision: 10929
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10929
Author:   sigurdne
Date:     2013-02-19 20:24:08 +0000 (Tue, 19 Feb 2013)
Log Message:
-----------
Property: budget handling

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

Modified: trunk/property/inc/class.soworkorder.inc.php
===================================================================
--- trunk/property/inc/class.soworkorder.inc.php        2013-02-19 20:05:05 UTC 
(rev 10928)
+++ trunk/property/inc/class.soworkorder.inc.php        2013-02-19 20:24:08 UTC 
(rev 10929)
@@ -2167,11 +2167,20 @@
                        }
                        else if($project_type_id == 1)//operation
                        {
+/*
                                if(abs($budget['obligation']) > 0)
                                {
-                                       $transferred = 
$this->_update_order_budget($id, $latest_year, $periodization_id, 
$budget['obligation'], $contract_sum, $combined_cost = 0, $action = 'subtract', 
$activate = 0);
+                                       $transferred = 
$this->_update_order_budget($id, $latest_year, $periodization_id, 
$budget['obligation'], $contract_sum, $combined_cost = 0, $action = 'update', 
$activate = 0);
                                }
+*/
+                               $this->db->query("SELECT sum(amount) as paid 
FROM fm_workorder"
+                               . " {$this->join} 
fm_orders_paid_or_pending_view ON fm_workorder.id = 
fm_orders_paid_or_pending_view.order_id"
+                               . " WHERE periode > {$latest_year}00 AND 
periode < {$latest_year}13 AND fm_workorder.id = {$id}",__LINE__,__FILE__);
+                               $this->db->next_record();
+                               $paid_last_year = $this->db->f('paid');
 
+                               $transferred = $this->_update_order_budget($id, 
$latest_year, $periodization_id, $paid_last_year, $paid_last_year, 
$paid_last_year, $action = 'update', $activate = 0);
+
                                $this->_update_order_budget($id, $year, 
$periodization_id, (int)$budget['budget_amount'], 
(int)$budget['budget_amount'], (int)$budget['budget_amount'], $action = 
'update', true);
 
                                $this->db->query("UPDATE fm_workorder_budget 
SET active = 0 WHERE order_id = {$id} AND year = 
{$latest_year}",__LINE__,__FILE__);




reply via email to

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