• Welcome to KonaKart Community Forum. Please login or sign up.
 

Saving a new order, not using normal checkout

Started by xzistance, February 10, 2009, 09:17:45 pm

Previous topic - Next topic

sashwill

This is how I fixed it because there is a bug in the save order method. I placed this in the CheckoutServerPaymentSubmitAction class just before save is called.


OrderProductIf[] orderProducts = order.getOrderProducts();
  for (OrderProductIf op : orderProducts) {
     int scale = new Integer(order.getCurrency().getDecimalPlaces()).intValue();
     op.setFinalPriceExTax(op.getPrice().multiply(new BigDecimal(op.getQuantity())).setScale(scale + 1, BigDecimal.ROUND_HALF_UP));
}


This makes sure that when they divide in the save method it comes out with a number that is valid.

ejaen


impiastro

Thank you sashwill, it was so helpful me too.

The trevor solution about decimal places in currency does not solve my issue.