Additionally, you'll need to alter the queries in the _emailWsp and _emailWOsp
files in order for your notifications to correctly reflect the totals.

Note: Since we are not currently using the real-time CC processing, this
solution works for us.  However, I have yet to look into that process.  I
believe that this solution will not correct the error in the CC process and CCs
will get charged the incorrect price.  Obviously, the best solution here is to
alter the process of adding items to the basket and make sure that the rounding
has been done correctly prior to being inserted/updated in the database.  Once 
I
have a solution for this, I will post it.

If you have any questions, feel free to email me directly.  


AbleCommerce was able to reproduce this bug when I notified them of it.  They
are working to fix the problem in version 4.0 due out later this year.

--Jeff 
________________________________________________________________
Jeff Langevin                          Appalachian Mountain Club
MIS Department         5 Joy Street, Boston, Massachusetts 02108
617-523-0655 x302                        http://www.outdoors.org


If one advances confidently in the direction of his dreams,
and endeavors to live the life which he has imagined,
he will meet with success unexpected in common hours.

-- Henry David Thoreau




____________________Reply Separator____________________
Subject:    FYI: AbleCommerce checkout rounding bug
Author: [EMAIL PROTECTED]
Date:       1/16/2002 1:46 PM

The other day I found an obscure bug in the way AbleCommerce sums pricing for
totals and subtotals.  In my case, it exhibited itself when I discounted an 
ite
m
using a 10% discount.  This caused products to have three decimal places in 
the
discounted price ($14.95 discounted 10% is $13.455).  The ExtPrice field in
OrderOptions thinks the price is $13.455 (which technically it is) but it is
rounded to $13.46 when it is displayed in the shopping cart.  Now consider wh
en
you add another discounted book to the shopping cart.  They both get rounded 
up
to $13.46.  The subtotal line should read $26.92.  However, the subtotal 
line
displays $26.91.  Technically, this is correct since it is adding 13.455 +
13.455.  While this penny might not seem like much, I for one am not going to
try telling that to the accounting department.  :)


If you purchased the source version as we did, you can change the following in
showcott.cfm in the basket.  This may not be the best coding solution, but it
works.


Original SubTotal query:

<cfquery name = "subtotal" datasource = "#ACBMainDS#">
SELECT  Sum (OrderDetails.ExtPrice) AS SubtotalPrice
FROM        OrderDetails
WHERE       Order_ID = #Showcont.Order_ID# AND Product_ID < 100000</cfquery>


New SubTotal query:

<cfquery name = "tempSubtotal" datasource = "#ACBMainDS#">
SELECT  OrderDetails.ExtPrice
FROM        OrderDetails
WHERE       Order_ID = #Showcont.Order_ID# AND Product_ID < 100000</cfquery>

<cfset SubtotalPrice = 0>
<cfloop query="tempSubtotal"><cfif SubtotalPrice eq 0><cfset SubtotalPric=
(#evaluate((round(#tempSubtotal.ExtPrice#*100))/100)#)>
<cfelse>
<cfset SubtotalPrice = (#evaluate(SubtotalPrice +
((round(#tempSubtotal.ExtPrice#*100))/100))#)>
</cfif>
</cfloop>


Use the same basic idea for the Total query (leave the original Total query in
there just to total the weight).  Finally, change Subtotal.SubtotalPrice to
SubtotalPrice and Total.TotalPrice to TotalPrice on the lines which actually
output the subtotal and total.

Good Luck!
________________________________________________________________
Jeff Langevin                          Appalachian Mountain Club
MIS Department         5 Joy Street, Boston, Massachusetts 02108
617-523-0655 x302                        http://www.outdoors.org


If one advances confidently in the direction of his dreams,
and endeavors to live the life which he has imagined,
he will meet with success unexpected in common hours.

-- Henry David Thoreau

______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to