summaryrefslogtreecommitdiff
path: root/LedgerSMB/Tax.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-09 19:43:31 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-09 19:43:31 +0000
commitd3f27376d7ec8e8c157021189787dd1dff302479 (patch)
tree404f161fd3572e9f37da98a6af1c6370f2a828ca /LedgerSMB/Tax.pm
parent5f87c41f16ab2c9da14f85f1b2d7e7b771059c10 (diff)
Fixing sales tax posting issues not taking contact into consideration
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1044 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB/Tax.pm')
-rwxr-xr-xLedgerSMB/Tax.pm16
1 files changed, 15 insertions, 1 deletions
diff --git a/LedgerSMB/Tax.pm b/LedgerSMB/Tax.pm
index 6d4c7956..6ff21459 100755
--- a/LedgerSMB/Tax.pm
+++ b/LedgerSMB/Tax.pm
@@ -30,10 +30,23 @@ 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 = 0;
+ for my $acct (split / /, $taxaccounts2){
+ if ($taxaccounts =~ /$acct/){
+ 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)
@@ -41,6 +54,7 @@ sub init_taxes {
WHERE c.accno = ?|;
my $sth = $dbh->prepare($query);
foreach $taxaccount (@accounts) {
+ next if (! defined $taxaccount);
$sth->execute($taxaccount) || $form->dberror($query);
my $ref = $sth->fetchrow_hashref;