X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_event.html;h=757982b95fccc29155f6d40be3680773411ad649;hp=a0429e44fd0a65d161e1b62ca8ce93249e8748a3;hb=29fb80073eb21f453515618f01d2c0d03a3004ec;hpb=cf49d3c860a2000cfc23a0e0db472a7d6fc58935 diff --git a/httemplate/search/cust_event.html b/httemplate/search/cust_event.html index a0429e44f..757982b95 100644 --- a/httemplate/search/cust_event.html +++ b/httemplate/search/cust_event.html @@ -1,4 +1,4 @@ -<% include( 'elements/search.html', +<& elements/search.html, 'title' => $title, 'html_init' => $html_init, 'menubar' => $menubar, @@ -62,15 +62,14 @@ #'', FS::UI::Web::cust_styles(), ], - ) -%> +&> <%once> my $status_sub = sub { my $cust_event = shift; my $status = $cust_event->status; - $status .= ': '.$cust_event->statustext + $status .= ': '. encode_entities($cust_event->statustext) if $cust_event->statustext; my $part_event = $cust_event->part_event; @@ -164,7 +163,7 @@ for my $param (@scalars) { } #lists -my @lists = qw( payby eventpart ); +my @lists = qw( eventpart ); foreach my $param (@lists) { $search{$param} = [ $cgi->param($param) ]; } @@ -175,7 +174,13 @@ $search{'ending'} = $ending; my $where = ' WHERE '. FS::cust_event->search_sql_where( \%search ); -my $join = FS::cust_event->join_sql(); +my $join = FS::cust_event->join_sql() . + 'LEFT JOIN cust_location bill_location '. + 'ON (cust_main.bill_locationnum = bill_location.locationnum) '. + 'LEFT JOIN cust_location ship_location '. + 'ON (cust_main.ship_locationnum = ship_location.locationnum)'; + # warning: does not show the true service address for package events. + # the query to do that would be painfully slow. my $sql_query = { 'table' => 'cust_event', @@ -188,8 +193,10 @@ my $sql_query = { FS::UI::Web::cust_sql_fields(), ), 'hashref' => {}, - 'extra_sql' => "$where ORDER BY _date ASC", + 'extra_sql' => $where, + 'order_by' => 'ORDER BY _date ASC', 'addl_from' => $join, + 'debug' => 2, }; my $count_sql = "SELECT COUNT(*) FROM cust_event $join $where";