fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11891] property: transfer budget from buffer-project


From: Sigurd Nes
Subject: [Fmsystem-commits] [11891] property: transfer budget from buffer-project to buffer-project
Date: Mon, 07 Apr 2014 13:28:15 +0000

Revision: 11891
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11891
Author:   sigurdne
Date:     2014-04-07 13:28:11 +0000 (Mon, 07 Apr 2014)
Log Message:
-----------
property: transfer budget from buffer-project to buffer-project

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

Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php  2014-04-07 11:45:41 UTC (rev 
11890)
+++ trunk/property/inc/class.soproject.inc.php  2014-04-07 13:28:11 UTC (rev 
11891)
@@ -1805,6 +1805,36 @@
                        $this->db->query("INSERT INTO fm_project_buffer_budget 
({$cols}) VALUES ({$values})", __LINE__, __FILE__);
 
                        /**
+                        * In case the transfer is betwee two buffer-projects
+                        */
+                       $this->db->query("SELECT project_type_id FROM 
fm_project WHERE id = {$project_id}", __LINE__, __FILE__);
+                       $this->db->next_record();
+                       $project_type_id = $this->db->f('project_type_id');
+                       if($project_type_id == 3)//buffer
+                       {
+                               $value_set = array
+                               (
+                                       'buffer_project_id'      => $to_project,
+                                       'year'                           => 
$year,
+                                       'amount_in'                      => 
$amount_out,
+                                       'amount_out'             => $amount_in,
+                                       'from_project'           => $project_id,
+                                       'to_project'             => '',
+                                       'user_id'                        => 
$this->account,
+                                       'entry_date'             => time(),
+                                       'active'                         => 1,
+                                       'remark'                         => 
$this->db->db_addslashes($transfer_remark)
+                               );
+
+                               $cols    = implode(',', array_keys($value_set));
+                               $values  = 
$this->db->validate_insert(array_values($value_set));
+                               $this->db->query("INSERT INTO 
fm_project_buffer_budget ({$cols}) VALUES ({$values})", __LINE__, __FILE__);
+
+                               return;
+                       }
+
+                       
+                       /**
                         * Transfer fund to another project
                         * */
                        if($amount_out)




reply via email to

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