summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2006-11-24 08:49:09 +0000
committerivan <ivan>2006-11-24 08:49:09 +0000
commit39fd666a49b2be516967131a46891f17ce0101da (patch)
treee5e3ead6d6943990466724c3c6bc4b224fdb5a79 /FS
parent5f6615875ca497d46c4f8cd810310d4b2db24bfd (diff)
add less than and greater than amounts to credit and payment searches
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/UI/Web.pm32
1 files changed, 32 insertions, 0 deletions
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
###