[ic] Working with VAT inclusive prices

interchange at tvcables.co.uk interchange at tvcables.co.uk
Tue Mar 22 13:32:17 EST 2005


Quoting Steve <interchange at bojanglesdesign.co.uk>:

> Thanks Jamie, that looks like a great backup if I can't get the new
> 'TaxInclusive' working properly. I'll post out what I find in the next day
> or two.
>
> Steve
>
> on 22/3/05 4:11 pm, Jamie Neil wrote:
>
> > Steve wrote:
> >> If so, could Jamie expand on how his system works with the CommonAdjust
> >> tags? I haven't used CommonAdjust before, but thought it was for quantity
> >> pricing?
> >
> > catalog.cfg
> > -----------
> > ...
> > include etc/subtax.tag
> > ...
> > CommonAdjust <<EOF
> >  :price:,
> >  ;$,
> >  [subtax]
> > EOF
> > ...
> >
> > etc/subtax.tag
> > --------------
> > UserTag subtax              Routine   <<EOR
> > sub {
> > my $price = $s;
> > $price = $price/1.175;
> > return $price-$s;
> > }
> > EOR
> >
> >
> > If I was to do this now (having more IC experience), I would probably:
> >
> > 1) Use the "& CODE" rule form rather than a usertag.
> >
> > 2) Make the tax deduction according to the value of the tax_category &
> > nontaxable fields.
> >
> > However despite being ugly it does work.

I spent a long time playing with Interchange trying to get VAT to work correctly
without rounding errors, in the end I concluded the only way to do things
properly was store the ex VAT prices in the database with 5 decimal places and
use my own calculations to assign VAT. Every other way caused rounding errors.

Andy.




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


More information about the interchange-users mailing list