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

Re: Changing tax.pm in 1.21 for a new tax which replaces two old taxes



I restored lsmb to a clean 1.2.21 program/database to test the
suggestion from Chris and compare my problem to the current release.

If I set the validto date for all expired tax records, new
transactions dated after validto work fine: the new tax is used and
the old tax ignored. The problem is new transactions dated prior to
the validto date also use the new tax and ignore the old tax. I notice
this problem is also occuring in my new improvised version. This leads
me to wonder if I have discovered a transdate bug in the system:

Attempting to create a transaction with a past date (say last month)
will actually use the current date for calculating tax (I suspect).
This will only appear if you have a major change in tax structure.

I can't seem to find the place where this happens.  If I run the
Tax.pm select statement directly in psql with the correct transaction
date and g/l account id then I get the correct tax record.

Here is the tax table that I used:

select * from tax;
 chart_id | rate | taxnumber |  validto   | pass | taxmodule_id
----------+------+-----------+------------+------+--------------
    10131 | 0.05 |           | 2010-06-30 |    0 |            1
    10127 | 0.05 |           | 2010-06-30 |    0 |            1
    10129 |    0 |           | 2010-06-30 |    0 |            1
   120149 | 0.12 |           |            |    0 |            1
   120147 | 0.12 |           |            |    0 |            1
    10125 | 0.07 |           | 2010-06-30 |    0 |            1
(6 rows)

And these are the chart table records:

  10125 | 2300  | PST Payable                                      | A
        | L
| AR_tax:IC_taxpart:IC_taxservice |            | f
  10127 | 2310  | GST Payable                                      | A
        | L
| AR_tax:IC_taxpart:IC_taxservice |            | f
  10129 | 2312  | GST Payable - Rate2                              | A
        | L
| AR_tax                          |            | f
  10131 | 2315  | GST Paid on Purchases                            | A
        | L
| AP_tax                          |            | f
  10133 | 2320  | GST Payroll Deductions                           | A
        | L
|                                 |            | f
  10135 | 2335  | GST Owing (Refund)                               | A
        | L
|                                 |            | f
 120147 | 2340  | HST Payable                                      | A
        | L
| AR_tax:IC_taxpart:IC_taxservice |            | f
 120149 | 2345  | HST Paid on Purchases                            | A
        | L
| AP_tax                          |            | f
 120151 | 2355  | HST Owing (Refund)                               | A
        | L


So I am spending time trying to understand is.pl/pm and ir.pl/pm
because that looks like a possible problem area, but I'm not doing too
well.

Any suggestions appreciated.

Gerald.