From 31bbafbc09cd209478f8a6c066037b5ad8e4fc35 Mon Sep 17 00:00:00 2001 From: Jacopo Cappellato Date: Fri, 6 Jul 2007 06:10:00 +0000 Subject: [PATCH] Applied patch by Rashko Rejmer (OFBIZ-1125) to pull the value of the maxAmount field and use it as a default value for the payment auth screen (if a payment preference is passed). git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@553750 13f79535-47bb-0310-9956-ffa450edef68 --- .../actions/transaction/authorizeTransaction.bsh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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()); }