Author: lektran
Date: Mon Aug 2 10:48:06 2010 New Revision: 981447 URL: http://svn.apache.org/viewvc?rev=981447&view=rev Log: Replaced all usage of CommonWorkers.hasParentType(...) with the EntityTypeUtil version. Modified: ofbiz/trunk/applications/accounting/webapp/accounting/invoice/invoiceReportItems.fo.ftl ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/ShipGroups.groovy ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl ofbiz/trunk/applications/order/webapp/ordermgr/order/orderitems.ftl ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml ofbiz/trunk/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductInventoryItems.groovy ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackingSlip.groovy Modified: ofbiz/trunk/applications/accounting/webapp/accounting/invoice/invoiceReportItems.fo.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/invoice/invoiceReportItems.fo.ftl?rev=981447&r1=981446&r2=981447&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/invoice/invoiceReportItems.fo.ftl (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/invoice/invoiceReportItems.fo.ftl Mon Aug 2 10:48:06 2010 @@ -96,7 +96,7 @@ under the License. <#-- if the item has a description, then use its description. Otherwise, use the description of the invoiceItemType --> <#list invoiceItems as invoiceItem> <#assign itemType = invoiceItem.getRelatedOne("InvoiceItemType")> - <#assign isItemAdjustment = Static["org.ofbiz.common.CommonWorkers"].hasParentType(delegator, "InvoiceItemType", "invoiceItemTypeId", itemType.getString("invoiceItemTypeId"), "parentTypeId", "INVOICE_ADJ")/> + <#assign isItemAdjustment = Static["org.ofbiz.entity.util.EntityTypeUtil"].hasParentType(delegator, "InvoiceItemType", "invoiceItemTypeId", itemType.getString("invoiceItemTypeId"), "parentTypeId", "INVOICE_ADJ")/> <#assign taxRate = invoiceItem.getRelatedOne("TaxAuthorityRateProduct")?if_exists> <#assign itemBillings = invoiceItem.getRelated("OrderItemBilling")?if_exists> Modified: ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?rev=981447&r1=981446&r2=981447&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java (original) +++ ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Mon Aug 2 10:48:06 2010 @@ -40,13 +40,13 @@ import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilNumber; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; -import org.ofbiz.common.CommonWorkers; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericPK; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.condition.EntityCondition; import org.ofbiz.entity.condition.EntityOperator; +import org.ofbiz.entity.util.EntityTypeUtil; import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.manufacturing.bom.BOMTree; import org.ofbiz.manufacturing.bom.BOMNode; @@ -2958,7 +2958,7 @@ public class ProductionRunServices { if (product == null) { return ServiceUtil.returnError("Error: product with id [" + inventoryItem.get("productId") + "] not found."); } - if (CommonWorkers.hasParentType(delegator, "ProductType", "productTypeId", product.getString("productTypeId"), "parentTypeId", "MARKETING_PKG_AUTO")) { + if (EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", product.getString("productTypeId"), "parentTypeId", "MARKETING_PKG_AUTO")) { Map serviceContext = UtilMisc.toMap("inventoryItemId", inventoryItemId, "userLogin", userLogin); /* Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml?rev=981447&r1=981446&r2=981447&view=diff ============================================================================== --- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml (original) +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml Mon Aug 2 10:48:06 2010 @@ -183,7 +183,7 @@ under the License. <entity-one entity-name="Product" auto-field-map="true" value-field="product"/> <set from-field="product.requirementMethodEnumId" field="requirementMethodId"/> <if-empty field="requirementMethodId"> - <set field="isMarketingPkg" value="${groovy: org.ofbiz.common.CommonWorkers.hasParentType(delegator, 'ProductType', 'productTypeId', product.productTypeId, 'parentTypeId', 'MARKETING_PKG')}" type="Boolean"/> + <set field="isMarketingPkg" value="${groovy: org.ofbiz.entity.util.EntityTypeUtil.hasParentType(delegator, 'ProductType', 'productTypeId', product.productTypeId, 'parentTypeId', 'MARKETING_PKG')}" type="Boolean"/> <if> <condition> <and> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=981447&r1=981446&r2=981447&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Mon Aug 2 10:48:06 2010 @@ -48,7 +48,6 @@ import org.ofbiz.base.util.UtilNumber; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.collections.ResourceBundleMapWrapper; -import org.ofbiz.common.CommonWorkers; import org.ofbiz.common.DataModelConstants; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntity; @@ -62,6 +61,7 @@ import org.ofbiz.entity.transaction.Gene import org.ofbiz.entity.transaction.TransactionUtil; import org.ofbiz.entity.util.EntityFindOptions; import org.ofbiz.entity.util.EntityListIterator; +import org.ofbiz.entity.util.EntityTypeUtil; import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.order.shoppingcart.CartItemModifyException; import org.ofbiz.order.shoppingcart.CheckOutHelper; @@ -1171,7 +1171,7 @@ public class OrderServices { } if (reserveInventory) { // for MARKETING_PKG_PICK reserve the components - if (CommonWorkers.hasParentType(delegator, "ProductType", "productTypeId", product.getString("productTypeId"), "parentTypeId", "MARKETING_PKG_PICK")) { + if (EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", product.getString("productTypeId"), "parentTypeId", "MARKETING_PKG_PICK")) { Map componentsRes = dispatcher.runSync("getAssociatedProducts", UtilMisc.toMap("productId", orderItem.getString("productId"), "type", "PRODUCT_COMPONENT")); if (ServiceUtil.isError(componentsRes)) { resErrorMessages.add(componentsRes.get(ModelService.ERROR_MESSAGE)); @@ -1231,7 +1231,7 @@ public class OrderServices { } // Reserving inventory or not we still need to create a marketing package // If the product is a marketing package auto, attempt to create enough packages to bring ATP back to 0, won't necessarily create enough to cover this order. - if (CommonWorkers.hasParentType(delegator, "ProductType", "productTypeId", product.getString("productTypeId"), "parentTypeId", "MARKETING_PKG_AUTO")) { + if (EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", product.getString("productTypeId"), "parentTypeId", "MARKETING_PKG_AUTO")) { // do something tricky here: run as the "system" user // that can actually create and run a production run GenericValue permUserLogin = delegator.findByPrimaryKeyCache("UserLogin", UtilMisc.toMap("userLoginId", "system")); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/ShipGroups.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/ShipGroups.groovy?rev=981447&r1=981446&r2=981447&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/ShipGroups.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/ShipGroups.groovy Mon Aug 2 10:48:06 2010 @@ -21,7 +21,7 @@ import javolution.util.FastMap; import javolution.util.FastList; import org.ofbiz.base.util.UtilMisc; -import org.ofbiz.common.CommonWorkers; +import org.ofbiz.entity.util.EntityTypeUtil; import org.ofbiz.entity.util.EntityUtil; orderId = parameters.orderId; @@ -108,8 +108,8 @@ shipGroups.each { shipGroup -> line.quantityShipped = quantityShipped; line.quantityOpen = quantityOpen; - if (CommonWorkers.hasParentType(delegator, "ProductType", "productTypeId", product.productTypeId, "parentTypeId", "MARKETING_PKG")) { - assocType = CommonWorkers.hasParentType(delegator, "ProductType", "productTypeId", product.productTypeId, "parentTypeId", "MARKETING_PKG_AUTO") ? "MANUF_COMPONENT" : "PRODUCT_COMPONENT"; + if (EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", product.productTypeId, "parentTypeId", "MARKETING_PKG")) { + assocType = EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", product.productTypeId, "parentTypeId", "MARKETING_PKG_AUTO") ? "MANUF_COMPONENT" : "PRODUCT_COMPONENT"; sublines = expandProductGroup(product, quantityInGroup, quantityShipped, quantityOpen, assocType); line.expandedList = sublines; } Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl?rev=981447&r1=981446&r2=981447&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl Mon Aug 2 10:48:06 2010 @@ -149,7 +149,7 @@ under the License. <div> <a href="/catalog/control/EditProductInventoryItems?productId=${productId}" class="buttontext"><b>${uiLabelMap.ProductInventory}</b></a>: ${uiLabelMap.ProductAtp} = ${availableToPromiseMap.get(productId)}, ${uiLabelMap.ProductQoh} = ${quantityOnHandMap.get(productId)} - <#if Static["org.ofbiz.common.CommonWorkers"].hasParentType(delegator, "ProductType", "productTypeId", product.productTypeId, "parentTypeId", "MARKETING_PKG")> + <#if Static["org.ofbiz.entity.util.EntityTypeUtil"].hasParentType(delegator, "ProductType", "productTypeId", product.productTypeId, "parentTypeId", "MARKETING_PKG")> ${uiLabelMap.ProductMarketingPackageATP} = ${mktgPkgATPMap.get(productId)}, ${uiLabelMap.ProductMarketingPackageQOH} = ${mktgPkgQOHMap.get(productId)} <#if ( mktgPkgATPMap.get(cartLine.getProductId()) < cartLine.getQuantity()) && (shoppingCart.getOrderType() == 'SALES_ORDER')> <#assign backOrdered = cartLine.getQuantity() - mktgPkgATPMap.get(cartLine.getProductId())/> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/order/orderitems.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderitems.ftl?rev=981447&r1=981446&r2=981447&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/order/orderitems.ftl (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/order/orderitems.ftl Mon Aug 2 10:48:06 2010 @@ -137,7 +137,7 @@ under the License. ${qohQuantity} (${uiLabelMap.ProductAtp}: ${atpQuantity}) </td> </tr> - <#if (product != null) && (product.productTypeId != null) && Static["org.ofbiz.common.CommonWorkers"].hasParentType(delegator, "ProductType", "productTypeId", product.productTypeId, "parentTypeId", "MARKETING_PKG")> + <#if (product != null) && (product.productTypeId != null) && Static["org.ofbiz.entity.util.EntityTypeUtil"].hasParentType(delegator, "ProductType", "productTypeId", product.productTypeId, "parentTypeId", "MARKETING_PKG")> <tr> <td>${uiLabelMap.ProductMarketingPackageQOH}</td> <td style="padding-left: 15px; text-align: left;"> Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml?rev=981447&r1=981446&r2=981447&view=diff ============================================================================== --- ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml (original) +++ ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml Mon Aug 2 10:48:06 2010 @@ -684,7 +684,7 @@ under the License. <set field="quantityOnHandTotal" value="0" type="BigDecimal"/> <set from-field="parameters.productId" field="lookupMktgPkgParams.productId"/> <entity-one entity-name="Product" value-field="product"/> - <set field="isMarketingPkgAuto" value="${groovy: org.ofbiz.common.CommonWorkers.hasParentType(delegator, 'ProductType', 'productTypeId', product.productTypeId, 'parentTypeId', 'MARKETING_PKG_AUTO')}" type="Boolean"/> + <set field="isMarketingPkgAuto" value="${groovy: org.ofbiz.entity.util.EntityTypeUtil.hasParentType(delegator, 'ProductType', 'productTypeId', product.productTypeId, 'parentTypeId', 'MARKETING_PKG_AUTO')}" type="Boolean"/> <if-compare field="isMarketingPkgAuto" operator="equals" value="true" type="Boolean"> <set value="MANUF_COMPONENT" field="lookupMktgPkgParams.type"/> <else> Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml?rev=981447&r1=981446&r2=981447&view=diff ============================================================================== --- ofbiz/trunk/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml (original) +++ ofbiz/trunk/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml Mon Aug 2 10:48:06 2010 @@ -591,7 +591,7 @@ under the License. <set from-field="parameters.productId" field="callServiceMap.productId"/> <set from-field="productStore.inventoryFacilityId" field="callServiceMap.facilityId"/> - <set field="isMarketingPkg" value="${groovy: org.ofbiz.common.CommonWorkers.hasParentType(delegator, 'ProductType', 'productTypeId', product.productTypeId, 'parentTypeId', 'MARKETING_PKG')}" type="Boolean"/> + <set field="isMarketingPkg" value="${groovy: org.ofbiz.entity.util.EntityTypeUtil.hasParentType(delegator, 'ProductType', 'productTypeId', product.productTypeId, 'parentTypeId', 'MARKETING_PKG')}" type="Boolean"/> <if-compare field="isMarketingPkg" operator="equals" value="true" type="Boolean"> <call-service service-name="getMktgPackagesAvailable" in-map-name="callServiceMap"> <result-to-field result-name="availableToPromiseTotal"/> @@ -624,7 +624,7 @@ under the License. <!-- Right now the answer is yes, it only succeeds if one facility has sufficient inventory for the order. --> <set from-field="parameters.productId" field="callServiceMap.productId"/> <set from-field="productStoreFacility.facilityId" field="callServiceMap.facilityId"/> - <set field="isMarketingPkg" value="${groovy: org.ofbiz.common.CommonWorkers.hasParentType(delegator, 'ProductType', 'productTypeId', product.productTypeId, 'parentTypeId', 'MARKETING_PKG')}" type="Boolean"/> + <set field="isMarketingPkg" value="${groovy: org.ofbiz.entity.util.EntityTypeUtil.hasParentType(delegator, 'ProductType', 'productTypeId', product.productTypeId, 'parentTypeId', 'MARKETING_PKG')}" type="Boolean"/> <if-compare field="isMarketingPkg" operator="equals" value="true" type="Boolean"> <call-service service-name="getMktgPackagesAvailable" in-map-name="callServiceMap"> <result-to-field result-name="availableToPromiseTotal"/> Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java?rev=981447&r1=981446&r2=981447&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java Mon Aug 2 10:48:06 2010 @@ -34,7 +34,6 @@ import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilValidate; -import org.ofbiz.common.CommonWorkers; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; @@ -45,6 +44,7 @@ import org.ofbiz.entity.condition.Entity import org.ofbiz.entity.model.DynamicViewEntity; import org.ofbiz.entity.model.ModelKeyMap; import org.ofbiz.entity.util.EntityListIterator; +import org.ofbiz.entity.util.EntityTypeUtil; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; @@ -755,7 +755,7 @@ public class InventoryServices { // get both the real ATP/QOH available and the quantities available from marketing packages try { - if (CommonWorkers.hasParentType(delegator, "ProductType", "productTypeId", product.getString("productTypeId"), "parentTypeId", "MARKETING_PKG")) { + if (EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", product.getString("productTypeId"), "parentTypeId", "MARKETING_PKG")) { mktgPkgInvResult = dispatcher.runSync("getMktgPackagesAvailable", UtilMisc.toMap("productId", productId, "facilityId", facility.getString("facilityId"))); } invResult = dispatcher.runSync("getInventoryAvailableByFacility", UtilMisc.toMap("productId", productId, "facilityId", facility.getString("facilityId"))); @@ -772,7 +772,7 @@ public class InventoryServices { if (fatp != null) atp = atp.add(fatp); if (fqoh != null) qoh = qoh.add(fqoh); } - if (CommonWorkers.hasParentType(delegator, "ProductType", "productTypeId", product.getString("productTypeId"), "parentTypeId", "MARKETING_PKG") && !ServiceUtil.isError(mktgPkgInvResult)) { + if (EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", product.getString("productTypeId"), "parentTypeId", "MARKETING_PKG") && !ServiceUtil.isError(mktgPkgInvResult)) { BigDecimal fatp = (BigDecimal) mktgPkgInvResult.get("availableToPromiseTotal"); BigDecimal fqoh = (BigDecimal) mktgPkgInvResult.get("quantityOnHandTotal"); if (fatp != null) mktgPkgAtp = mktgPkgAtp.add(fatp); @@ -814,7 +814,7 @@ public class InventoryServices { // TODO Auto-generated catch block e.printStackTrace(); } - if (CommonWorkers.hasParentType(delegator, "ProductType", "productTypeId", product.getString("productTypeId"), "parentTypeId", "MARKETING_PKG")) { + if (EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", product.getString("productTypeId"), "parentTypeId", "MARKETING_PKG")) { try { resultOutput = dispatcher.runSync("getMktgPackagesAvailable", contextInput); } catch (GenericServiceException e) { Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductInventoryItems.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductInventoryItems.groovy?rev=981447&r1=981446&r2=981447&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductInventoryItems.groovy (original) +++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductInventoryItems.groovy Mon Aug 2 10:48:06 2010 @@ -17,12 +17,12 @@ * under the License. */ -import org.ofbiz.common.CommonWorkers import org.ofbiz.entity.condition.* +import org.ofbiz.entity.util.EntityTypeUtil import org.ofbiz.product.inventory.InventoryWorker if (product) { - boolean isMarketingPackage = CommonWorkers.hasParentType(delegator, "ProductType", "productTypeId", product.productTypeId, "parentTypeId", "MARKETING_PKG"); + boolean isMarketingPackage = EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", product.productTypeId, "parentTypeId", "MARKETING_PKG"); context.isMarketingPackage = (isMarketingPackage? "true": "false"); //If product is virtual gather summary data from variants if (product.isVirtual && "Y".equals(product.isVirtual)) { Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackingSlip.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackingSlip.groovy?rev=981447&r1=981446&r2=981447&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackingSlip.groovy (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackingSlip.groovy Mon Aug 2 10:48:06 2010 @@ -20,8 +20,8 @@ // This script gets shipment items grouped by package for use in the packing slip PDF or any screens that require by-package layout import org.ofbiz.base.util.*; -import org.ofbiz.common.CommonWorkers; import org.ofbiz.entity.condition.*; +import org.ofbiz.entity.util.EntityTypeUtil // Since this script is run after ViewShipment, we will re-use the shipment in the context shipment = context.shipment; @@ -111,15 +111,15 @@ shipmentPackages.each { shipmentPackage line.product = product; line.quantityRequested = quantityRequestedByProduct.get(product.productId); line.quantityInPackage = content.quantity; - if (CommonWorkers.hasParentType(delegator, "ProductType", "productTypeId", productTypeId, "parentTypeId", "MARKETING_PKG_PICK") && line.quantityInPackage > line.quantityRequested) { + if (EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", productTypeId, "parentTypeId", "MARKETING_PKG_PICK") && line.quantityInPackage > line.quantityRequested) { line.quantityInPackage = line.quantityRequested; } line.quantityInShipment = quantityInShipmentByProduct.get(product.productId); - if (CommonWorkers.hasParentType(delegator, "ProductType", "productTypeId", productTypeId, "parentTypeId", "MARKETING_PKG_PICK") && line.quantityInShipment > line.quantityRequested) { + if (EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", productTypeId, "parentTypeId", "MARKETING_PKG_PICK") && line.quantityInShipment > line.quantityRequested) { line.quantityInShipment = line.quantityRequested; } line.quantityShipped = quantityShippedByProduct.get(product.productId); - if (CommonWorkers.hasParentType(delegator, "ProductType", "productTypeId", productTypeId, "parentTypeId", "MARKETING_PKG_PICK") && line.quantityShipped > line.quantityRequested) { + if (EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", productTypeId, "parentTypeId", "MARKETING_PKG_PICK") && line.quantityShipped > line.quantityRequested) { line.quantityShipped = line.quantityRequested; } lines.add(line); |
Free forum by Nabble | Edit this page |