X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Frp.pl;h=b7adc2176d5dc058d5e684e2c10a6d08c94b00d9;hb=24b6b41bbc19de53e40315124350df14314c6fd6;hp=f618c5b69226570dab2c760f5fdc6bcc74271205;hpb=eb97535311910e0172988ee93cfedf05fb5a3b26;p=kivitendo-erp.git diff --git a/bin/mozilla/rp.pl b/bin/mozilla/rp.pl index f618c5b69..b7adc2176 100644 --- a/bin/mozilla/rp.pl +++ b/bin/mozilla/rp.pl @@ -107,10 +107,6 @@ my $rp_access_map = { 'balance_sheet' => 'report', }; -# subs use these pretty freely, so declare them here -our (%column_data, @column_index); -our ($subtotalnetamount, $subtotaltax, $subtotal); - sub check_rp_access { my $form = $main::form; @@ -1660,8 +1656,8 @@ sub aging { 'invnumber' => { 'text' => $locale->text('Invoice'), }, 'transdate' => { 'text' => $locale->text('Date'), }, 'duedate' => { 'text' => $locale->text('Due'), }, - 'amount' => { 'text' => $locale->text('Amount'), }, - 'open' => { 'text' => $locale->text('Open'), }, + 'amount' => { 'text' => $locale->text('Amount'), }, + 'open' => { 'text' => $locale->text('Open'), }, ); my %column_alignment = ('statement' => 'center', @@ -2115,19 +2111,19 @@ sub generate_tax_report { my $descvar = "$form->{accno}_description"; my $description = $form->escape($form->{$descvar}); my $ratevar = "$form->{accno}_rate"; - our $taxrate; # most likely error + my ($subtotalnetamount, $subtotaltax, $subtotal) = (0, 0, 0); my $department = $form->escape($form->{department}); # construct href my $href = - "$form->{script}?&action=generate_tax_report&fromdate=$form->{fromdate}&todate=$form->{todate}&db=$form->{db}&method=$form->{method}&accno=$form->{accno}&$descvar=$description&department=$department&$ratevar=$taxrate&report=$form->{report}"; + "$form->{script}?&action=generate_tax_report&fromdate=$form->{fromdate}&todate=$form->{todate}&db=$form->{db}&method=$form->{method}&accno=$form->{accno}&$descvar=$description&department=$department&report=$form->{report}"; # construct callback $description = $form->escape($form->{$descvar}, 1); $department = $form->escape($form->{department}, 1); my $callback = - "$form->{script}?&action=generate_tax_report&fromdate=$form->{fromdate}&todate=$form->{todate}&db=$form->{db}&method=$form->{method}&accno=$form->{accno}&$descvar=$description&department=$department&$ratevar=$taxrate&report=$form->{report}"; + "$form->{script}?&action=generate_tax_report&fromdate=$form->{fromdate}&todate=$form->{todate}&db=$form->{db}&method=$form->{method}&accno=$form->{accno}&$descvar=$description&department=$department&report=$form->{report}"; my $title = $form->escape($form->{title}); $href .= "&title=$title"; @@ -2138,6 +2134,7 @@ sub generate_tax_report { my @columns = $form->sort_columns(qw(id transdate invnumber name netamount tax amount)); + my @column_index; foreach my $item (@columns) { if ($form->{"l_$item"} eq "Y") { @@ -2242,7 +2239,7 @@ sub generate_tax_report { if ($form->{l_subtotal} eq 'Y') { if ($sameitem ne $ref->{ $form->{sort} }) { - &tax_subtotal; + tax_subtotal(\@column_index, \$subtotalnetamount, \$subtotaltax, \$subtotal); $sameitem = $ref->{ $form->{sort} }; } } @@ -2258,6 +2255,7 @@ sub generate_tax_report { $ref->{$_} = $form->format_amount(\%myconfig, $ref->{$_}, 2, " "); } qw(netamount tax amount); + my %column_data; $column_data{id} = qq|