[ic] Tax Exempt

Mike Heins mike at perusion.com
Wed Sep 20 09:27:54 EDT 2006


Quoting Steve Graham (icdev at mrlock.com):
> 
> >
> >I don't think setting a scratch here is necessary:
> >[if type=data term="userdb::tax_exempt::[data session username]"]
> >  [assign salestax=0]
> >[/if]
> >
> >A stub for a SpecialSub would probably work out well.
> 
> Thanks Peter - that's nice and concise...
> 
> I am still thinking about modifying Interpolate.pm
> 
> Please offer advice for this code - I'm not quite sure I understand 
> the raw Perl Database methods:
> 
> sub salestax {
>         my($cart, $opt) = @_;
> 
>         $opt ||= {};
> 
>         my($save, $oldspace);
> +
> + ###If Customer is tax exempt return 0 & exit !
> + if($Tag->data({
> +        table => 'userdb',
> +        column => 'tax_exempt',
> +        key => $Session->{username},
> +    })) return 0;
> +
>         ### If the user has assigned to salestax,
>         ### we use their value come what may, no rounding
>         if($Vend::Session->{assigned}) {
>                 return $Vend::Session->{assigned}{salestax}
>                         if defined $Vend::Session->{assigned}{salestax}
>                         && length( $Vend::Session->{assigned}{salestax});
>         }
> 

There are ways to do this already -- all you have to do is set:

	SalesTax   tax_exempt zip state

Then put in salestax.asc (or whatever your mechanism is):

	notax	0.00

At that point, just set the tax_exempt field to "notax" and
you have it.

There is a way to do it with Multi, too.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.765.647.1295  tollfree 800-949-1889 <mike at perusion.com>

Fast, reliable, cheap.  Pick two and we'll talk.  -- unknown


More information about the interchange-users mailing list