Author: sichen
Date: Mon Aug 21 16:22:53 2006
New Revision: 433423
URL:
http://svn.apache.org/viewvc?rev=433423&view=revLog:
Check for null paymentIds in returns processing
Modified:
incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
URL:
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java?rev=433423&r1=433422&r2=433423&view=diff==============================================================================
--- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java (original)
+++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java Mon Aug 21 16:22:53 2006
@@ -1035,15 +1035,17 @@
BigDecimal amountApplied = responseAmount.multiply(invoiceTotal).divide(grandTotal, decimals, rounding).setScale(decimals, rounding);
- // create a payment application for the invoice
- Map input = UtilMisc.toMap("paymentId", paymentId, "invoiceId", invoice.getString("invoiceId"));
- input.put("amountApplied", new Double(amountApplied.doubleValue()));
- input.put("userLogin", userLogin);
- Map serviceResults = dispatcher.runSync("createPaymentApplication", input);
- if (ServiceUtil.isError(serviceResults)) {
- return ServiceUtil.returnError(errorMsg, null, null, serviceResults);
+ if (paymentId != null) {
+ // create a payment application for the invoice
+ Map input = UtilMisc.toMap("paymentId", paymentId, "invoiceId", invoice.getString("invoiceId"));
+ input.put("amountApplied", new Double(amountApplied.doubleValue()));
+ input.put("userLogin", userLogin);
+ Map serviceResults = dispatcher.runSync("createPaymentApplication", input);
+ if (ServiceUtil.isError(serviceResults)) {
+ return ServiceUtil.returnError(errorMsg, null, null, serviceResults);
+ }
+ if (Debug.verboseOn()) { Debug.logInfo("Created PaymentApplication for response with amountApplied " + amountApplied.toString(), module); }
}
- if (Debug.verboseOn()) { Debug.logInfo("Created PaymentApplication for response with amountApplied " + amountApplied.toString(), module); }
}
} catch (GenericServiceException e) {
Debug.logError(e, errorMsg + e.getMessage(), module);