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

Re: Crappy work-around for tax accounts with expiration

On Thursday 31 May 2007 00:03, Chris Travers wrote:
> For tax accounts with expiration, you have a couple of options.
> If you don't need Slony, just drop the primary key constraint.  If you
> do, we can help provide a solution.

So the primary key contraint had been dropped in my case, but the issue was 
that the code that decides which tax rate to use is a select which just takes 
the first response, which will get the expired one in all cases, hence the 
patch that works around that issue so that if there is more than one tax for 
a single ID, the correct one will be selected based on the form's transaction 

I'm not sure it is the best way to code it, but it seems to work for me (tm).


> On 5/27/07, Leah Kubik <..hidden..> wrote:
> > If you have tax accounts that expired at a specific date, only the first
> > one (often the expired one) will be used when calculating out an invoice,
> > or similar... For example, if you had a tax table like this:
> >
> > 10019   0.07    862865185       2006-06-30      0       1
> > 10019   0.06    862865185       \N      0       1
> >
> > The 7 percent rate will always be used.  (Now I realize that in theory
> > this kind of tax table would never work with 1.2.x because a primary key
> > is required for this table, but you may have disabled this, for legacy
> > reasons. So here is a patch that works for me, but the code is really
> > hacky and I am sure there must be a better way to handle this.  Patch is
> > against 1.2.4:
> >
> > I still haven't figured out what is going on where the tax account is not
> > actually updated upon invoice post when using something other than the
> > default chart of accounts tax item that has been discussed somewhat in
> > previous posts.  Maybe I'll figure that out...

Leah Kubik : d416-585-9971x692 : d416-703-5977 : m416-559-6511
Frauerpower! Co. : www.frauerpower.com : Toronto, ON Canada
MSN: ..hidden.. | AIM: frauerpower | Yahoo: h3inous
F9B6 FEFE 080B 8299 D7EA  1270 005C EC73 47C9 B7A6