#my $cust_main = $self->cust_main($cust_pkg);
- $cust_pkg->dundate <= $opt{time};
+ ( $cust_pkg->dundate || 0 ) <= $opt{time};
}
-#sub condition_sql {
-# my( $self, $table ) = @_;
-#
-# 'true';
-#}
+sub condition_sql {
+ my( $class, $table, %opt ) = @_;
+ return 'true' unless $table eq 'cust_pkg';
+ "COALESCE($table.dundate,0) <= ". $opt{'time'};
+}
1;