[freeside-commits] branch FREESIDE_4_BRANCH updated. c6670629cf1284990114c6def591f228f7b27c9d

Christopher Burger burgerc at freeside.biz
Tue Nov 13 08:49:52 PST 2018


The branch, FREESIDE_4_BRANCH has been updated
       via  c6670629cf1284990114c6def591f228f7b27c9d (commit)
       via  f6ea5bbb257a4907665e80ad2ce0daf79290bb9f (commit)
      from  b7f3e1493aeb4061c65a5ba52dd8318f4662eb2e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c6670629cf1284990114c6def591f228f7b27c9d
Merge: f6ea5bbb2 b7f3e1493
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Tue Nov 13 09:19:48 2018 -0500

    Merge branch 'FREESIDE_4_BRANCH' of ssh://git.freeside.biz/home/git/freeside into FREESIDE_4_BRANCH


commit f6ea5bbb257a4907665e80ad2ce0daf79290bb9f
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Mon Nov 12 10:09:26 2018 -0500

    RT# 81594 - fix package churn report to properly get future revenue value of changed packages

diff --git a/FS/FS/Report/Table.pm b/FS/FS/Report/Table.pm
index 7c4f97309..d7b100df6 100644
--- a/FS/FS/Report/Table.pm
+++ b/FS/FS/Report/Table.pm
@@ -973,12 +973,15 @@ sub revenue_pkg {
 
   my $sql;
 
+## if package has changed and has not reached next due date it will not be in h_cust_bill.
+## this causes problems with future months, needed to use change_pkgnum instead.
+
   if ($status eq "active") {
     $sql = "SELECT DISTINCT ON (revenue.pkgnum) revenue.pkgnum AS pkgnum, revenue.recur AS revenue
       FROM $from
       JOIN part_pkg ON (cust_pkg.pkgpart = part_pkg.pkgpart)
       JOIN cust_main ON (cust_pkg.custnum = cust_main.custnum)
-      JOIN h_cust_bill_pkg AS revenue ON (cust_pkg.pkgnum = revenue.pkgnum AND cust_pkg.history_date < $speriod )
+      JOIN h_cust_bill_pkg AS revenue ON ((cust_pkg.pkgnum = revenue.pkgnum OR cust_pkg.change_pkgnum = revenue.pkgnum) AND cust_pkg.history_date < $speriod )
     ";
   }
   elsif ($status eq "setup") {

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/Report/Table.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list