X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_credit_bill_pkg.html;h=fef295e621898dcc72e9792d285ec6025cd3c0ea;hb=64948ee373a03fa156ebc89cb39adfa6d4d2c3d5;hp=a73e61c390cc87d5ac66181e899c67c2be22a9ea;hpb=3983d5ee6135e5d3f57a111e890bebd22e11da97;p=freeside.git diff --git a/httemplate/search/cust_credit_bill_pkg.html b/httemplate/search/cust_credit_bill_pkg.html index a73e61c39..fef295e62 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' => [ '', '', @@ -256,7 +264,10 @@ if ( $cgi->param('out') ) { #warn "neither nottax nor istax parameters specified"; } - if ( $cgi->param('taxclassNULL') ) { + if ( $cgi->param('taxclassNULL') + && ! $cgi->param('istax') #no taxclass in this case + ) + { my %hash = ( 'country' => scalar($cgi->param('country')) ); foreach (qw( state county )) { @@ -363,20 +374,7 @@ 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 ) '; - - } elsif ( $conf->exists('tax-pkg_address') ) { - - $join_pkg .= ' LEFT JOIN cust_bill_pkg_tax_location USING ( billpkgnum ) - LEFT JOIN cust_location USING ( locationnum ) '; - - #quelle kludge, somewhat false laziness w/report_tax.cgi - s/cust_pkg\.locationnum/cust_bill_pkg_tax_location.locationnum/g for @where; - } - - #if ( $cgi->param('iscredit') ) { - $join_pkg .= ' JOIN cust_credit_bill_pkg USING ( billpkgnum'; + ' 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') ) { @@ -386,7 +384,17 @@ if ( $cgi->param('nottax') ) { $join_pkg .= ' )'; push @where, "billpkgtaxratelocationnum IS NULL"; } - #} + + $join_pkg .= ' LEFT JOIN tax_rate_location USING ( taxratelocationnum ) '; + + } elsif ( $conf->exists('tax-pkg_address') ) { + + $join_pkg .= ' LEFT JOIN cust_bill_pkg_tax_location USING ( billpkgnum ) + LEFT JOIN cust_location USING ( locationnum ) '; + + #quelle kludge, somewhat false laziness w/report_tax.cgi + s/cust_pkg\.locationnum/cust_bill_pkg_tax_location.locationnum/g for @where; + } } else {