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

index 669343f..863b264 100644 (file)
@@ -77,6 +77,21 @@ class Pman_Xtuple_DataObjects_Period extends DB_DataObject
     
     function initDatabase($roo)
     {
+       
+         function initDatabase($roo)
+    {
+        $p = DB_DataObject::Factory('period');
+        if ($p->count()) {
+            echo "SKIP - already have periods\n";
+            return;
+        }
+        $p->initPeriods($this);
+        $p->initPeriods($this);
+        $p->initPeriods($this);
+        $p->initPeriods($this);
+        
+    }
+       
         $this->initPeriods($roo);
     }
     
@@ -117,7 +132,7 @@ class Pman_Xtuple_DataObjects_Period extends DB_DataObject
         
         //DB_DataObject::debugLevel(1);
         
-        for ($i = $start; $i < 2020;$i++ ) {
+        for ($i = $start; $i < date('Y')+10 ;$i++ ) {