DataObjects/Core_curr_rate.php
authorAlan Knowles <alan@roojs.com>
Mon, 5 Oct 2015 07:41:52 +0000 (15:41 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 5 Oct 2015 07:41:52 +0000 (15:41 +0800)
DataObjects/Core_curr_rate.php

index 8be8ee4..edc1a82 100644 (file)
@@ -95,16 +95,19 @@ class Pman_Core_DataObjects_Core_curr_rate extends DB_DataObject
                     continue;
                 }
                 $nl->from_dt = $ov->to_date;
                     continue;
                 }
                 $nl->from_dt = $ov->to_date;
-            }
             
             
             
             
-            if ($ov->rate == $rate) {
-                // modify the old one to expire
-                $oo = clone($ov);
-                $ov->to_date = $nv->to_from_dt;
-                $ov->update($oo);
-                continue;
+            
+                if ($ov->rate == $rate) {
+                    // modify the old one to expire
+                    $oo = clone($ov);
+                    $ov->to_date = $nv->to_from_dt;
+                    $ov->update($oo);
+                    continue;
+                }
             }
             }
+            // create a new row.
+