Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Mike Bowen 12 posts 32 karma points
    Jun 16, 2014 @ 15:22
    Mike Bowen
    0

    Rounding issues?

    Hi guys

    Umbraco v6.1.6 uCommerce v6.0.0.14094 Razor store v3.0.1.14013

    Currently experiencing a slight issue with property values from the PurchaseOrder object. For example, I have a product which is 0.63 excluding Tax / VAT (at 20%). Including VAT it is 0.76 - I work out this figure manually in our current cart.

    The issue occurs taking into account quantity. 3x of the above product should work to 2.28 using banker's notation (i.e. rounding up), but it resolves to 2.27 (and this is the cost passed through to our payment provider as well), which is a penny off.

    Think I've tracked this down to the order line object, which contains the product price at 0.63 and the VAT of the order line at 0.126 (which is correct). The VAT isn't rounded up by the looks of it when the total cost of the order line is worked out - (0.63 + 0.126 = 0.756) * 3 = 2.268, which is then rounded up to 2.27, as opposed to (0.63 + 0.13 = 0.76) * 3 = 2.28.

    Really, my question is - is this an issue? Or is it by design? I just need to get back to our client with an explanation - I know rounding has occur with dealing with things like VAT and you obviously can't charge customers fractions!

    Cheers Mike

  • Mike Parkinson 7 posts 57 karma points
    Jun 16, 2014 @ 16:02
    Mike Parkinson
    0

    I am too finding this an issue, even more so when you have discount percentages applied to an order line and gets worst when an orderline has a quantity of more than 1.

    Its all down to the basket pipeline when it calculates the various parts to provide discount applied and subtotals. These are all done to 4 decimal places where as we would display the different parts to 2 decimal places.

    The great part about uCommerce is that you can change how the basket is calculated by creating your own replacing uCommerce's modules by changing the basket pipeline config file to point to your calculation modules .

    I have already created my own calculation modules which means that discounts are calculated as how we want it to.

    Thanks, Mike

  • Mike Bowen 12 posts 32 karma points
    Jun 16, 2014 @ 17:55
    Mike Bowen
    0

    Cheers Mike, you wouldn't happen to know the interface I need to implement to achieve the above?

  • Mike Parkinson 7 posts 57 karma points
    Jun 16, 2014 @ 18:31
    Mike Parkinson
    0

    You need to implement UCommerce.Pipelines.IPipelineTask<PurchaseOrder>.

    Thanks, Mike

     

  • Morten Skjoldager 440 posts 1499 karma points
    Jun 20, 2014 @ 10:24
    Morten Skjoldager
    0

    Hi guys. I think an upgrade to the latest version of uCommerce will fix this issue for you. I am aware that there were an rounding error in one of the tasks that was recently fixed.

    You can read about extending uCommerce here: http://docs.ucommerce.net

    Cheers

    //Morten

     

     

     

     

Please Sign in or register to post replies

Write your reply to:

Draft