diff --git a/applications/party/widget/partymgr/CommunicationEventForms.xml b/applications/party/widget/partymgr/CommunicationEventForms.xml
index 3fcd023108..d0f164700e 100644
--- a/applications/party/widget/partymgr/CommunicationEventForms.xml
+++ b/applications/party/widget/partymgr/CommunicationEventForms.xml
@@ -918,7 +918,7 @@ under the License.
-
+
diff --git a/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java b/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java
index c301bcf12a..59bf20f358 100644
--- a/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java
+++ b/specialpurpose/ebay/src/org/ofbiz/ebay/EbayHelper.java
@@ -192,7 +192,7 @@ public class EbayHelper {
}
public static boolean createPaymentFromPaymentPreferences(Delegator delegator, LocalDispatcher dispatcher, GenericValue userLogin,
- String orderId, String externalId, Timestamp orderDate, String partyIdFrom) {
+ String orderId, String externalId, Timestamp orderDate, BigDecimal amount, String partyIdFrom) {
List paymentPreferences = null;
try {
Map paymentFields = UtilMisc.toMap("orderId", orderId, "statusId", "PAYMENT_RECEIVED",
@@ -207,7 +207,25 @@ public class EbayHelper {
if (!okay)
return false;
}
- }
+ } else {
+ paymentFields = UtilMisc.toMap("orderId", orderId, "statusId", "PAYMENT_NOT_RECEIVED",
+ "paymentMethodTypeId", "EXT_EBAY");
+ paymentPreferences = delegator.findByAnd("OrderPaymentPreference", paymentFields);
+ if (UtilValidate.isNotEmpty(paymentPreferences)) {
+ Iterator i = paymentPreferences.iterator();
+ while (i.hasNext()) {
+ GenericValue pref = (GenericValue) i.next();
+ if (UtilValidate.isNotEmpty(amount)) {
+ pref.set("statusId", "PAYMENT_RECEIVED");
+ pref.set("maxAmount", amount);
+ pref.store();
+ }
+ boolean okay = createPayment(dispatcher, userLogin, pref, orderId, externalId, orderDate, partyIdFrom);
+ if (!okay)
+ return false;
+ }
+ }
+ }
} catch (Exception e) {
Debug.logError(e, "Cannot get payment preferences for order #" + orderId, module);
return false;
diff --git a/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java b/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java
index e64ac305ce..bcf1f90aeb 100644
--- a/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java
+++ b/specialpurpose/ebay/src/org/ofbiz/ebay/EbayOrderServices.java
@@ -871,6 +871,7 @@ public class EbayOrderServices {
} else {
orderCtx.put("externalId", "EBT_" + transactionId);
}
+ orderCtx.put("transactionId", "EBI_" + itemId);
GenericValue orderExist = externalOrderExists(delegator, (String)orderCtx.get("externalId"));
if (orderExist != null) {
@@ -1006,12 +1007,14 @@ public class EbayOrderServices {
// set the external id with the eBay Item Id
String externalId = (String) context.get("externalId");
+ String transactionId = (String) context.get("transactionId");
if (UtilValidate.isNotEmpty(externalId)) {
if (externalOrderExists(delegator, externalId) != null && create) {
return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.externalIdAlreadyExist", locale));
}
cart.setExternalId(externalId);
+ cart.setTransactionId(transactionId);
} else {
return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "ordersImportFromEbay.externalIdNotAvailable", locale));
}
@@ -1232,7 +1235,7 @@ public class EbayOrderServices {
// create the payment from the preference
if (approved) {
Debug.logInfo("Creating payment for approved order.", module);
- EbayHelper.createPaymentFromPaymentPreferences(delegator, dispatcher, userLogin, orderId, externalId, cart.getOrderDate(), partyId);
+ EbayHelper.createPaymentFromPaymentPreferences(delegator, dispatcher, userLogin, orderId, externalId, cart.getOrderDate(), amountPaid, partyId);
Debug.logInfo("Payment created.", module);
}
}
@@ -1274,20 +1277,36 @@ public class EbayOrderServices {
HashMap