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
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' => [
'',
'',
}
-my @loc_param = qw( city county state country );
+my @loc_param = qw( district city county state country );
if ( $cgi->param('out') ) {
my %ph = ( 'county' => dbh->quote($_),
map { $_ => dbh->quote( $cgi->param($_) ) }
- qw( city state country )
+ qw( district city state country )
);
my ( $loc_sql, @param ) = FS::cust_pkg->location_sql;
#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 )) {
my $join_pkg;
-my $join_cust_bill_pkg = 'LEFT JOIN cust_bill_pkg 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";
-}
+my $join_cust_bill_pkg = 'LEFT JOIN cust_bill_pkg USING ( billpkgnum )';
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') ) {