[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1992] branches/1.2/LedgerSMB/Tax.pm



Revision: 1992
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1992&view=rev
Author:   einhverfr
Date:     2007-12-20 22:43:08 -0800 (Thu, 20 Dec 2007)

Log Message:
-----------
Correcting 1852784:  bad tax selection for future dates

Modified Paths:
--------------
    branches/1.2/LedgerSMB/Tax.pm

Modified: branches/1.2/LedgerSMB/Tax.pm
===================================================================
--- branches/1.2/LedgerSMB/Tax.pm	2007-12-21 06:32:50 UTC (rev 1991)
+++ branches/1.2/LedgerSMB/Tax.pm	2007-12-21 06:43:08 UTC (rev 1992)
@@ -49,7 +49,7 @@
 			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 @@
         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'};


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.