X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_bill_pkg.cgi;h=fd8b04da96afbc66d5e01ddca57c5324df447bed;hb=ce1fa204e25ae8605bdb4f3dbfdf9bd1bff1a590;hp=975a307137cf0ca69534a6bc5b3f415fdef6183c;hpb=301007875822fa4a694e34eda561bc5525b836b3;p=freeside.git diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi index 975a30713..fd8b04da9 100644 --- a/httemplate/search/cust_bill_pkg.cgi +++ b/httemplate/search/cust_bill_pkg.cgi @@ -157,6 +157,8 @@ if ( $cgi->param('taxclass') } +my @loc_param = qw( city county state country ); + if ( $cgi->param('out') ) { my ( $loc_sql, @param ) = FS::cust_pkg->location_sql( 'ornull' => 1 ); @@ -176,10 +178,9 @@ if ( $cgi->param('out') ) { "; #not linked to by anything, but useful for debugging "out of taxable region" - if ( grep $cgi->param($_), qw( county state country ) ) { + if ( grep $cgi->param($_), @loc_param ) { - my %ph = map { $_ => dbh->quote( $cgi->param($_) ) } - qw( county state country ); + my %ph = map { $_ => dbh->quote( scalar($cgi->param($_)) ) } @loc_param; my ( $loc_sql, @param ) = FS::cust_pkg->location_sql; while ( $loc_sql =~ /\?/ ) { #easier to do our own substitution @@ -204,7 +205,7 @@ if ( $cgi->param('out') ) { my %ph = ( 'county' => dbh->quote($_), map { $_ => dbh->quote( $cgi->param($_) ) } - qw( state country ) + qw( city state country ) ); my ( $loc_sql, @param ) = FS::cust_pkg->location_sql; @@ -222,8 +223,7 @@ if ( $cgi->param('out') ) { } else { - my %ph = map { $_ => dbh->quote( $cgi->param($_) ) } - qw( county state country ); + my %ph = map { $_ => dbh->quote( scalar($cgi->param($_)) ) } @loc_param; my ( $loc_sql, @param ) = FS::cust_pkg->location_sql; while ( $loc_sql =~ /\?/ ) { #easier to do our own substitution @@ -274,7 +274,7 @@ if ( $cgi->param('out') ) { ); my %ph = map { ( $pn{$_} => dbh->quote( $cgi->param($_) || '' ) ) } - qw( county state city locationtaxid ); + qw( city county state locationtaxid ); push @where, join( ' AND ', map { "( $_ = $ph{$_} OR $ph{$_} = '' AND $_ IS NULL)" }