summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorivan <ivan>2009-05-27 22:13:59 +0000
committerivan <ivan>2009-05-27 22:13:59 +0000
commitaeae062630d148cad199305dd601ce33e37714f1 (patch)
tree26900b5862ff525aee9938c8d1a3a82ee94fc8cf /httemplate/search
parent332cff350f042ba6f4aa6ca42043d03eb18105fb (diff)
maybe this willf inally fix total line links on tax report when using report_group kludge? (still possibly not in all corner cases), RT#5446
Diffstat (limited to 'httemplate/search')
-rw-r--r--httemplate/search/cust_bill_pkg.cgi2
-rwxr-xr-xhttemplate/search/report_tax.cgi27
2 files changed, 27 insertions, 2 deletions
diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi
index f644dcfd4..b150989ce 100644
--- a/httemplate/search/cust_bill_pkg.cgi
+++ b/httemplate/search/cust_bill_pkg.cgi
@@ -168,7 +168,7 @@ if ( $cgi->param('out') ) {
my %ph = ( 'county' => $_,
map { $_ => dbh->quote( $cgi->param($_) ) }
- qw( county state country )
+ qw( state country )
);
my ( $loc_sql, @param ) = FS::cust_pkg->location_sql;
diff --git a/httemplate/search/report_tax.cgi b/httemplate/search/report_tax.cgi
index ed5ebef03..1a94163b4 100755
--- a/httemplate/search/report_tax.cgi
+++ b/httemplate/search/report_tax.cgi
@@ -285,6 +285,9 @@ foreach my $r ( qsearch({ 'table' => 'cust_main_county',
my $label = getlabel($r);
$regions{$label}->{'label'} = $label;
+
+ $regions{$label}->{$_} = $r->$_() for (qw( county state country )); #taxname?
+
$regions{$label}->{'url_param'} =
join(';', map "$_=".uri_escape($r->$_()),
qw( county state country taxname )
@@ -532,6 +535,9 @@ my @regions = keys %regions;
my( $total, $tot_taxable, $tot_owed ) = ( 0, 0, 0 );
my( $exempt_cust, $exempt_pkg, $exempt_monthly ) = ( 0, 0, 0 );
my %taxclasses = ();
+my %county = ();
+my %state = ();
+my %country = ();
foreach (@regions) {
$total += $regions{$_}->{'total'};
$tot_taxable += $regions{$_}->{'taxable'};
@@ -541,13 +547,32 @@ foreach (@regions) {
$exempt_monthly += $regions{$_}->{'exempt_monthly'};
$taxclasses{$regions{$_}->{'taxclass'}} = 1
if $regions{$_}->{'taxclass'};
+ $county{$regions{$_}->{'county'}} = 1;
+ $state{$regions{$_}->{'state'}} = 1;
+ $country{$regions{$_}->{'country'}} = 1;
}
my $total_url_param = '';
if ( $group_op ) {
+
+ my @country = keys %country;
+ warn "WARNING: multiple countries on this grouped report; total links broken"
+ if scalar(@country) > 1;
+ my $country = $country[0];
+
+ my @state = keys %state;
+ warn "WARNING: multiple countries on this grouped report; total links broken"
+ if scalar(@state) > 1;
+ my $state = $state[0];
+
$total_url_param =
'report_group='.uri_escape("$group_op $group_value").';'.
- join(';', map 'taxclass='.dbh->quote($_), keys %taxclasses );
+ join(';', map 'taxclass='.uri_escape($_), keys %taxclasses ).';'.
+ "country=$country;state=".uri_escape($state).';'.
+ join(';', map 'county='.uri_escape($_), keys %county )
+ ;
+
+
}
#ordering