[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
Re: [ic] How to round up the handling fee and sales tax
Quoting Xiaowen Wu (xiaowen@safetopia.com):
>
> Hi there,
>
> We have setup the shiping and handing fee based on the sub-total of the
> order, and the minivend calculate the handlnig fee correctly.
>
> zzz Handling [subtotal noformat=1] 0 0 e f
> {'round' => "0.1",'ups' => "0",'ui_ship_type' => "_subtotal",}
> zzz Handling [subtotal noformat=1] 0 999999 f
> [subtotal noformat=1] * 35 / 1000 {} {}
>
> but we have a round of problem, such as:
>
> subtotal $250.00
> sales tax $20.63
> S&H $5.32
> =======================
> total $275.94 <==== (should be $275.95)
>
> I think the problem is because minivend didn't round off the S&H fee, and
> the sales tax. So my quesiont is: are there any way to round of the
> calculate in the shipping.asc to avoid this problem .
The salestax should have been rounded depending on version -- the
shipping probably is not. This is a bug, and can be fixed by this patch
(also attached).
Index: Interpolate.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 1.46
diff -c -r1.46 Interpolate.pm
*** Interpolate.pm 2001/03/07 15:07:05 1.46
--- Interpolate.pm 2001/04/03 11:58:01
***************
*** 5368,5373 ****
--- 5368,5374 ----
for(@modes) {
$out += shipping($_, $opt);
}
+ $out = Vend::Util::round_to_frac_digits($out);
$out = currency($out, $opt->{noformat}, $opt->{convert});
}
return $out unless $opt->{hide};
--
Red Hat, Inc., 131 Willow Lane, Floor 2, Oxford, OH 45056
phone +1.513.523.7621 fax 7501 <mheins@redhat.com>
Experience is what allows you to recognize a mistake the second
time you make it. -- unknown
Index: Interpolate.pm
===================================================================
RCS file: /anon_cvs/repository/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 1.46
diff -c -r1.46 Interpolate.pm
*** Interpolate.pm 2001/03/07 15:07:05 1.46
--- Interpolate.pm 2001/04/03 11:58:01
***************
*** 5368,5373 ****
--- 5368,5374 ----
for(@modes) {
$out += shipping($_, $opt);
}
+ $out = Vend::Util::round_to_frac_digits($out);
$out = currency($out, $opt->{noformat}, $opt->{convert});
}
return $out unless $opt->{hide};