summaryrefslogtreecommitdiff
path: root/FS/FS/Cron
diff options
context:
space:
mode:
authorivan <ivan>2009-11-19 06:21:31 +0000
committerivan <ivan>2009-11-19 06:21:31 +0000
commit6ca784d5a43ebf49bf684d6e4bc4d44d71eaf2b1 (patch)
tree6562f7d6126747e7139aceccad72cb2ebccfdbba /FS/FS/Cron
parent2ac70827dceb19a3844503c3c3a5e84c456eefbe (diff)
consider credits and refunds in breakage, RT#6407
Diffstat (limited to 'FS/FS/Cron')
-rw-r--r--FS/FS/Cron/breakage.pm26
1 files changed, 13 insertions, 13 deletions
diff --git a/FS/FS/Cron/breakage.pm b/FS/FS/Cron/breakage.pm
index 69758f9..6dd904d 100644
--- a/FS/FS/Cron/breakage.pm
+++ b/FS/FS/Cron/breakage.pm
@@ -30,19 +30,19 @@ sub reconcile_breakage {
if $opt{'v'};
#find customers w/negative balance older than $days (and no activity since)
- # no invoices / payments (/credits/refunds?) newer than $since
- # (except antother breakage invoice???)
-
- my $extra_sql = ' AND 0 > '. FS::cust_main->balance_sql;
- $extra_sql .= " AND ". join(' AND ',
- map {"
- NOT EXISTS ( SELECT 1 FROM $_
- WHERE $_.custnum = cust_main.custnum
- AND _date >= $since
- )
- ";}
- qw( cust_bill cust_pay ) # cust_credit cust_refund );
- );
+ # and no activity (invoices/payments/credits/refunds) newer than $since
+ # (XXX except antother breakage invoice???)
+
+ my $extra_sql =
+ ' AND 0 > '. FS::cust_main->balance_sql.
+ ' AND '. join(' AND ', map {
+ " NOT EXISTS (
+ SELECT 1 FROM $_
+ WHERE $_.custnum = cust_main.custnum
+ AND _date >= $since
+ ) "
+ } qw( cust_bill cust_pay cust_credit cust_refund )
+ );
my @customers = qsearch({
'table' => 'cust_main',