DataObjects/Custinfo.php
authorAlan Knowles <alan@roojs.com>
Wed, 25 Feb 2015 06:18:46 +0000 (14:18 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 25 Feb 2015 06:18:46 +0000 (14:18 +0800)
DataObjects/Custinfo.php

index 4ea8fd6..c74a417 100644 (file)
@@ -487,7 +487,7 @@ class Pman_Xtuple_DataObjects_Custinfo extends DB_DataObject
         
     }
     
-    function initDatabase()
+    function initDatabase($roo)
     {
         if ($this->count()) {
             return;
@@ -510,11 +510,12 @@ class Pman_Xtuple_DataObjects_Custinfo extends DB_DataObject
         $companies->find(true);
         
         
-        $this->setFrom($this->defaults());
+        
         $this->setFrom(array(
             'cust_name' => $companies->name,
             'cust_number' => empty($companies->code) ? strtoupper(preg_replace('/[^a-z0-9]+/i', '', $companies->name)) : $companies->code,
         ));
+        $this->beforeInsert(array(), $roo);
         $this->insert();