From: ivan Date: Fri, 12 Mar 2004 08:56:50 +0000 (+0000) Subject: don't run my local expenses kludge by default; horrible performance X-Git-Tag: NET_WHOIS_RAW_0_31~86 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=5b27fba78299a534d6d75a7322f26cf6af402b19 don't run my local expenses kludge by default; horrible performance --- diff --git a/FS/FS/Report/Table/Monthly.pm b/FS/FS/Report/Table/Monthly.pm index 9aebeee3d..3bbf01f39 100644 --- a/FS/FS/Report/Table/Monthly.pm +++ b/FS/FS/Report/Table/Monthly.pm @@ -1,13 +1,15 @@ package FS::Report::Table::Monthly; use strict; -use vars qw( @ISA ); +use vars qw( @ISA $expenses_kludge ); use Time::Local; use FS::UID qw( dbh ); use FS::Report::Table; @ISA = qw( FS::Report::Table ); +$expenses_kludge = 0; + =head1 NAME FS::Report::Table::Monthly - Tables of report data, indexed monthly @@ -83,7 +85,7 @@ sub netsales { #net sales ); #horrible local kludge - my $expenses = $self->scalar_sql(" + my $expenses = !$expenses_kludge ? 0 : $self->scalar_sql(" SELECT SUM(cust_bill_pkg.setup) FROM cust_bill_pkg, cust_bill, cust_pkg, part_pkg WHERE cust_bill.invnum = cust_bill_pkg.invnum @@ -113,7 +115,7 @@ sub receipts { #cashflow ); #horrible local kludge that doesn't even really work right - my $expenses = $self->scalar_sql(" + my $expenses = !$expenses_kludge ? 0 : $self->scalar_sql(" SELECT SUM(cust_bill_pay.amount) FROM cust_bill_pay, cust_bill WHERE cust_bill_pay.invnum = cust_bill.invnum