[freeside-commits] freeside/FS/FS/UI Web.pm,1.32,1.33
Jeff Finucane,420,,
jeff at wavetail.420.am
Wed Dec 19 13:05:39 PST 2007
Update of /home/cvs/cvsroot/freeside/FS/FS/UI
In directory wavetail:/tmp/cvs-serv26657/FS/FS/UI
Modified Files:
Web.pm
Log Message:
add options for balance over/under to advanced customer report
Index: Web.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/UI/Web.pm,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- Web.pm 28 Nov 2007 18:49:20 -0000 1.32
+++ Web.pm 19 Dec 2007 21:05:37 -0000 1.33
@@ -5,6 +5,7 @@
use Exporter;
use FS::Conf;
use FS::Record qw(dbdef);
+use FS::cust_main; # are sql_balance and sql_date_balance in the right module?
#use vars qw(@ISA);
#use FS::UI
@@ -163,7 +164,7 @@
warn "checking for ${field}_$op field\n"
if $DEBUG;
- if ( $cgi->param($field."_$op") =~ /^\s*\$?\s*([\d\,\s]+(\.\d\d)?)\s*$/ ) {
+ if ( $cgi->param($field."_$op") =~ /^\s*\$?\s*(-?[\d\,\s]+(\.\d\d)?)\s*$/ ) {
my $num = $1;
$num =~ s/[\,\s]+//g;
@@ -223,6 +224,7 @@
'Fax number' => 'fax',
'Invoicing email(s)' => 'invoicing_list_emailonly_scalar',
'Payment Type' => 'payby',
+ 'Current Balance' => 'current_balance',
);
my %header2colormethod = (
@@ -298,9 +300,14 @@
#inefficientish, but tiny lists and only run once per page
push @fields,
grep { my $field = $_; grep { $_ eq $field } @cust_fields }
- qw( address1 address2 city state zip daytime night );
+ qw( address1 address2 city state zip daytime night fax payby );
- map "cust_main.$_", @fields;
+ my @extra_fields = ();
+ if (grep { $_ eq 'current_balance' } @cust_fields) {
+ push @extra_fields, FS::cust_main->balance_sql . " AS current_balance";
+ }
+
+ map("cust_main.$_", @fields), @extra_fields;
}
=item cust_fields OBJECT [ CUST_FIELDS_VALUE ]
More information about the freeside-commits
mailing list