[ic] SalesTax multi by *billing* country?

Interchange user interchange-users@icdevgroup.org
Thu Mar 6 14:10:01 2003


>> I currently have SalesTax set to 'multi' with the appropriate tax
>> categories set in the tax field of the country table, for the UK.
>>
>> My question is: how can I calculate sales tax based on the
>> billing country (if different to the shipping country), but still use
>> the multi SalesTax type?
>>
>> I searched the archives and found the following:
>>
>>
>>>> Well, I guess I mixed up what I was asking.  The technically
>>>> correct way to charge sales tax is the the purchaser, not
>>>> necessarily the receiver. So, if the billing state is filled in, then
>>>> sales tax should be calculated to this, if not, then assume that
>>>> Billing Address == Shipping Address, so calculate based on
>>>> the Shipping State.
>>>>
>>>> Any ideas on how to implement this easily?
>>>
>>>In catalog.cfg:
>>>
>>>	SalesTax   tax_state
>>>
>>>At top of checkout.html and appropriate place in etc/profiles.order:
>>>
>>>	[if value b_state]
>>>		[value name=tax_state set="[value b_state]" hide=1]
>>>	[else]
>>>		[value name=tax_state set="[value state]" hide=1]
>>>	[/else]
>>>	[/if]
>>
>>
>> I was thinking about something like this, but how can I still use
>> multiple tax categories?
>
>
> The variable MV_COUNTRY_FIELD specifies which form value to use for the tax
> lookup and defaults to 'country'. Using something like the above code to
> make sure your shipping value is set to the billing one if not set, you can
> set the MV_COUNTRY_FIELD to your billing value name for the tax lookups in
> the country table.
>
> If you want to look into what's actually happening, its in Interpolate.pm
> in the routine tax_vat().
>
> Jonathan
> www.webmaint.net


Thank you Jonathan, that was very helpful. I've put the following near the 
top of checkout.html, and it works a treat:

[if value b_country]
    [perl no_return=1]$Variable->{MV_COUNTRY_FIELD} = 'b_country';[/perl]
[/if]