fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [10795] property: bulk update budget


From: Sigurd Nes
Subject: [Fmsystem-commits] [10795] property: bulk update budget
Date: Mon, 11 Feb 2013 17:18:42 +0000

Revision: 10795
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10795
Author:   sigurdne
Date:     2013-02-11 17:18:41 +0000 (Mon, 11 Feb 2013)
Log Message:
-----------
property: bulk update budget

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

Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php  2013-02-11 14:30:13 UTC (rev 
10794)
+++ trunk/property/inc/class.soproject.inc.php  2013-02-11 17:18:41 UTC (rev 
10795)
@@ -2612,10 +2612,10 @@
                        if($project_type_id == 2) // investment
                        {
                                // total budget
-                               $this->db->query("SELECT sum(budget) FROM 
fm_project_budget WHERE project_id = {$id} AND year = 
{$latest_year}",__LINE__,__FILE__);
+                               $this->db->query("SELECT sum(budget) as budget 
FROM fm_project_budget WHERE project_id = {$id} AND year = {$latest_year} AND 
active = 1",__LINE__,__FILE__);
                                $this->db->next_record();
                                $last_budget = $this->db->f('budget');
-                               if(!$last_budget)
+                               if( !abs( $last_budget ) > 0 )
                                {
                                        throw new 
Exception('property_soproject::transfer_budget() - no budget to transfer for 
this investment project: ' . $id);
                                }




reply via email to

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