[ic] Tax Exempt

Steve Graham icdev at mrlock.com
Wed Sep 20 08:48:20 EDT 2006


>
>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});
         }


Thanks,
Steve



More information about the interchange-users mailing list