diff options
Diffstat (limited to 'LedgerSMB')
-rwxr-xr-x | LedgerSMB/Tax.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/LedgerSMB/Tax.pm b/LedgerSMB/Tax.pm index 6ff21459..1996f23c 100755 --- a/LedgerSMB/Tax.pm +++ b/LedgerSMB/Tax.pm @@ -38,15 +38,12 @@ sub init_taxes { my @tmpaccounts = @accounts; $#accounts = 0; for my $acct (split / /, $taxaccounts2){ - if ($taxaccounts =~ /$acct/){ + if ($taxaccounts =~ /\s$acct\s/){ push @accounts, $acct; } } } - if (! scalar @accounts){ - return @accounts; - } my $query = qq|SELECT t.taxnumber, c.description, t.rate, t.chart_id, t.pass, m.taxmodulename FROM tax t INNER JOIN chart c ON (t.chart_id = c.id) @@ -55,6 +52,9 @@ sub init_taxes { my $sth = $dbh->prepare($query); foreach $taxaccount (@accounts) { next if (! defined $taxaccount); + if (defined $taxaccounts2){ + next if $taxaccount !~ /$taxaccounts2/; + } $sth->execute($taxaccount) || $form->dberror($query); my $ref = $sth->fetchrow_hashref; |