UpdateDatabase.php
authorAlan Knowles <alan@roojs.com>
Wed, 25 Feb 2015 06:21:22 +0000 (14:21 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 25 Feb 2015 06:21:22 +0000 (14:21 +0800)
UpdateDatabase.php

index b5be53a..c48ef73 100644 (file)
@@ -206,6 +206,8 @@ class Pman_Xtuple_UpdateDatabase extends Pman_Core_UpdateDatabase
                 'expcat',
                 
                 'custinfo', // create a base customer based on company.
+                'location', // default warehouse.
+                
                 // accounts - fixme - we need a better 'base set'
                 // 'costcat' -- fixme - we need to init this..
             
@@ -233,8 +235,7 @@ class Pman_Xtuple_UpdateDatabase extends Pman_Core_UpdateDatabase
         
         $this->updateMetricValue();
         
-        $this->addWarehouse();
-        $this->addExtraYears();
+         $this->addExtraYears();
         $this->addAccounts();
         $this->addBankAccounts();
         
@@ -301,29 +302,7 @@ class Pman_Xtuple_UpdateDatabase extends Pman_Core_UpdateDatabase
         
     }
     */
-    
-    function addWarehouse()
-    {
-        $l = DB_DataObject::Factory('location');
-        if ($l->count()) {
-            echo "location exists - SKIP\n";
-            return;
-        }
-        $cust = DB_DataObject::Factory('custinfo');
-        $cc =$cust->count() ;
-        if ($cc != 1) {
-            echo "location create - needs 1 custinfo - got $cc\n";
-            return;
-        }
-        $cust->find(true);
-        
-        $l->setFrom(array(
-            'location_name' => 'Warehouse',
-            'location_descrip' => 'Warehouse',
-            'location_cust_id' => $cust->pid()
-        ));
-    }
-    
+     
     
     
     function addExtraYears()