summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_payby.pm25
1 files changed, 25 insertions, 0 deletions
diff --git a/FS/FS/cust_payby.pm b/FS/FS/cust_payby.pm
index c497059fa..301eb6106 100644
--- a/FS/FS/cust_payby.pm
+++ b/FS/FS/cust_payby.pm
@@ -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;