Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] Sales Tax



******    message to minivend-users from Mike Heins <mikeh@minivend.com>     ******

Quoting Philippe JAOUEN (pjaouen@DIAL.OLEANE.COM):
> 
> I am not a user but a newbie testing interchange
> a few questions:
> 
> Is it possible to have VAT 5.5% for food and soft drinks, VAT 19.6% for
> other products in CEE
> and 0 % for customers outside CEE
> 
> I can't print the order receipt with linux netscape : I get a netscape
> error like "stdin output empty"

There is good news and better news and bad news.

The good news -- it very possible in any version of Minivend or
Interchange. Just write a UserTag which generates the cost of
non-food and food items. In MV4 it is pretty easy (untested):

AutoModifier tax_criteria

UserTag catcost	Order category
UserTag catcost	Routine <<EOR
sub {
	my ($cat) = @_;
	my $cart = $Carts->{main};
	my $tot = 0;
	foreach my $item (@$cart) {
	    $tot += $Tag->price($item->{code})
		    if $item->{tax_criteria} eq $cat;
	}
	return $tot;
}
EOR

Now [catcost goods] and [catcost food] should work with mv_handling 
(as below) to get the right taxing basis.

The better news -- in Interchange you can do it with lines in shipping.asc,
entries in products, and entries in catalog.cfg.

The bad news -- I found a bug when testing this answer. It will work in the
next preview release (within days).

In catalog.cfg, automatically load a category into the shopping cart:

    Automodifier  tax_criteria

(You can also locate it outboard in another_table with
another_table:tax_criteria.)

products database:

    add field "tax_criteria" and put "food" or "goods" in each item.

shipping.asc: (Change the vertical bar | to TAB in the actual entry)

VAT1|VAT for food|[subtotal noformat=1]|0|9999999|x .055||limit=tax_criteria, filter=food
VAT2|VAT for nonfood|[subtotal noformat=1]|0|9999999|x .196||limit=tax_criteria, filter=goods

Then in checkout.html, find some way of determining the
location, such as

    [if value country =~ /UK|FR|etc./]
	[value name=mv_handling set="VAT1 VAT2" hide=1]
    [/if]

and set the mv_handling variable.

Now, all you should have to do is put a line like:

    VAT   [handling]

in appropriate places. This is automatically reflected in [total-cost].
Of course you can show the different types:

	[handling VAT1]
	[handling VAT2]

I expect an upcoming version of Interchange to handle VAT stuff with
a "wizard".

-- 
Akopia, Inc., 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.8220 fax 7501 <heins@akopia.com>

Clothes make the man.  Naked people have little or no influence on
society.  -- Mark Twain
-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: