RT# 78547 Upcoming Auto-Bill Transaction Report
[freeside.git] / FS / FS / cust_payby.pm
index c497059..301eb61 100644 (file)
@@ -914,8 +914,33 @@ sub search_sql {
 
 =back
 
+=item count_autobill_cards
+
+Returns the number of unexpired cards configured for autobill
+
+=cut
+
+sub count_autobill_cards {
+  shift->count("
+    weight > 0
+    AND payby IN ('CARD','DCRD')
+    AND paydate > '".DateTime->now->ymd."'
+  ");
+}
+
+=item count_autobill_checks
+
+Returns the number of check accounts configured for autobill
+
 =cut
 
+sub count_autobill_checks {
+  shift->count("
+    weight > 0
+    AND payby IN ('CHEK','DCHEK')
+  ");
+}
+
 sub _upgrade_data {
 
   my $class = shift;