X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_bill_pkg.cgi;h=6a9f8775e3e7bbd26b34e39e12008ab01cf15dc0;hb=fed12e8214a8a951377961ccbe7a09171b1e38c2;hp=1e67e9320ff47385da24cc7b481afda5a41e2c17;hpb=fc8d730d0a7b31b617c963c5619bd3f45c5c3eb6;p=freeside.git diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi index 1e67e9320..6a9f8775e 100644 --- a/httemplate/search/cust_bill_pkg.cgi +++ b/httemplate/search/cust_bill_pkg.cgi @@ -222,9 +222,9 @@ if ( $conf->exists('enable_taxclasses') ) { # valid in both the tax and non-tax cases my $join_cust = - " LEFT JOIN cust_bill USING (invnum) - LEFT JOIN cust_main USING (custnum) - "; + " LEFT JOIN cust_bill USING (invnum)". + # use cust_pkg.locationnum if it exists + FS::UI::Web::join_cust_main('cust_bill', 'cust_pkg'); #agent virtualization my $agentnums_sql = @@ -647,7 +647,7 @@ $where &&= "WHERE $where"; my $query = { 'table' => 'cust_bill_pkg', - 'addl_from' => "$join_cust $join_pkg", + 'addl_from' => "$join_pkg $join_cust", 'hashref' => {}, 'select' => join(",\n", @select ), 'extra_sql' => $where, @@ -656,7 +656,7 @@ my $query = { my $count_query = 'SELECT ' . join(',', @total) . - " FROM cust_bill_pkg $join_cust $join_pkg + " FROM cust_bill_pkg $join_pkg $join_cust $where"; @peritem_desc = map {emt($_)} @peritem_desc;