summaryrefslogtreecommitdiff
path: root/FS/FS/cust_payby.pm
diff options
context:
space:
mode:
authorMitch Jackson <mitch@freeside.biz>2018-09-11 03:33:33 -0400
committerMitch Jackson <mitch@freeside.biz>2018-09-11 03:33:33 -0400
commitb89e874e8258288d15c98ed3799a9fede6515fd5 (patch)
tree45d3edf1845a5956ee3ded43f5c5e41b3e6250a9 /FS/FS/cust_payby.pm
parent829aa888318799d2ff4871c92b0d457abda49714 (diff)
RT# 78547 Upcoming Auto-Bill Transaction Report
Diffstat (limited to 'FS/FS/cust_payby.pm')
-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;