X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=2c01e1824d2ca36de76c4ef21c7bf45642a85586;hb=fd11a150a5cf7b060dfb647fcab9a1565ebed541;hp=08c7a51130acaa04b0b38d7f319ec557a64ab5de;hpb=0ea039f9084014e27a1b99ff033bf04bdab94966;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 08c7a5113..2c01e1824 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -2528,7 +2528,7 @@ plans support this feature (they tend to charge 0). =item invoice_terms -Options terms to be printed on this invocice. Otherwise, customer-specific +Options terms to be printed on this invoice. Otherwise, customer-specific terms or the default terms are used. =back @@ -4774,6 +4774,9 @@ sub realtime_refund_bop { ) { warn " attempting void\n" if $DEBUG > 1; my $void = new Business::OnlinePayment( $processor, @bop_options ); + $content{'card_number'} = $cust_pay->payinfo + if $cust_pay->payby eq 'CARD' + && $void->can('info') && $void->info('CC_void_requires_card'); $void->content( 'action' => 'void', %content ); $void->submit(); if ( $void->is_success ) { @@ -6112,6 +6115,9 @@ sub _new_realtime_refund_bop { ) { warn " attempting void\n" if $DEBUG > 1; my $void = new Business::OnlinePayment( $processor, @bop_options ); + $content{'card_number'} = $cust_pay->payinfo + if $cust_pay->payby eq 'CARD' + && $void->can('info') && $void->info('CC_void_requires_card'); $void->content( 'action' => 'void', %content ); $void->submit(); if ( $void->is_success ) { @@ -8428,8 +8434,10 @@ sub search_sql { #my $balance_sql = $class->balance_sql(); my $balance_sql = FS::cust_main->balance_sql(); + my @current_balance = @{ $params->{'current_balance'} }; + push @where, map { s/current_balance/$balance_sql/; $_ } - @{ $params->{'current_balance'} }; + @current_balance; ## # custbatch @@ -8808,17 +8816,21 @@ sub smart_search { # "Company (Last, First)" #this is probably something a browser remembered, - #so just do an exact (but case-insensitive) search + #so just do an exact search (but case-insensitive, so USPS standardization + #doesn't throw a wrench in the works) foreach my $prefix ( '', 'ship_' ) { push @cust_main, qsearch( { 'table' => 'cust_main', - 'hashref' => { $prefix.'first' => $first, - $prefix.'last' => $last, - $prefix.'company' => $company, - %options, - }, - 'extra_sql' => " AND $agentnums_sql", + 'hashref' => { %options }, + 'extra_sql' => + ( keys(%options) ? ' AND ' : ' WHERE ' ). + join(' AND ', + " LOWER(${prefix}first) = ". dbh->quote(lc($first)), + " LOWER(${prefix}last) = ". dbh->quote(lc($last)), + " LOWER(${prefix}company) = ". dbh->quote(lc($company)), + $agentnums_sql, + ), } ); }