fix payment amount search, RT#34471
authorIvan Kohler <ivan@freeside.biz>
Mon, 13 Apr 2015 17:21:38 +0000 (10:21 -0700)
committerIvan Kohler <ivan@freeside.biz>
Mon, 13 Apr 2015 17:21:38 +0000 (10:21 -0700)
FS/FS/UI/Web.pm
httemplate/search/elements/cust_pay_or_refund.html

index 483bded..df46e09 100644 (file)
@@ -170,7 +170,8 @@ sub svc_export_links {
 }
 
 sub parse_lt_gt {
-  my($cgi, $field) = @_;
+  my($cgi, $field) = (shift, shift);
+  my $table = ( @_ && length($_[0]) ) ? shift.'.' : '';
 
   my @search = ();
 
@@ -188,7 +189,7 @@ sub parse_lt_gt {
 
       my $num = $1;
       $num =~ s/[\,\s]+//g;
-      my $search = "$field $op{$op} $num";
+      my $search = "$table$field $op{$op} $num";
       push @search, $search;
 
       warn "found ${field}_$op field; adding search element $search\n"
index 699266d..0e3fce3 100755 (executable)
@@ -437,7 +437,7 @@ if ( $cgi->param('magic') ) {
                     "$table.void_date <= $v_ending";
     }
 
-    push @search, FS::UI::Web::parse_lt_gt($cgi, "$table.$amount_field" );
+    push @search, FS::UI::Web::parse_lt_gt($cgi, $amount_field, $table);
 
     $orderby = '_date';