fix advanced package report, RT#40292, fallout from RT#20173
authorIvan Kohler <ivan@freeside.biz>
Thu, 11 Feb 2016 13:39:48 +0000 (05:39 -0800)
committerIvan Kohler <ivan@freeside.biz>
Thu, 11 Feb 2016 13:39:48 +0000 (05:39 -0800)
FS/FS/cust_pkg.pm
httemplate/search/cust_main.cgi
httemplate/search/cust_pkg.cgi

index daa3353..b137384 100644 (file)
@@ -56,9 +56,11 @@ $disable_agentcheck = 0;
 
 $upgrade = 0; #go away after setup+start dates cleaned up for old customers
 
+our $cache_enabled = 0;
+
 sub _simplecache {
   my( $self, $hashref ) = @_;
-  if ( $hashref->{'pkg'} ) {
+  if ( $cache_enabled && $hashref->{'pkg'} && $hashref->{'plan'} ) {
     $self->{'_pkgpart'} = FS::part_pkg->new($hashref);
   }
 }
index 7bcd5bf..38ec4f4 100755 (executable)
@@ -518,6 +518,7 @@ my $addl_from = qq{
            AND recur_option.optionname = 'recur_fee' )
 };
 
+local($FS::cust_pkg::cache_enabled) = 1; #for $cust_pkg->part_pkg
 my %all_pkgs = map { $_->custnum =>
                        [ $_->$pkgs_method({ select    => $select,
                                             addl_from => $addl_from,
index f1e686a..dbd346d 100755 (executable)
@@ -44,7 +44,7 @@
                         },
                     sub { my $c = shift;
                           sprintf( $money_char.'%.2f',
-                                   $c->part_pkg->base_recur($c)
+                                   $c->base_recur
                                  );
                         },
                     sub { FS::part_pkg::freq_pretty(shift); },