Akopia Akopia Services

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

[mv] Re: I could use a little help on Minivend



******    message to minivend-users from Frank Miedreich <miedreich@acm.org>     ******

>Hi!
>
>Sorry to bother you with an old problem like Minivend.
>But I saw your reply on the post list about adjusting checkout
>using VAT (in Romania TVA).
>
>PROBLEM: When the Subtotal price is greater than 1000 $
>I always get the TVA divided by 1000. That is, if Subtotal=1200
>I get TVA=0.228 $ instead of 228 $.
>
>I have used this routine in catalog.cfg:
>
># This routine calculates the VAT
># Usage: [tva interpolate =1][subtotal][/tva]
>UserTag	tva	hasEndTag	1
>UserTag	tva	Interpolate	1
>UserTag tva Routine <<EOF
>sub {
>     my ($a) = @_;
>     my $out ='';
>     $a = 0.19*$a;
>     $out .= '[currency]';
>     $out .= "$a";
>     $out .= '[/currency]';
>     return $out;
>}
>EOF
>


The problem comes from [subtotal] without noformat. This will produce 
output formatted according to your locale, which probably uses a 
period as a thousand seperator. Perl will interpret this as a decimal 
point, this leads to the division by thousand.

You should use [subtotal noformat="1"] instead, this will give you 
the raw price info without any formatting.

Cheers, Frank


-- 
Frank Miedreich
-
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: