From d1349f4eda29186b543f677aac53f075e6ee27ea Mon Sep 17 00:00:00 2001 From: Pierre Smits Date: Tue, 3 Mar 2020 09:29:54 +0100 Subject: [PATCH 1/6] Implemented: Removal of deprecated services and functions (OFBIZ-11435) Removal of deleteRateAmount --- .../accounting/groovyScripts/rate/RateServices.groovy | 7 ------- applications/accounting/servicedef/services_rate.xml | 8 -------- applications/humanres/minilang/HumanResServices.xml | 4 ++-- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/applications/accounting/groovyScripts/rate/RateServices.groovy b/applications/accounting/groovyScripts/rate/RateServices.groovy index d51cd87decf..b7e2a138575 100644 --- a/applications/accounting/groovyScripts/rate/RateServices.groovy +++ b/applications/accounting/groovyScripts/rate/RateServices.groovy @@ -77,13 +77,6 @@ def expireRateAmount() { } return success() } -/** - * Information to update the specific customer code after change service deleteRateAmount to expireRateAmount - * @return - */ -def deleteRateAmount() { - return error('delete rate amount isn\'t possible, please update your code with service name "expireRateAmount" instead "deleteRateAmount"') -} def updatePartyRate() { List partyRates = from('PartyRate').where([partyId: partyId, rateTypeId: rateTypeId]).queryList() diff --git a/applications/accounting/servicedef/services_rate.xml b/applications/accounting/servicedef/services_rate.xml index 8bdff23f3e0..2fc030a15fd 100644 --- a/applications/accounting/servicedef/services_rate.xml +++ b/applications/accounting/servicedef/services_rate.xml @@ -48,14 +48,6 @@ under the License. - - - - - - - Get Rate Amount diff --git a/applications/humanres/minilang/HumanResServices.xml b/applications/humanres/minilang/HumanResServices.xml index 4108af4bca9..b77f7e0eb98 100644 --- a/applications/humanres/minilang/HumanResServices.xml +++ b/applications/humanres/minilang/HumanResServices.xml @@ -148,9 +148,9 @@ - + - + From fc71a193e92744f43749e2570f0d94fde3e25aec Mon Sep 17 00:00:00 2001 From: Pierre Smits Date: Tue, 3 Mar 2020 09:42:52 +0100 Subject: [PATCH 2/6] Implemented: Removal of deprecated services and functions (OFBIZ-11435) Removal of captureBillingAccountPayment --- .../servicedef/services_paymentmethod.xml | 11 --- .../payment/PaymentGatewayServices.java | 87 ------------------- 2 files changed, 98 deletions(-) diff --git a/applications/accounting/servicedef/services_paymentmethod.xml b/applications/accounting/servicedef/services_paymentmethod.xml index 66db35d12f5..ced850b529c 100644 --- a/applications/accounting/servicedef/services_paymentmethod.xml +++ b/applications/accounting/servicedef/services_paymentmethod.xml @@ -352,17 +352,6 @@ under the License. - - Records a settlement or payment of an invoice by a billing account for the given captureAmount - - - - - - - - Applies (part of) the unapplied payment applications associated to the billing account to the given invoice. diff --git a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java index 7eb708adb4b..bc31f7d0362 100644 --- a/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java +++ b/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java @@ -1526,93 +1526,6 @@ public static Map processCaptureSplitPayment(DispatchContext dct return ServiceUtil.returnSuccess(); } - // Deprecated: use captureBillingAccountPayments instead of this. - public static Map captureBillingAccountPayment(DispatchContext dctx, Map context) { - Delegator delegator = dctx.getDelegator(); - LocalDispatcher dispatcher = dctx.getDispatcher(); - GenericValue userLogin = (GenericValue) context.get("userLogin"); - String invoiceId = (String) context.get("invoiceId"); - String billingAccountId = (String) context.get("billingAccountId"); - BigDecimal captureAmount = (BigDecimal) context.get("captureAmount"); - String orderId = (String) context.get("orderId"); - Locale locale = (Locale) context.get("locale"); - Map results = ServiceUtil.returnSuccess(); - - try { - // Note that the partyIdFrom of the Payment should be the partyIdTo of the invoice, since you're receiving a payment from the party you billed - GenericValue invoice = EntityQuery.use(delegator).from("Invoice").where("invoiceId", invoiceId).queryOne(); - Map paymentParams = UtilMisc.toMap("paymentTypeId", "CUSTOMER_PAYMENT", "paymentMethodTypeId", "EXT_BILLACT", - "partyIdFrom", invoice.getString("partyId"), "partyIdTo", invoice.getString("partyIdFrom"), - "statusId", "PMNT_RECEIVED", "effectiveDate", UtilDateTime.nowTimestamp()); - paymentParams.put("amount", captureAmount); - paymentParams.put("currencyUomId", invoice.getString("currencyUomId")); - paymentParams.put("userLogin", userLogin); - Map tmpResult = dispatcher.runSync("createPayment", paymentParams); - if (ServiceUtil.isError(tmpResult)) { - return ServiceUtil.returnError(ServiceUtil.getErrorMessage(tmpResult)); - } - - String paymentId = (String) tmpResult.get("paymentId"); - tmpResult = dispatcher.runSync("createPaymentApplication", UtilMisc.toMap("paymentId", paymentId, "invoiceId", invoiceId, "billingAccountId", billingAccountId, - "amountApplied", captureAmount, "userLogin", userLogin)); - if (ServiceUtil.isError(tmpResult)) { - return ServiceUtil.returnError(ServiceUtil.getErrorMessage(tmpResult)); - } - if (paymentId == null) { - return ServiceUtil.returnError(UtilProperties.getMessage(resource, - "AccountingNoPaymentCreatedForInvoice", - UtilMisc.toMap("invoiceId", invoiceId, "billingAccountId", billingAccountId), locale)); - } - results.put("paymentId", paymentId); - - if (orderId != null && captureAmount.compareTo(BigDecimal.ZERO) > 0) { - // Create a paymentGatewayResponse, if necessary - GenericValue order = EntityQuery.use(delegator).from("OrderHeader").where("orderId", orderId).queryOne(); - if (order == null) { - return ServiceUtil.returnError(UtilProperties.getMessage(resource, - "AccountingNoPaymentGatewayResponseCreatedForInvoice", - UtilMisc.toMap("invoiceId", invoiceId, "billingAccountId", billingAccountId, - "orderId", orderId), locale)); - } - // See if there's an orderPaymentPreference - there should be only one OPP for EXT_BILLACT per order - GenericValue orderPaymentPreference = EntityQuery.use(delegator).from("OrderPaymentPreference").where("orderId", orderId, "paymentMethodTypeId", "EXT_BILLACT").queryFirst(); - if (orderPaymentPreference != null) { - - // Check the productStore setting to see if we need to do this explicitly - GenericValue productStore = order.getRelatedOne("ProductStore", false); - if (productStore.getString("manualAuthIsCapture") == null || (! "Y".equalsIgnoreCase(productStore.getString("manualAuthIsCapture")))) { - String responseId = delegator.getNextSeqId("PaymentGatewayResponse"); - GenericValue pgResponse = delegator.makeValue("PaymentGatewayResponse"); - pgResponse.set("paymentGatewayResponseId", responseId); - pgResponse.set("paymentServiceTypeEnumId", CAPTURE_SERVICE_TYPE); - pgResponse.set("orderPaymentPreferenceId", orderPaymentPreference.getString("orderPaymentPreferenceId")); - pgResponse.set("paymentMethodTypeId", "EXT_BILLACT"); - pgResponse.set("transCodeEnumId", "PGT_CAPTURE"); - pgResponse.set("amount", captureAmount); - pgResponse.set("currencyUomId", invoice.getString("currencyUomId")); - pgResponse.set("transactionDate", UtilDateTime.nowTimestamp()); - // referenceNum holds the relation to the order. - // todo: Extend PaymentGatewayResponse with a billingAccountId field? - pgResponse.set("referenceNum", billingAccountId); - - // save the response - savePgr(dctx, pgResponse); - - // Update the orderPaymentPreference - orderPaymentPreference.set("statusId", "PAYMENT_SETTLED"); - orderPaymentPreference.store(); - - results.put("paymentGatewayResponseId", responseId); - } - } - } - } catch (GenericEntityException | GenericServiceException ex) { - return ServiceUtil.returnError(ex.getMessage()); - } - - return results; - } - public static Map captureBillingAccountPayments(DispatchContext dctx, Map context) { Delegator delegator = dctx.getDelegator(); String invoiceId = (String) context.get("invoiceId"); From d109f89ad44821d33903333ad1fb2b496580fce2 Mon Sep 17 00:00:00 2001 From: Pierre Smits Date: Tue, 3 Mar 2020 09:46:22 +0100 Subject: [PATCH 3/6] Implemented: Removal of deprecated services and functions (OFBIZ-11435) Removal of addPromoToMarketingCampaign --- applications/marketing/servicedef/services.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/applications/marketing/servicedef/services.xml b/applications/marketing/servicedef/services.xml index d1c3c1c1c94..3130b42b7e7 100644 --- a/applications/marketing/servicedef/services.xml +++ b/applications/marketing/servicedef/services.xml @@ -77,12 +77,6 @@ under the License. - - - Renaming service to respect service name best practice - - - Add Promo to MarketingCampaign From adc347314906164bd1e2a6ee090da8e962e6eefe Mon Sep 17 00:00:00 2001 From: Pierre Smits Date: Tue, 3 Mar 2020 09:49:03 +0100 Subject: [PATCH 4/6] Implemented: Removal of deprecated services and functions (OFBIZ-11435) Removal of removePromoFromMarketingCampaign --- applications/marketing/servicedef/services.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/applications/marketing/servicedef/services.xml b/applications/marketing/servicedef/services.xml index 3130b42b7e7..d32674e7893 100644 --- a/applications/marketing/servicedef/services.xml +++ b/applications/marketing/servicedef/services.xml @@ -82,12 +82,6 @@ under the License. - - - Renaming service to respect service name best practice - - - Update Promo to MarketingCampaign From 2578355d05082fd7775d521f7fdc1b63757f6f1e Mon Sep 17 00:00:00 2001 From: Pierre Smits Date: Tue, 3 Mar 2020 09:52:27 +0100 Subject: [PATCH 5/6] Implemented: Removal of deprecated services and functions (OFBIZ-11435) Removal of addPriceRuleToMarketingCampaign Removal of removePriceRuleFromMarketingCampaign --- applications/marketing/servicedef/services.xml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/applications/marketing/servicedef/services.xml b/applications/marketing/servicedef/services.xml index d32674e7893..51ae3417926 100644 --- a/applications/marketing/servicedef/services.xml +++ b/applications/marketing/servicedef/services.xml @@ -44,23 +44,11 @@ under the License. - - - Renaming service to respect service name best practice - - - Add PriceRule to MarketingCampaign - - - Renaming service to respect service name best practice - - - Update PriceRule to MarketingCampaign From 3de562718a6ce5dd5f4f0f218b46a600391b8254 Mon Sep 17 00:00:00 2001 From: Pierre Smits Date: Tue, 3 Mar 2020 10:04:35 +0100 Subject: [PATCH 6/6] Implemented: Removal of deprecated services and functions (OFBIZ-11435) Removal of createQuoteWorkEffort (duplicate) --- applications/order/servicedef/services_quote.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/applications/order/servicedef/services_quote.xml b/applications/order/servicedef/services_quote.xml index 71946cd07ee..e2e935ed112 100644 --- a/applications/order/servicedef/services_quote.xml +++ b/applications/order/servicedef/services_quote.xml @@ -225,13 +225,6 @@ under the License. - - - - use createQuoteWorkEffort to create a workeffort has been deprecated for best pratice naming reason, use ensureWorkEffortAndCreateQuoteWorkEffort instead. - Now createQuoteWorkEffort work as a crud service on QuoteWorkEffort - - Create a new QuoteWorkEffort