X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FUI%2FWeb.pm;h=6a97f96dd8178a8b60d7002dcac7ee5be83da8f3;hb=5e05724a635a22776f1b973f5d7e77989da4e048;hp=7699a7d54ddb930e6468a89617011fec657ccc09;hpb=c44d4eaf34f4fc6c5fd82a6cacb0ac12ef26a82b;p=freeside.git diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm index 7699a7d54..6a97f96dd 100644 --- a/FS/FS/UI/Web.pm +++ b/FS/FS/UI/Web.pm @@ -5,6 +5,7 @@ use vars qw($DEBUG @ISA @EXPORT_OK $me); 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 @@ sub parse_lt_gt { 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; @@ -220,7 +221,10 @@ sub cust_header { 'Country' => 'country_full', 'Day phone' => 'daytime', # XXX should use msgcat, but how? 'Night phone' => 'night', # XXX should use msgcat, but how? + 'Fax number' => 'fax', 'Invoicing email(s)' => 'invoicing_list_emailonly_scalar', + 'Payment Type' => 'payby', + 'Current Balance' => 'current_balance', ); my %header2colormethod = ( @@ -296,9 +300,14 @@ sub cust_sql_fields { #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 ] @@ -410,7 +419,7 @@ use Carp; use Storable qw(nfreeze); use MIME::Base64; use JSON; -use FS::UID; +use FS::UID qw(getotaker); use FS::Record qw(qsearchs); use FS::queue; @@ -483,6 +492,7 @@ sub start_job { push @{$param{$field}}, $value; } } + $param{CurrentUser} = getotaker(); warn "FS::UI::Web::start_job\n". join('', map { if ( ref($param{$_}) ) {