diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/authorizeTransaction.bsh b/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/authorizeTransaction.bsh index ed2a842a19..bec1372e5e 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/authorizeTransaction.bsh +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/authorizeTransaction.bsh @@ -29,6 +29,12 @@ if(orderId != null){ context.put("orderHeader", orderHeader); } +if(orderHeader != null){ + orh = new OrderReadHelper(orderHeader); + context.put("orh", orh); + context.put("overrideAmount", new Double(orh.getOrderGrandTotal())); +} + if(orderPaymentPreferenceId != null){ orderPaymentPreference = delegator.findByPrimaryKey("OrderPaymentPreference", UtilMisc.toMap("orderPaymentPreferenceId", orderPaymentPreferenceId)); context.put("orderPaymentPreference", orderPaymentPreference); @@ -37,10 +43,5 @@ if(orderPaymentPreferenceId != null){ if(orderPaymentPreference != null){ paymentMethodType = orderPaymentPreference.getRelatedOneCache("PaymentMethodType"); context.put("paymentMethodType", paymentMethodType); -} - -if(orderHeader != null){ - orh = new OrderReadHelper(orderHeader); - context.put("orh", orh); - context.put("overrideAmount", new Double(orh.getOrderGrandTotal())); + context.put("overrideAmount", orderPaymentPreference.getDouble("maxAmount").doubleValue()); }