From 58caff21d40b53f887df95b68ad49a31aecd974a Mon Sep 17 00:00:00 2001 From: pushprajsinghjadoun Date: Fri, 19 Jul 2024 18:52:07 +0530 Subject: [PATCH] Removed UpgradeServices.java and services_upgrade.xml files, and also removed the oldInvoiceSequenceEnumId, oldOrderSequenceEnumId, and oldQuoteSequenceEnumId references from the Groovy script. [OFBIZ-12858] --- .../invoice/InvoiceServicesScript.groovy | 8 --- .../order/order/OrderServicesScript.groovy | 2 - .../party/servicedef/services_upgrade.xml | 37 ------------- .../ofbiz/party/party/UpgradeServices.java | 55 ------------------- 4 files changed, 102 deletions(-) delete mode 100644 applications/party/servicedef/services_upgrade.xml delete mode 100644 applications/party/src/main/java/org/apache/ofbiz/party/party/UpgradeServices.java diff --git a/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/invoice/InvoiceServicesScript.groovy b/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/invoice/InvoiceServicesScript.groovy index 19543f01e16..9c043fcc0b9 100644 --- a/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/invoice/InvoiceServicesScript.groovy +++ b/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/invoice/InvoiceServicesScript.groovy @@ -43,14 +43,6 @@ Map getNextInvoiceId() { GenericValue customMethod = partyAcctgPreference.getRelatedOne('InvoiceCustomMethod', true) if (customMethod) { customMethodName = customMethod.customMethodName - } else { - //retrieve service from deprecated enumeration see OFBIZ-3765 beware of OFBIZ-3557 - if (partyAcctgPreference.oldInvoiceSequenceEnumId == 'INVSQ_ENF_SEQ') { - customMethodName = 'invoiceSequenceEnforced' - } - if (partyAcctgPreference.oldInvoiceSequenceEnumId == 'INVSQ_RESTARTYR') { - customMethodName = 'invoiceSequenceRestart' - } } } else { logWarning("Acctg preference not defined for partyId [${parameters.partyId}]") diff --git a/applications/order/src/main/groovy/org/apache/ofbiz/order/order/OrderServicesScript.groovy b/applications/order/src/main/groovy/org/apache/ofbiz/order/order/OrderServicesScript.groovy index 30c0532c81c..41764950d68 100644 --- a/applications/order/src/main/groovy/org/apache/ofbiz/order/order/OrderServicesScript.groovy +++ b/applications/order/src/main/groovy/org/apache/ofbiz/order/order/OrderServicesScript.groovy @@ -44,8 +44,6 @@ Map getNextOrderId() { if (customMethod) { customMethodName = customMethod.customMethodName - } else if (partyAcctgPreference && partyAcctgPreference.oldOrderSequenceEnumId == 'ODRSQ_ENF_SEQ') { - customMethodName = 'orderSequence_enforced' } String orderIdTemp diff --git a/applications/party/servicedef/services_upgrade.xml b/applications/party/servicedef/services_upgrade.xml deleted file mode 100644 index 6930df0ee7f..00000000000 --- a/applications/party/servicedef/services_upgrade.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - Party Component Services - OFBiz - 1.0 - - - - - Migrate Person's marital status from indicator to enumeration - Since revision 1858261(27 April 2019) field oldMaritalStatus of Person has been deprecated. - This service can be used to upgrade existing data of oldMaritalStatus field to the new maritalStatusEnumId - field of Person Entity. - - - diff --git a/applications/party/src/main/java/org/apache/ofbiz/party/party/UpgradeServices.java b/applications/party/src/main/java/org/apache/ofbiz/party/party/UpgradeServices.java deleted file mode 100644 index ded56c97318..00000000000 --- a/applications/party/src/main/java/org/apache/ofbiz/party/party/UpgradeServices.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.ofbiz.party.party; - -import org.apache.ofbiz.base.util.Debug; -import org.apache.ofbiz.entity.Delegator; -import org.apache.ofbiz.entity.GenericEntityException; -import org.apache.ofbiz.entity.GenericValue; -import org.apache.ofbiz.entity.condition.EntityCondition; -import org.apache.ofbiz.entity.condition.EntityOperator; -import org.apache.ofbiz.entity.util.EntityQuery; -import org.apache.ofbiz.service.DispatchContext; -import org.apache.ofbiz.service.ServiceUtil; - -import java.util.List; -import java.util.Map; - -public class UpgradeServices { - - private static final String MODULE = UpgradeServices.class.getName(); - - public static Map migrateMaritalStatusFromIndicatorToEnum(DispatchContext dctx, Map context) { - Delegator delegator = dctx.getDelegator(); - try { - List persons = EntityQuery.use(delegator).from("Person") - .where(EntityCondition.makeCondition("oldMaritalStatus", EntityOperator.NOT_EQUAL, null)).queryList(); - for (GenericValue person : persons) { - person.put("maritalStatusEnumId", "Y".equalsIgnoreCase(person.getString("oldMaritalStatus")) ? "MARRIED" : "SINGLE"); - person.store(); - } - } catch (GenericEntityException e) { - Debug.logError(e, MODULE); - return ServiceUtil.returnError(e.getMessage()); - } - - return ServiceUtil.returnSuccess(); - } -}