[ic] Working with VAT inclusive prices

Jonathan Clark jonc at webmaint.com
Wed Mar 23 05:04:14 EST 2005


> > >> 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.
> > 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.
>
> 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.

This was one of the main reasons that TaxInclusive feature was added. Prices
are stored inclusive of VAT and so never display wrong :-)

Jonathan.


--
Jonathan Clark
Managing Director,
Webmaint.com   - Building Clever Websites        http://www.webmaint.com
Webmaint.net   - Business Web Hosting            http://www.webmaint.net
Cartridge SAVE - Printer Consumables Online
http://www.cartridgesave.co.uk
WireTel        - Internet Connectivity Solutions http://www.wiretel.net



More information about the interchange-users mailing list