Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / FS / FS / part_event / Condition / cust_bill_age_before_payby.pm
index 273f508..5a81fbb 100644 (file)
@@ -20,7 +20,7 @@ sub condition {
   #my $cust_main = $cust_bill->cust_main;
 
   my $change_date = 0;
-  my $newest = 4294967295; #2^32-1
+  my $newest = 2147483647; #2038 problem, because the field does
 
   #this is pretty expensive, it would be way more efficient to check for
   # changed payby in SQL
@@ -34,12 +34,12 @@ sub condition {
             'order_by' => 'ORDER BY history_date DESC LIMIT 1',
         }))
   {
-    my $newest = $replace_new->history_date;
+    $newest = $replace_new->history_date;
     my $replace_old = qsearchs({
       'table' => 'h_cust_main',
       'hashref' => { 'custnum'        => $replace_new->custnum,
                      'history_action' => 'replace_old',
-                     'history_date'   => $replace_new->history_date,
+                     'history_date'   => $replace_new->history_date, #fuzz?
                    }
     }) or next; #no replace_old?  ignore and continue on i guess