diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-12-21 06:43:08 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-12-21 06:43:08 +0000 |
commit | b33cdbb936ff45aedc91edd1feded999e8a0a786 (patch) | |
tree | 094dc0ca2be373f5b025dd8c310f03fefa929ec7 /LedgerSMB | |
parent | 83700eaa5b26f74ea5f6ae9d133885fea88882c7 (diff) |
Correcting 1852784: bad tax selection for future dates
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1992 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rwxr-xr-x | LedgerSMB/Tax.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/LedgerSMB/Tax.pm b/LedgerSMB/Tax.pm index 9de046bf..bc0ba5fe 100755 --- a/LedgerSMB/Tax.pm +++ b/LedgerSMB/Tax.pm @@ -49,7 +49,7 @@ sub init_taxes { t.rate, t.chart_id, t.pass, m.taxmodulename FROM tax t INNER JOIN chart c ON (t.chart_id = c.id) INNER JOIN taxmodule m ON (t.taxmodule_id = m.taxmodule_id) - WHERE c.accno = ? AND coalesce(validto, 'now()') >= ? + WHERE c.accno = ? AND coalesce(validto, ?) >= ? ORDER BY coalesce(validto, now()) DESC|; my $sth = $dbh->prepare($query); foreach $taxaccount (@accounts) { @@ -57,7 +57,8 @@ sub init_taxes { if ( defined $taxaccounts2 ) { next if $taxaccounts2 !~ /\b$taxaccount\b/; } - $sth->execute($taxaccount, $transdate) || $form->dberror($query); + $sth->execute($taxaccount, $transdate, $transdate) + || $form->dberror($query); my $ref = $sth->fetchrow_hashref; my $module = $ref->{'taxmodulename'}; |