summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-04-07 11:17:15 -0700
committerIvan Kohler <ivan@freeside.biz>2015-04-07 11:17:15 -0700
commit0cf9aa4a84ac9cf6aa763db4536756c03630ab69 (patch)
tree880dfe5eb4ec00986c20593f82d5587fda1dc523
parente34541531eb37fe02b33c614cd9c48b7638347f2 (diff)
check number searches ignore leading 0s
-rw-r--r--FS/FS/Mason.pm2
-rwxr-xr-xhttemplate/search/elements/cust_pay_or_refund.html4
2 files changed, 4 insertions, 2 deletions
diff --git a/FS/FS/Mason.pm b/FS/FS/Mason.pm
index 8f7f739..d9b9188 100644
--- a/FS/FS/Mason.pm
+++ b/FS/FS/Mason.pm
@@ -131,7 +131,7 @@ if ( -e $addl_handler_use_file ) {
use FS::UID qw( dbh datasrc driver_name );
use FS::Record qw( qsearch qsearchs fields dbdef
str2time_sql str2time_sql_closing
- midnight_sql
+ midnight_sql regexp_sql
);
use FS::Conf;
use FS::CGI qw(header menubar table itable ntable idiot
diff --git a/httemplate/search/elements/cust_pay_or_refund.html b/httemplate/search/elements/cust_pay_or_refund.html
index 7bebe7f..699266d 100755
--- a/httemplate/search/elements/cust_pay_or_refund.html
+++ b/httemplate/search/elements/cust_pay_or_refund.html
@@ -402,7 +402,8 @@ if ( $cgi->param('magic') ) {
if ( $cgi->param('payinfo') ) {
$cgi->param('payinfo') =~ /^\s*(\d+)\s*$/
or die "illegal payinfo ". $cgi->param('payinfo');
- push @search, "$table.payinfo = '$1'";
+ my $regexp = regexp_sql();
+ push @search, "$table.payinfo $regexp '^0*$1\$'";
}
if ( $cgi->param('ccpay') =~ /^([\w-:]+)$/ ) {
@@ -538,6 +539,7 @@ if ( $cgi->param('magic') ) {
} else {
#hmm... is this still used?
+ warn "undefined search magic";
$cgi->param('payinfo') =~ /^\s*(\d+)\s*$/ or die "illegal payinfo";
my $payinfo = $1;