RT# 78547 Future autobill report - sql bugfix
authorMitch Jackson <mitch@freeside.biz>
Wed, 19 Sep 2018 06:31:52 +0000 (02:31 -0400)
committerMitch Jackson <mitch@freeside.biz>
Wed, 19 Sep 2018 16:06:06 +0000 (12:06 -0400)
FS/FS/cust_payby.pm
httemplate/search/future_autobill.html

index 9d8be12..4e9f04f 100644 (file)
@@ -931,7 +931,7 @@ sub has_autobill_cards {
         weight  => { op => '>',  value => 0 },
     },
     extra_sql =>
-      "AND payby IN ('CARD', 'DCRD') ".
+      "AND cust_payby.payby IN ('CARD', 'DCRD') ".
       'AND '.
       $FS::CurrentUser::CurrentUser->agentnums_sql( table => 'cust_main' ),
   });
@@ -952,7 +952,7 @@ sub has_autobill_checks {
         weight  => { op => '>',  value => 0 },
     },
     extra_sql =>
-      "AND payby IN ('CHEK','DCHEK','DCHK') ".
+      "AND cust_payby.payby IN ('CHEK','DCHEK','DCHK') ".
       'AND '.
       $FS::CurrentUser::CurrentUser->agentnums_sql( table => 'cust_main' ),
   });
index 1f3862f..3385dd8 100644 (file)
@@ -121,8 +121,8 @@ there will be 1,400 billing and payment cycles simulated
     order_by  => " ORDER BY weight DESC ",
     extra_sql =>
       "AND (
-        payby IN ('CHEK','DCHK','DCHEK')
-        OR ( paydate > '".$target_dt->ymd."')
+        cust_payby.payby IN ('CHEK','DCHK','DCHEK')
+        OR ( cust_payby.paydate > '".$target_dt->ymd."')
       )
       AND " . $FS::CurrentUser::CurrentUser->agentnums_sql
       . ($agentnum ? "AND cust_main.agentnum = $agentnum" : ''),