I was already found one point that caused the issue when using
percentage discount
snippet from product.models:
======
def apply_percentage(cls, discounted, percentage):
work = {}
for lid, price in discounted.items():
work[lid] = price * percentage / 100
round_cents(work)
return work
======
By commenting out the line containing round_cents solves the issue
when using percentage.
I still see this line round_cents in the trunk/tip revision. So imo
the issue is still there. I had no time to look at apply_even_split,
but this probably contains a similar error.
I checked the trunk at products.model.py at the functions
"apply_even_split" and "apply_percentage" they use round_cents and
this messes up the calculation on displayed on the "confirm" page.
If I would just delete these 2 lines it would probably my rounding
issues, but I have no idea what the side effect is.
Can you advice on this? maybe what regression tests I can do to see if
I didn't break anything else....
Cheers,
On Apr 12, 10:31 pm, Chris Moffitt <[email protected]> wrote:
> We made some changes in trunk to improve rounding support. Any chance you
> can check out whether or not trunk continue to exhibit this behavior?
>
> -Chris
>
> On Mon, Apr 12, 2010 at 3:26 PM, Michael S <[email protected]> wrote:
> > Hi
>
> > I am running into some rounding issues when I use 100% discount(either
> > by percentage or money value) on an article with prices with more
> > than 2 decimals.
>
> > Problem lies eventually in rounding of the value placed in the
> > "discount" column of the "shop_orderitem" table.
> > The value of this column is rounded to two decimals while my unit
> > prices & line item_prices are filled in with 6 decimals(to avoid taxed
> > price totals to drift a few cents when ordering multiple articles).
>
> > As a result my total price when making payment is 0.01 cent.
>
> > example:
> > line item price = 6.302521
> > discount = 6.30
>
> > subtotal = line item price - discount = 0.002521 => 1 cent.
>
> > I am using the 0.9 release.
>
> > I am willing to look if I can submit a patch(if not already fixed in
> > trunk). but can someone guide which part of the code is responsible of
> > adding the discount in the orderitem table
>
> > The orderitem model is not restricted to 2 decimals:
> > discount = CurrencyField(_("Line item discount"),
> > max_digits=18, decimal_places=10, blank=True, null=True)
>
> > So can someone guide me where to start looking, so I can contribute a
> > patch.
>
> > thanks,
> > Mike
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Satchmo users" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<satchmo-users%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/satchmo-users?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Satchmo users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/satchmo-users?hl=en.