From: ivan Date: Fri, 24 Nov 2006 08:49:09 +0000 (+0000) Subject: add less than and greater than amounts to credit and payment searches X-Git-Tag: TRIXBOX_2_6~855 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=39fd666a49b2be516967131a46891f17ce0101da add less than and greater than amounts to credit and payment searches --- diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm index 080ac6e64..c9eaf5012 100644 --- a/FS/FS/UI/Web.pm +++ b/FS/FS/UI/Web.pm @@ -32,6 +32,38 @@ sub parse_beginning_ending { ( $beginning, $ending ); } +sub parse_lt_gt { + my($cgi, $field) = @_; + + my @search = (); + + my %op = ( + 'lt' => '<', + 'gt' => '>', + ); + + foreach my $op (keys %op) { + + warn "checking for ${field}_$op field\n" + if $DEBUG; + + if ( $cgi->param($field."_$op") =~ /^\s*\$?\s*([\d\,\s]+(\.\d\d)?)\s*$/ ) { + + my $num = $1; + $num =~ s/[\,\s]+//g; + my $search = "$field $op{$op} $num"; + push @search, $search; + + warn "found ${field}_$op field; adding search element $search\n" + if $DEBUG; + } + + } + + @search; + +} + ### # cust_main report subroutines ### diff --git a/httemplate/elements/tr-input-beginning_ending.html b/httemplate/elements/tr-input-beginning_ending.html index a8ab6ed10..397f7498a 100644 --- a/httemplate/elements/tr-input-beginning_ending.html +++ b/httemplate/elements/tr-input-beginning_ending.html @@ -5,7 +5,7 @@ - From: + From date: MAXLENGTH=<%$maxlength%>>
m/d/y<% $time_hint %>