if ((returnAmountByOrder != null) && (returnAmountByOrder.keySet() != null)) {
Iterator orderIterator = returnAmountByOrder.keySet().iterator();
while (orderIterator.hasNext()) {
String orderId = (String) orderIterator.next();
BigDecimal returnAmount = (BigDecimal) returnAmountByOrder.get(orderId);
if (returnAmount.abs().compareTo(new BigDecimal("0.000001")) < 0) {
Debug.logError("Order [" + orderId + "] refund amount[ " + returnAmount + "] less than zero", module);
return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "OrderReturnTotalCannotLessThanZero", locale));
}
OrderReadHelper helper = new OrderReadHelper(delegator, orderId);
BigDecimal grandTotal = helper.getOrderGrandTotal();