X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_credit_bill_pkg.html;h=622d1cfb47d21c843e5e44e34875e4607f0e580a;hb=aab3b8983e23c77f3c8654f458eca0f53ade80f8;hp=c6995470dc5775b57a6c431d5c33c7af8b422f08;hpb=386e5631dd76e01faaad23a15d5977e13587b135;p=freeside.git diff --git a/httemplate/search/cust_credit_bill_pkg.html b/httemplate/search/cust_credit_bill_pkg.html index c6995470d..622d1cfb4 100644 --- a/httemplate/search/cust_credit_bill_pkg.html +++ b/httemplate/search/cust_credit_bill_pkg.html @@ -27,7 +27,7 @@ sub { sprintf($money_char.'%.2f', shift->amount ) }, sub { time2str('%b %d %Y', shift->get('cust_credit_date') ) }, - 'otaker', + sub { shift->cust_credit_bill->cust_credit->otaker }, sub { shift->cust_credit_bill->cust_credit->reason }, sub { $_[0]->pkgnum > 0 @@ -38,8 +38,16 @@ sub { time2str('%b %d %Y', shift->_date ) }, \&FS::UI::Web::cust_fields, ], - #'sort_fields' => [ #XXX add - #], + 'sort_fields' => [ + 'amount', + 'cust_credit_date', + '', #'otaker', + '', #reason + '', #line item description + 'invnum', + '_date', + #cust fields + ], 'links' => [ '', '', @@ -345,16 +353,7 @@ my $join_cust = my $join_pkg; -my $join_cust_bill_pkg = 'LEFT JOIN cust_bill_pkg USING ( billpkgnum'; -if ( $cgi->param('iscredit') eq 'rate' ) { - $join_cust_bill_pkg .= ', billpkgtaxratelocationnum )'; -} elsif ( $conf->exists('tax-pkg_address') ) { - $join_cust_bill_pkg .= ', billpkgtaxlocationnum )'; - push @where, "billpkgtaxratelocationnum IS NULL"; -} else { - $join_cust_bill_pkg .= ' )'; - push @where, "billpkgtaxratelocationnum IS NULL"; -} +my $join_cust_bill_pkg = 'LEFT JOIN cust_bill_pkg USING ( billpkgnum )'; if ( $cgi->param('nottax') ) { @@ -372,8 +371,18 @@ if ( $cgi->param('nottax') ) { $cgi->param('iscredit') eq 'rate') { $join_pkg .= - ' LEFT JOIN cust_bill_pkg_tax_rate_location USING ( billpkgnum ) '. - ' LEFT JOIN tax_rate_location USING ( taxratelocationnum ) '; + ' LEFT JOIN cust_bill_pkg_tax_rate_location USING ( billpkgnum '; + if ( $cgi->param('iscredit') eq 'rate' ) { + $join_pkg .= ', billpkgtaxratelocationnum )'; + } elsif ( $conf->exists('tax-pkg_address') ) { + $join_pkg .= ', billpkgtaxlocationnum )'; + push @where, "billpkgtaxratelocationnum IS NULL"; + } else { + $join_pkg .= ' )'; + push @where, "billpkgtaxratelocationnum IS NULL"; + } + + $join_pkg .= ' LEFT JOIN tax_rate_location USING ( taxratelocationnum ) '; } elsif ( $conf->exists('tax-pkg_address') ) {