summaryrefslogtreecommitdiff
path: root/LedgerSMB/Tax.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-26 20:28:38 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-26 20:28:38 +0000
commit6c5c1c36fa682244c355f6c06808ec715f0a2baa (patch)
tree632efc981a5735f7b8d424a680469b71597dd495 /LedgerSMB/Tax.pm
parent6a118bd31a09a9b8aaabd84f8876952e1cdd6459 (diff)
Merging bugfixes from current branches/1.2
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1105 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/Tax.pm')
-rw-r--r--LedgerSMB/Tax.pm16
1 files changed, 15 insertions, 1 deletions
diff --git a/LedgerSMB/Tax.pm b/LedgerSMB/Tax.pm
index edf3bccc..01bff4d4 100644
--- a/LedgerSMB/Tax.pm
+++ b/LedgerSMB/Tax.pm
@@ -30,10 +30,20 @@ package Tax;
use Math::BigFloat;
sub init_taxes {
- my ( $form, $taxaccounts ) = @_;
+ my ( $form, $taxaccounts, $taxaccounts2 ) = @_;
my $dbh = $form->{dbh};
@taxes = ();
my @accounts = split / /, $taxaccounts;
+ if ( defined $taxaccounts2 ) {
+ my @tmpaccounts = @accounts;
+ $#accounts = -1;
+ for my $acct ( split / /, $taxaccounts2 ) {
+ if ( $taxaccounts =~ /\b$acct\b/ ) {
+ push @accounts, $acct;
+ }
+ }
+
+ }
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)
@@ -41,6 +51,10 @@ sub init_taxes {
WHERE c.accno = ?|;
my $sth = $dbh->prepare($query);
foreach $taxaccount (@accounts) {
+ next if ( !defined $taxaccount );
+ if ( defined $taxaccounts2 ) {
+ next if $taxaccounts2 !~ /\b$taxaccount\b/;
+ }
$sth->execute($taxaccount) || $form->dberror($query);
my $ref = $sth->fetchrow_hashref;