fmsystem-commits
[Top][All Lists]
Advanced

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

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


From: Sigurd Nes
Subject: [Fmsystem-commits] [10992] Property: budget handling
Date: Sat, 16 Mar 2013 14:24:10 +0000

Revision: 10992
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10992
Author:   sigurdne
Date:     2013-03-16 14:24:10 +0000 (Sat, 16 Mar 2013)
Log Message:
-----------
Property: budget handling

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

Modified: trunk/property/inc/class.boproject.inc.php
===================================================================
--- trunk/property/inc/class.boproject.inc.php  2013-03-15 14:54:38 UTC (rev 
10991)
+++ trunk/property/inc/class.boproject.inc.php  2013-03-16 14:24:10 UTC (rev 
10992)
@@ -833,7 +833,6 @@
 
                function save($project,$action='',$values_attribute = array())
                {
-
                        //_debug_array($project);
                        while (is_array($project['location']) && list(,$value) 
= each($project['location']))
                        {
@@ -855,7 +854,18 @@
 
                        if ($action=='edit')
                        {
-                               $receipt = $this->so->edit($project, 
$values_attribute);
+                               try
+                               {
+                                       $receipt = $this->so->edit($project, 
$values_attribute);
+                               }
+                               catch(Exception $e)
+                               {
+                                       if ( $e )
+                                       {
+                                               
phpgwapi_cache::message_set($e->getMessage(), 'error');
+                                               $receipt['id'] = $project['id'];
+                                       }
+                               }
                        }
                        else
                        {

Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php  2013-03-15 14:54:38 UTC (rev 
10991)
+++ trunk/property/inc/class.soproject.inc.php  2013-03-16 14:24:10 UTC (rev 
10992)
@@ -1451,18 +1451,16 @@
                        }
                        else // investment or operation
                        {
-
-
                                if(isset($project['transfer_amount']) && 
$project['transfer_amount'] && isset($project['transfer_target']) && 
$project['transfer_target'])
                                {
                                        $this->db->query("SELECT 
project_type_id FROM fm_project WHERE id = " . 
(int)$project['transfer_target'],__LINE__,__FILE__);
                                        $this->db->next_record();
-                                       if(!$this->db->f('project_type_id') ==3)
+                                       if($this->db->f('project_type_id') !=3)
                                        {
                                                throw new 
Exception('property_soproject::edit() - target project is not a 
buffer-project');
                                        }
 
-                                       
$this->_update_buffer_budget($project['transfer_target'], date('Y'), 
$project['transfer_amount'], $project['id'],null,$project['transfer_remark']);
+                                       
$this->_update_buffer_budget_($project['transfer_target'], date('Y'), 
$project['transfer_amount'], $project['id'],null,$project['transfer_remark']);
 
                                        $this->db->query("SELECT sum(amount_in) 
AS amount_in, sum(amount_out) AS amount_out FROM fm_project_buffer_budget WHERE 
buffer_project_id = " . (int)$project['transfer_target'],__LINE__,__FILE__);
                                        $this->db->next_record();




reply via email to

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