fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [11713] property: invoice import


From: Sigurd Nes
Subject: [Fmsystem-commits] [11713] property: invoice import
Date: Mon, 17 Feb 2014 13:56:30 +0000

Revision: 11713
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=11713
Author:   sigurdne
Date:     2014-02-17 13:56:27 +0000 (Mon, 17 Feb 2014)
Log Message:
-----------
property: invoice import

Modified Paths:
--------------
    trunk/property/inc/import/default/Import_fra_Service_EBF

Modified: trunk/property/inc/import/default/Import_fra_Service_EBF
===================================================================
--- trunk/property/inc/import/default/Import_fra_Service_EBF    2014-02-17 
09:39:15 UTC (rev 11712)
+++ trunk/property/inc/import/default/Import_fra_Service_EBF    2014-02-17 
13:56:27 UTC (rev 11713)
@@ -258,7 +258,15 @@
                                else
                                {
                                        $buffer[$this->id]['dime'] = 
strlen($workorder['cat_id']) == 4 ? $workorder['cat_id'] : ''; // Dim 6
-                                       $buffer[$this->id]['spbudact_code'] = 
$workorder['b_account_id'];
+                                       if ( strlen($workorder['b_account_id']) 
== 6 && $this->check_spbudact_code($workorder['b_account_id']))
+                                       {
+                                               
$buffer[$this->id]['spbudact_code'] = $workorder['b_account_id'];
+                                       }
+                                       else
+                                       {
+                                               
$buffer[$this->id]['spbudact_code'] = '';
+                                       }
+                                       
                                }
                        }
                        else
@@ -347,6 +355,17 @@
                        return false;
                }
 
+               /**
+                * Check for valid budget account
+                * @param integer $id
+                * @return bool true on exist, false on not exist
+                */
+               function check_spbudact_code($id)
+               {
+                       $this->db->query("SELECT id FROM fm_b_account WHERE 
id='{$id}'");
+                       return !!$this->db->next_record();
+               }
+
                function check_dima($id)
                {
                        $loc1 = substr($id, 0, 4);




reply via email to

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