Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductFeatures.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductFeatures.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductFeatures.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductFeatures.groovy Mon Jan 5 08:50:30 2015 @@ -19,14 +19,12 @@ import org.ofbiz.entity.condition.*; -context.productFeatureAndAppls = delegator.findList('ProductFeatureAndAppl', - EntityCondition.makeCondition([productId : productId]), null, - ['sequenceNum', 'productFeatureApplTypeId', 'productFeatureTypeId', 'description'], null, false); +context.productFeatureAndAppls = from("ProductFeatureAndAppl").where("productId", productId).orderBy("sequenceNum", "productFeatureApplTypeId", "productFeatureTypeId", "description").queryList(); -context.productFeatureCategories = delegator.findList('ProductFeatureCategory', null, null, ['description'], null, false); +context.productFeatureCategories = from("ProductFeatureCategory").orderBy("description").queryList(); -context.productFeatureApplTypes = delegator.findList('ProductFeatureApplType', null, null, ['description'], null, true); +context.productFeatureApplTypes = from("ProductFeatureApplType").orderBy("description").cache(true).queryList(); -context.productFeatureGroups = delegator.findList('ProductFeatureGroup', null, null, ['description'], null, false); +context.productFeatureGroups = from("ProductFeatureGroup").orderBy("description").queryList(); -context.productFeatureTypes = delegator.findList('ProductFeatureType', null, null, ['description'], null, true); +context.productFeatureTypes = from("ProductFeatureType").orderBy("description").queryList(); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductInventoryItems.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductInventoryItems.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductInventoryItems.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductInventoryItems.groovy Mon Jan 5 08:50:30 2015 @@ -27,11 +27,11 @@ if (product) { //If product is virtual gather summary data from variants if (product.isVirtual && "Y".equals(product.isVirtual)) { //Get the virtual product feature types - result = dispatcher.runSync("getProductFeaturesByType", [productId : productId, productFeatureApplTypeId : 'SELECTABLE_FEATURE']); + result = runService('getProductFeaturesByType', [productId : productId, productFeatureApplTypeId : 'SELECTABLE_FEATURE']); featureTypeIds = result.productFeatureTypes; //Get the variants - result = dispatcher.runSync("getAllProductVariants", [productId : productId]); + result = runService('getAllProductVariants', [productId : productId]); variants = result.assocProducts; variantIterator = variants.iterator(); variantInventorySummaries = []; @@ -39,7 +39,7 @@ if (product) { variant = variantIterator.next(); //create a map of each variant id and inventory summary (all facilities) - inventoryAvailable = dispatcher.runSync("getProductInventoryAvailable", [productId : variant.productIdTo]); + inventoryAvailable = runService('getProductInventoryAvailable', [productId : variant.productIdTo]); variantInventorySummary = [productId : variant.productIdTo, availableToPromiseTotal : inventoryAvailable.availableToPromiseTotal, @@ -49,7 +49,7 @@ if (product) { featureTypeIdsIterator = featureTypeIds.iterator(); while (featureTypeIdsIterator) { featureTypeId = featureTypeIdsIterator.next(); - result = dispatcher.runSync("getProductFeatures", [productId : variant.productIdTo, type : 'STANDARD_FEATURE', distinct : featureTypeId]); + result = runService('getProductFeatures', [productId : variant.productIdTo, type : 'STANDARD_FEATURE', distinct : featureTypeId]); variantFeatures = result.productFeatures; if (variantFeatures) { //there should only be one result in this collection @@ -67,9 +67,9 @@ if (product) { // The warehouse list is selected showAllFacilities = parameters.showAllFacilities; if (showAllFacilities && "Y".equals(showAllFacilities)) { - facilityList = delegator.findList("Facility", null, null, null, null, false); + facilityList = from("Facility").queryList(); } else { - facilityList = delegator.findList("ProductFacility", EntityCondition.makeCondition("productId", EntityOperator.EQUALS, productId), null, null, null, false); + facilityList = from("ProductFacility").where("productId", productId).queryList(); } facilityIterator = facilityList.iterator(); dispatcher = request.getAttribute("dispatcher"); @@ -80,7 +80,7 @@ if (product) { // are obtained (calling the "getInventoryAvailableByFacility" service) while (facilityIterator) { facility = facilityIterator.next(); - resultOutput = dispatcher.runSync("getInventoryAvailableByFacility", [productId : productId, facilityId : facility.facilityId]); + resultOutput = runService('getInventoryAvailableByFacility', [productId : productId, facilityId : facility.facilityId]); quantitySummary = [:]; quantitySummary.facilityId = facility.facilityId; @@ -89,7 +89,7 @@ if (product) { // if the product is a MARKETING_PKG_AUTO/PICK, then also get the quantity which can be produced from components if (isMarketingPackage) { - resultOutput = dispatcher.runSync("getMktgPackagesAvailable", [productId : productId, facilityId : facility.facilityId]); + resultOutput = runService('getMktgPackagesAvailable', [productId : productId, facilityId : facility.facilityId]); quantitySummary.mktgPkgQOH = resultOutput.quantityOnHandTotal; quantitySummary.mktgPkgATP = resultOutput.availableToPromiseTotal; } @@ -97,9 +97,7 @@ if (product) { quantitySummaryByFacility.put(facility.facilityId, quantitySummary); } - productInventoryItems = delegator.findByAnd("InventoryItem", - [productId : productId], - ['facilityId', '-datetimeReceived', '-inventoryItemId'], false); + productInventoryItems = from("InventoryItem").where("productId", productId).orderBy("facilityId", "-datetimeReceived", "-inventoryItemId").queryList(); // TODO: get all incoming shipments not yet arrived coming into each facility that this product is in, use a view entity with ShipmentAndItem findIncomingShipmentsConds = []; @@ -119,7 +117,7 @@ if (product) { findIncomingShipmentsConds.add(EntityCondition.makeCondition(findIncomingShipmentsStatusConds, EntityOperator.AND)); findIncomingShipmentsStatusCondition = EntityCondition.makeCondition(findIncomingShipmentsConds, EntityOperator.AND); - incomingShipmentAndItems = delegator.findList("ShipmentAndItem", findIncomingShipmentsStatusCondition, null, ['-estimatedArrivalDate'], null, false); + incomingShipmentAndItems = from("ShipmentAndItem").where(findIncomingShipmentsStatusCondition).orderBy("-estimatedArrivalDate").queryList(); incomingShipmentAndItemIter = incomingShipmentAndItems.iterator(); while (incomingShipmentAndItemIter) { incomingShipmentAndItem = incomingShipmentAndItemIter.next(); @@ -143,7 +141,7 @@ if (product) { // -------------------- // Production Runs - resultOutput = dispatcher.runSync("getProductManufacturingSummaryByFacility", + resultOutput = runService('getProductManufacturingSummaryByFacility', [productId : productId, userLogin : userLogin]); // incoming products manufacturingInQuantitySummaryByFacility = resultOutput.summaryInByFacility; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductQuickAdmin.groovy Mon Jan 5 08:50:30 2015 @@ -26,9 +26,9 @@ import org.ofbiz.entity.util.EntityUtilP context.nowTimestampString = UtilDateTime.nowTimestamp().toString(); -context.assocTypes = delegator.findList("ProductAssocType", null, null, null, null, false); +context.assocTypes = from("ProductAssocType").queryList(); -context.featureTypes = delegator.findList("ProductFeatureType", null, null, null, null, false); +context.featureTypes = from("ProductFeatureType").queryList(); // add/remove feature types addedFeatureTypes = (HashMap) session.getAttribute("addedFeatureTypes"); @@ -47,7 +47,7 @@ if (addFeatureTypeId) { addFeatureTypeIdIter = addFeatureTypeIdList.iterator(); while (addFeatureTypeIdIter) { String curFeatureTypeId = addFeatureTypeIdIter.next(); - GenericValue featureType = delegator.findOne("ProductFeatureType", [productFeatureTypeId : curFeatureTypeId], false); + GenericValue featureType = from("ProductFeatureType").where("productFeatureTypeId", curFeatureTypeId).queryOne(); if ((featureType) && !addedFeatureTypes.containsKey(curFeatureTypeId)) { addedFeatureTypes.put(curFeatureTypeId, featureType); } @@ -56,7 +56,7 @@ while (addFeatureTypeIdIter) { String[] removeFeatureTypeId = request.getParameterValues("removeFeatureTypeId"); if (removeFeatureTypeId) { for (int i = 0; i < removeFeatureTypeId.length; i++) { - GenericValue featureType = delegator.findOne("ProductFeatureType", [productFeatureTypeId : addFeatureTypeId[i]], false); + GenericValue featureType = from("ProductFeatureType").where("productFeatureTypeId", addFeatureTypeId[i]).queryOne(); if ((featureType) && addedFeatureTypes.containsKey(removeFeatureTypeId[i])) { addedFeatureTypes.remove(removeFeatureTypeId[i]); featuresByType.remove(removeFeatureTypeId[i]); @@ -84,7 +84,7 @@ if (productId) { context.productId = productId; } -product = delegator.findOne("Product", [productId : productId], false); +product = from("Product").where("productId", productId).queryOne(); assocProducts = []; featureFloz = [:]; featureMl = [:]; @@ -108,9 +108,8 @@ if (product) { context.product = product; // get categories - allCategories = delegator.findList("ProductCategory", - EntityCondition.makeCondition(EntityCondition.makeCondition("showInSelect", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("showInSelect", EntityOperator.NOT_EQUAL, "N")), - null, ['description'], null, false); + allCategories = from("ProductCategory").where(EntityCondition.makeCondition(EntityCondition.makeCondition("showInSelect", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("showInSelect", EntityOperator.NOT_EQUAL, "N"))) + .orderBy("description").queryList(); categoryMembers = product.getRelated("ProductCategoryMember", null, null, false); categoryMembers = EntityUtil.filterByDate(categoryMembers); @@ -308,7 +307,7 @@ String allCategoryId = EntityUtilPropert context.allCategoryId = allCategoryId; // show the publish or unpublish section -prodCatMembs = delegator.findList("ProductCategoryMember", EntityCondition.makeCondition([productCategoryId : allCategoryId, productId : productId]), null, null, null, false); +prodCatMembs = from("ProductCategoryMember").where("productCategoryId", allCategoryId, "productId", productId).queryList(); //don't filter by date, show all categories: prodCatMembs = EntityUtil.filterByDate(prodCatMembs); String showPublish = "false"; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductSEO.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductSEO.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductSEO.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/EditProductSEO.groovy Mon Jan 5 08:50:30 2015 @@ -19,21 +19,21 @@ productId = parameters.productId; if (productId) { - productContents = delegator.findByAnd("ProductContent", ["productId" : productId], null, false); + productContents = from("ProductContent").where("productId", productId).queryList(); productContents.each{ productContent-> if (productContent.productContentTypeId == "PAGE_TITLE") { - contentTitle = delegator.findOne("Content", ["contentId" : productContent.contentId], false); - dataTextTitle = delegator.findOne("ElectronicText", ["dataResourceId" : contentTitle.dataResourceId], false); + contentTitle = from("Content").where("contentId", productContent.contentId).queryOne(); + dataTextTitle = from("ElectronicText").where("dataResourceId", contentTitle.dataResourceId).queryOne(); context.title = dataTextTitle.textData; } if (productContent.productContentTypeId == "META_KEYWORD") { - contentMetaKeyword = delegator.findOne("Content", ["contentId" : productContent.contentId], false); - dataTextMetaKeyword = delegator.findOne("ElectronicText", ["dataResourceId" : contentMetaKeyword.dataResourceId], false); + contentMetaKeyword = from("Content").where("contentId", productContent.contentId).queryOne(); + dataTextMetaKeyword = from("ElectronicText").where("dataResourceId", contentMetaKeyword.dataResourceId).queryOne(); context.metaKeyword = dataTextMetaKeyword.textData; } if (productContent.productContentTypeId == "META_DESCRIPTION") { - contentMetaDescription = delegator.findOne("Content", ["contentId" : productContent.contentId], false); - dataTextMetaDescription = delegator.findOne("ElectronicText", ["dataResourceId" : contentMetaDescription.dataResourceId], false); + contentMetaDescription = from("Content").where("contentId", productContent.contentId).queryOne(); + dataTextMetaDescription = from("ElectronicText").where("dataResourceId", contentMetaDescription.dataResourceId).queryOne(); context.metaDescription = dataTextMetaDescription.textData; } } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/product/QuickAddVariants.groovy Mon Jan 5 08:50:30 2015 @@ -17,8 +17,8 @@ * under the License. */ -result = dispatcher.runSync("getProductFeaturesByType", [productId : productId, productFeatureApplTypeId : 'SELECTABLE_FEATURE']); +result = runService('getProductFeaturesByType', [productId : productId, productFeatureApplTypeId : 'SELECTABLE_FEATURE']); context.featureTypes = result.productFeatureTypes; -result = dispatcher.runSync("getVariantCombinations", [productId : productId]); +result = runService('getVariantCombinations', [productId : productId]); context.featureCombinationInfos = result.featureCombinations; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/promo/EditProductPromoCode.groovy Mon Jan 5 08:50:30 2015 @@ -21,7 +21,7 @@ productPromoCodeId = request.getParamete if (!productPromoCodeId) { productPromoCodeId = request.getAttribute("productPromoCodeId"); } -productPromoCode = delegator.findOne("ProductPromoCode", [productPromoCodeId : productPromoCodeId], false); +productPromoCode = from("ProductPromoCode").where("productPromoCodeId", productPromoCodeId).queryOne(); productPromoId = null; if (productPromoCode) { @@ -32,7 +32,7 @@ if (productPromoCode) { productPromo = null; if (productPromoId) { - productPromo = delegator.findOne("ProductPromo", [productPromoId : productPromoId], false); + productPromo = from("ProductPromo").where("productPromoId", productPromoId).queryOne(); } productPromoCodeEmails = null; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStorePaySetup.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStorePaySetup.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStorePaySetup.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStorePaySetup.groovy Mon Jan 5 08:50:30 2015 @@ -83,5 +83,5 @@ if (!paymentMethodTypeId || !paymentServ if (paymentServiceTypeEnumId == "PRDS_PAY_EXTERNAL") { context.paymentCustomMethods = null; } else { - context.paymentCustomMethods = delegator.findList("CustomMethod", customMethodsCond, null, ["description"], null, false); + context.paymentCustomMethods = from("CustomMethod").where(customMethodsCond).orderBy("description").queryList(); } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreSurveys.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreSurveys.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreSurveys.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/store/EditProductStoreSurveys.groovy Mon Jan 5 08:50:30 2015 @@ -25,17 +25,17 @@ context.hasPermission = security.hasEnti productStoreId = request.getParameter("productStoreId"); if (productStoreId) { - productStore = delegator.findOne("ProductStore", [productStoreId : productStoreId], false); + productStore = from("ProductStore").where("productStoreId", productStoreId).queryOne(); context.productStoreId = productStoreId; context.productStore = productStore; } -context.productStoreSurveys = EntityUtil.filterByDate(delegator.findList("ProductStoreSurveyAppl", EntityCondition.makeCondition([productStoreId : productStoreId]), null, null, null, false)); +context.productStoreSurveys = from("ProductStoreSurveyAppl").where("productStoreId", productStoreId).filterByDate().queryList(); -context.surveys = delegator.findList("Survey", null, null, ['description'], null, false); +context.surveys = from("Survey").orderBy("description").queryOne(); -context.surveyApplTypes = delegator.findList("SurveyApplType", null, null, ['description'], null, false); +context.surveyApplTypes = from("SurveyApplType").orderBy("description").queryFirst(); -context.productCategories = delegator.findList("ProductCategory", null, null, ['description'], null, false); +context.productCategories = from("ProductCategory").orderBy("description").queryList(); context.nowTimestampString = UtilDateTime.nowTimestamp().toString(); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/thesaurus/EditKeywordThesaurus.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/thesaurus/EditKeywordThesaurus.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/thesaurus/EditKeywordThesaurus.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/catalog/WEB-INF/actions/thesaurus/EditKeywordThesaurus.groovy Mon Jan 5 08:50:30 2015 @@ -19,9 +19,9 @@ import org.ofbiz.entity.condition.* -relationshipEnums = delegator.findList("Enumeration", EntityCondition.makeCondition([enumTypeId : 'KW_THES_REL']), null, ['sequenceId'], null, true); +relationshipEnums = from("Enumeration").where("enumTypeId", "KW_THES_REL").orderBy("sequenceId").cache(true).queryList(); -keywordThesauruses = delegator.findList("KeywordThesaurus", null, null, ['enteredKeyword'], null, false); +keywordThesauruses = from("KeywordThesaurus").orderBy("enteredKeyword").queryList(); //if no param sent in make firstLetter 'a' else use firstLetter passed in firstLetterString = request.getParameter("firstLetter"); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/ComputeProductSellThroughData.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/ComputeProductSellThroughData.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/ComputeProductSellThroughData.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/ComputeProductSellThroughData.groovy Mon Jan 5 08:50:30 2015 @@ -28,9 +28,9 @@ if (parameters.fromDateSellThrough) { fromDate = Timestamp.valueOf(parameters.fromDateSellThrough); thruDate = Timestamp.valueOf(parameters.thruDateSellThrough); } catch(Exception e) {} - inventoryCountResult = dispatcher.runSync("countProductInventoryOnHand", [productId : productId, facilityId : facilityId, inventoryCountDate : fromDate, userLogin : userLogin]); + inventoryCountResult = runService('countProductInventoryOnHand', [productId : productId, facilityId : facilityId, inventoryCountDate : fromDate, userLogin : userLogin]); if (inventoryCountResult.quantityOnHandTotal && inventoryCountResult.quantityOnHandTotal > 0) { - inventoryShippedForSalesResult = dispatcher.runSync("countProductInventoryShippedForSales", [productId : productId, facilityId : facilityId, fromDate : fromDate, thruDate : thruDate, userLogin : userLogin]); + inventoryShippedForSalesResult = runService('countProductInventoryShippedForSales', [productId : productId, facilityId : facilityId, fromDate : fromDate, thruDate : thruDate, userLogin : userLogin]); context.sellThroughInitialInventory = inventoryCountResult.quantityOnHandTotal; context.sellThroughInventorySold = inventoryShippedForSalesResult.quantityOnHandTotal; context.sellThroughPercentage = new BigDecimal(inventoryShippedForSalesResult.quantityOnHandTotal / inventoryCountResult.quantityOnHandTotal * 100, new java.math.MathContext(2)); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/CountFacilityInventoryByProduct.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/CountFacilityInventoryByProduct.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/CountFacilityInventoryByProduct.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/CountFacilityInventoryByProduct.groovy Mon Jan 5 08:50:30 2015 @@ -125,7 +125,6 @@ if (action) { } // set distinct on so we only get one row per product - findOpts = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true); searchCondition = EntityCondition.makeCondition(conditionMap, EntityOperator.AND); notVirtualCondition = EntityCondition.makeCondition(EntityCondition.makeCondition("isVirtual", EntityOperator.EQUALS, null), EntityOperator.OR, @@ -223,8 +222,7 @@ if (action) { // get the indexes for the partial list lowIndex = ((viewIndex.intValue() * viewSize.intValue()) + 1); highIndex = (viewIndex.intValue() + 1) * viewSize.intValue(); - findOpts.setMaxRows(highIndex); - prodsEli = delegator.findListIteratorByCondition(prodView, whereCondition, null, null, orderBy, findOpts); + prodsEli = from(prodView).where(whereCondition).orderBy(orderBy).cursorScrollInsensitive().maxRows(highIndex).distinct().queryIterator(); // get the partial list for this page prods = prodsEli.getPartialList(lowIndex, highIndex); @@ -259,15 +257,13 @@ if (action) { if (checkTime) { // Make a query against the sales usage view entity - salesUsageIt = delegator.findListIteratorByCondition(salesUsageViewEntity, - EntityCondition.makeCondition( - [EntityCondition.makeCondition("facilityId", EntityOperator.EQUALS, facilityId), - EntityCondition.makeCondition("productId", EntityOperator.EQUALS, oneProd.productId), - EntityCondition.makeCondition("statusId", EntityOperator.IN, ['ORDER_COMPLETED', 'ORDER_APPROVED', 'ORDER_HELD']), - EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, "SALES_ORDER"), - EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, checkTime) - ], - EntityOperator.AND), null, null, null, null); + salesUsageIt = from(salesUsageViewEntity) + .where(EntityCondition.makeCondition("facilityId", EntityOperator.EQUALS, facilityId), + EntityCondition.makeCondition("productId", EntityOperator.EQUALS, oneProd.productId), + EntityCondition.makeCondition("statusId", EntityOperator.IN, ['ORDER_COMPLETED', 'ORDER_APPROVED', 'ORDER_HELD']), + EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, "SALES_ORDER"), + EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, checkTime)) + .queryIterator(); // Sum the sales usage quantities found salesUsageQuantity = 0; @@ -283,14 +279,12 @@ if (action) { salesUsageIt.close(); // Make a query against the production usage view entity - productionUsageIt = delegator.findListIteratorByCondition(productionUsageViewEntity, - EntityCondition.makeCondition( - [EntityCondition.makeCondition("facilityId", EntityOperator.EQUALS, facilityId), - EntityCondition.makeCondition("productId", EntityOperator.EQUALS, oneProd.productId), - EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "PROD_ORDER_TASK"), - EntityCondition.makeCondition("actualCompletionDate", EntityOperator.GREATER_THAN_EQUAL_TO, checkTime) - ], - EntityOperator.AND), null, null, null, null); + productionUsageIt = from(productionUsageViewEntity) + .where(EntityCondition.makeCondition("facilityId", EntityOperator.EQUALS, facilityId), + EntityCondition.makeCondition("productId", EntityOperator.EQUALS, oneProd.productId), + EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "PROD_ORDER_TASK"), + EntityCondition.makeCondition("actualCompletionDate", EntityOperator.GREATER_THAN_EQUAL_TO, checkTime)) + .queryIterator(); // Sum the production usage quantities found productionUsageQuantity = 0; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/EditContactMech.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/EditContactMech.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/EditContactMech.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/EditContactMech.groovy Mon Jan 5 08:50:30 2015 @@ -22,7 +22,7 @@ import org.ofbiz.party.contact.*; facilityId = parameters.facilityId; context.facilityId = facilityId; -facility = delegator.findOne("Facility", [facilityId : facilityId], false); +facility = from("Facility").where("facilityId", facilityId).queryOne(); context.facility = facility; mechMap = [:]; @@ -62,7 +62,7 @@ if (!cmNewPurposeTypeId) { } if (cmNewPurposeTypeId) { context.contactMechPurposeTypeId = cmNewPurposeTypeId; - contactMechPurposeType = delegator.findOne("ContactMechPurposeType", [contactMechPurposeTypeId : cmNewPurposeTypeId], false); + contactMechPurposeType = from("ContactMechPurposeType").where("contactMechPurposeTypeId", cmNewPurposeTypeId).queryOne(); if (contactMechPurposeType) { context.contactMechPurposeType = contactMechPurposeType; } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/EditFacility.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/EditFacility.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/EditFacility.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/EditFacility.groovy Mon Jan 5 08:50:30 2015 @@ -23,7 +23,7 @@ facilityId = parameters.facilityId; if (!facilityId && request.getAttribute("facilityId")) { facilityId = request.getAttribute("facilityId"); } -facility = delegator.findOne("Facility", [facilityId : facilityId], false); +facility = from("Facility").where("facilityId", facilityId).queryOne(); if (!facility) { facility = delegator.makeValue("Facility"); facilityType = delegator.makeValue("FacilityType"); @@ -35,16 +35,16 @@ context.facilityType = facilityType; context.facilityId = facilityId; //Facility types -facilityTypes = delegator.findList("FacilityType", null, null, null, null, false); +facilityTypes = from("FacilityType").queryList(); if (facilityTypes) { context.facilityTypes = facilityTypes; } // all possible inventory item types -context.inventoryItemTypes = delegator.findList("InventoryItemType", null, null, ['description'], null, true); +context.inventoryItemTypes = from("InventoryItemType").orderBy("description").cache(true).queryList(); // weight unit of measures -context.weightUomList = delegator.findList("Uom", EntityCondition.makeCondition([uomTypeId : 'WEIGHT_MEASURE']), null, null, null, true); +context.weightUomList = from("Uom").where("uomTypeId", "WEIGHT_MEASURE").cache(true).queryList(); // area unit of measures -context.areaUomList = delegator.findList("Uom", EntityCondition.makeCondition([uomTypeId : 'AREA_MEASURE']), null, null, null, true); +context.areaUomList = from("Uom").where("uomTypeId", "AREA_MEASURE").cache(true).queryList(); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/EditFacilityLocation.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/EditFacilityLocation.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/EditFacilityLocation.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/EditFacilityLocation.groovy Mon Jan 5 08:50:30 2015 @@ -33,13 +33,13 @@ if (!locationSeqId && request.getAttribu } if (facilityId && locationSeqId) { - facilityLocation = delegator.findOne("FacilityLocation", [facilityId : facilityId, locationSeqId : locationSeqId], false); + facilityLocation = from("FacilityLocation").where("facilityId", facilityId, "locationSeqId", locationSeqId).queryOne(); } if (facilityId) { - facility = delegator.findOne("Facility", [facilityId : facilityId], false); + facility = from("Facility").where("facilityId", facilityId).queryOne(); } -locationTypeEnums = delegator.findList("Enumeration", EntityCondition.makeCondition([enumTypeId : 'FACLOC_TYPE']), null, null, null, false); +locationTypeEnums = from("Enumeration").where("enumTypeId", "FACLOC_TYPE").queryList(); // ProductFacilityLocation stuff productFacilityLocations = null; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FacilityLocationGeoLocation.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FacilityLocationGeoLocation.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FacilityLocationGeoLocation.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FacilityLocationGeoLocation.groovy Mon Jan 5 08:50:30 2015 @@ -42,7 +42,7 @@ if (facilityId && locationSeqId) { context.geoChart = geoChart; } if (latestGeoPoint && latestGeoPoint.elevationUomId) { - elevationUom = delegator.findOne("Uom", [uomId : latestGeoPoint.elevationUomId], false); + elevationUom = from("Uom").where("uomId", latestGeoPoint.elevationUomId).queryOne(); context.elevationUomAbbr = elevationUom.abbreviation; } } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FindFacility.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FindFacility.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FindFacility.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FindFacility.groovy Mon Jan 5 08:50:30 2015 @@ -18,7 +18,7 @@ */ import org.ofbiz.base.util.* -findResult = delegator.findList("Facility", null, null, null, null, false); +findResult = from("Facility").queryList(); findResultSize = findResult.size(); if (findResultSize == 1) { context.showScreen = "one"; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FindFacilityLocation.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FindFacilityLocation.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FindFacilityLocation.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FindFacilityLocation.groovy Mon Jan 5 08:50:30 2015 @@ -32,7 +32,7 @@ if (itemId) { itemId = session.getAttribute("inventoryItemId"); context.itemId = itemId; -facility = delegator.findOne("Facility", [facilityId : facilityId], false); +facility = from("Facility").where("facilityId", facilityId).queryOne(); context.facility = facility; UtilHttp.parametersToAttributes(request); @@ -46,7 +46,7 @@ if (lookup) { paramMap.remove(key); } } - foundLocations = delegator.findList("FacilityLocation", EntityCondition.makeCondition(paramMap), null, null, null, false); + foundLocations = from("FacilityLocation").where(paramMap).queryList(); if (foundLocations) { context.foundLocations = foundLocations; } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FindFacilityTransfers.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FindFacilityTransfers.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FindFacilityTransfers.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FindFacilityTransfers.groovy Mon Jan 5 08:50:30 2015 @@ -39,8 +39,7 @@ if (completeRequested) { exprsTo = [EntityCondition.makeCondition("facilityIdTo", EntityOperator.EQUALS, facilityId), EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "IXF_REQUESTED")]; } -ecl = EntityCondition.makeCondition(exprsTo, EntityOperator.AND); -toTransfers = delegator.findList("InventoryTransfer", ecl, null, ['sendDate'], null, false); +toTransfers = from("InventoryTransfer").where(exprsTo).orderBy("sendDate").queryList(); if (toTransfers) { context.toTransfers = toTransfers; } @@ -58,7 +57,7 @@ if (completeRequested) { EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "IXF_REQUESTED")]; } ecl = EntityCondition.makeCondition(exprsFrom, EntityOperator.AND); -fromTransfers = delegator.findList("InventoryTransfer", ecl, null, ['sendDate'], null, false); +fromTransfers = from("InventoryTransfer").where(exprsFrom).orderBy("sendDate").queryList(); if (fromTransfers) { context.fromTransfers = fromTransfers; } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FindInventoryItemsByLabels.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FindInventoryItemsByLabels.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FindInventoryItemsByLabels.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/FindInventoryItemsByLabels.groovy Mon Jan 5 08:50:30 2015 @@ -62,10 +62,8 @@ if (andCondition.size() > 1) { lowIndex = ((viewIndex * viewSize) + 1); highIndex = (viewIndex - 1) * viewSize; - findOpts = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true); - findOpts.setMaxRows(highIndex); beganTransaction = TransactionUtil.begin(); - inventoryItemsEli = delegator.findListIteratorByCondition(inventoryItemAndLabelsView, EntityCondition.makeCondition(andCondition, EntityOperator.AND), null, null, null, findOpts); + inventoryItemsEli = from(inventoryItemAndLabelsView).where(andCondition).cursorScrollInsensitive().distinct().maxRows(highIndex).queryIterator(); inventoryItemsSize = inventoryItemsEli.getResultsSizeAfterPartialList(); context.inventoryItemsSize = inventoryItemsSize; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/ViewContactMechs.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/ViewContactMechs.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/ViewContactMechs.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/ViewContactMechs.groovy Mon Jan 5 08:50:30 2015 @@ -23,7 +23,7 @@ import org.ofbiz.party.contact.* context.nowStr = UtilDateTime.nowTimestamp(); facilityId = parameters.facilityId; -facility = delegator.findOne("Facility", [facilityId : facilityId], false); +facility = from("Facility").where("facilityId", facilityId).queryOne(); facilityType = null; if (!facility) { context.facility = delegator.makeValue("Facility", null); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy Mon Jan 5 08:50:30 2015 @@ -92,7 +92,6 @@ if (action) { } // set distinct on so we only get one row per product - findOpts = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true); searchCondition = EntityCondition.makeCondition(conditionMap, EntityOperator.AND); notVirtualCondition = EntityCondition.makeCondition(EntityCondition.makeCondition("isVirtual", EntityOperator.EQUALS, null), EntityOperator.OR, @@ -128,7 +127,7 @@ if (action) { List prods = null; try { beganTransaction = TransactionUtil.begin(); - prodsEli = delegator.findListIteratorByCondition(prodView, whereCondition, null, null, ['productId'], findOpts); + prodsEli = from(prodView).where(whereCondition).orderBy("productId").cursorScrollInsensitive().distinct().queryIterator(); prods = prodsEli.getCompleteList(); prodsEli.close(); } catch (GenericEntityException e) { @@ -173,7 +172,7 @@ if (action) { oneInventory.reorderQuantity = oneProd.reorderQuantity; oneInventory.daysToShip = oneProd.daysToShip; - resultMap = dispatcher.runSync("getProductInventoryAndFacilitySummary", [productId : oneProd.productId, minimumStock : minimumStock, facilityId : oneProd.facilityId, checkTime : checkTime, statusId : statusId]); + resultMap =runService('getProductInventoryAndFacilitySummary', [productId : oneProd.productId, minimumStock : minimumStock, facilityId : oneProd.facilityId, checkTime : checkTime, statusId : statusId]); if (resultMap) { oneInventory.totalAvailableToPromise = resultMap.totalAvailableToPromise; oneInventory.totalQuantityOnHand = resultMap.totalQuantityOnHand; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/FindFacilityPhysicalInventory.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/FindFacilityPhysicalInventory.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/FindFacilityPhysicalInventory.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/FindFacilityPhysicalInventory.groovy Mon Jan 5 08:50:30 2015 @@ -38,8 +38,7 @@ if (internalName) { } if (conditions.size() > 2) { - ecl = EntityCondition.makeCondition(conditions, EntityOperator.AND); - physicalInventory = delegator.findList("ProductInventoryItem", ecl, null, ['productId'], null, false); + physicalInventory = from("ProductInventoryItem").where(conditions).orderBy("productId").queryList(); // also need the overal product QOH and ATP for each product atpMap = [:]; @@ -53,7 +52,7 @@ if (conditions.size() > 2) { // for each product, call the inventory counting service productIds.each { productId -> - result = dispatcher.runSync("getInventoryAvailableByFacility", [facilityId : facilityId, productId : productId]); + result = runService('getInventoryAvailableByFacility', [facilityId : facilityId, productId : productId]); if (!ServiceUtil.isError(result)) { atpMap.put(productId, result.availableToPromiseTotal); qohMap.put(productId, result.quantityOnHandTotal); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/InventoryAverageCosts.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/InventoryAverageCosts.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/InventoryAverageCosts.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/InventoryAverageCosts.groovy Mon Jan 5 08:50:30 2015 @@ -28,14 +28,14 @@ import org.ofbiz.entity.util.EntityUtil; facilityId = context.get("facilityId"); EntityCondition whereConditions = EntityCondition.makeCondition("facilityId", EntityOperator.EQUALS, facilityId); -inventoryItems = delegator.findList("InventoryItem", whereConditions, UtilMisc.toSet("productId"), UtilMisc.toList("productId"), null, false); +inventoryItems = select("productId").from("InventoryItem").where("facilityId", facilityId).orderBy("productId").queryList(); inventoryItemProducts = EntityUtil.getFieldListFromEntityList(inventoryItems, "productId", true); inventoryAverageCosts = FastList.newInstance(); inventoryItemProducts.each { productId -> - productFacility = delegator.findOne("ProductFacility", UtilMisc.toMap("productId", productId, "facilityId", facilityId), false); + productFacility = from("ProductFacility").where("productId", productId, "facilityId", facilityId).queryOne(); if (UtilValidate.isNotEmpty(productFacility)) { - result = dispatcher.runSync("calculateProductAverageCost", UtilMisc.toMap("productId", productId, "facilityId", facilityId, "userLogin", userLogin)); + result = runService('calculateProductAverageCost', UtilMisc.toMap("productId": productId, "facilityId": facilityId, "userLogin": userLogin)); totalQuantityOnHand = result.get("totalQuantityOnHand"); totalInventoryCost = result.get("totalInventoryCost"); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/InventoryItemTotals.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/InventoryItemTotals.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/InventoryItemTotals.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/InventoryItemTotals.groovy Mon Jan 5 08:50:30 2015 @@ -37,11 +37,11 @@ if (action) { conditionList = EntityCondition.makeCondition(conditions, EntityOperator.OR); try { beganTransaction = TransactionUtil.begin(); - invItemListItr = delegator.find("InventoryItem", conditionList, null, null, ['productId'], null); + invItemListItr = from("InventoryItem").where(conditionList).orderBy("productId").queryIterator(); while ((inventoryItem = invItemListItr.next()) != null) { productId = inventoryItem.productId; - product = delegator.findOne("Product", [productId : productId], false); - productFacility = delegator.findOne("ProductFacility", [productId : productId, facilityId : facilityId], false); + product = from("Product").where("productId", productId).queryOne(); + productFacility = from("ProductFacility").where("productId", productId, "facilityId", facilityId).queryOne(); if (productFacility) { quantityOnHandTotal = inventoryItem.getDouble("quantityOnHandTotal"); availableToPromiseTotal = inventoryItem.getDouble("availableToPromiseTotal"); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/LookupInventoryItems.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/LookupInventoryItems.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/LookupInventoryItems.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/LookupInventoryItems.groovy Mon Jan 5 08:50:30 2015 @@ -22,16 +22,16 @@ partyId = parameters.partyId; productId = parameters.productId; if (orderId && productId) { - shipmentReceiptAndItems = delegator.findByAnd("ShipmentReceiptAndItem", [orderId : orderId, productId : productId], null, false); + shipmentReceiptAndItems = from("ShipmentReceiptAndItem").where("orderId", orderId, "productId", productId).queryList(); context.inventoryItemsForPo = shipmentReceiptAndItems; context.orderId = orderId; } if (partyId && productId) { - orderRoles = delegator.findByAnd("OrderRole", [partyId : partyId, roleTypeId : "BILL_FROM_VENDOR"], null, false); + orderRoles = from("OrderRole").where("partyId", partyId, "roleTypeId", "BILL_FROM_VENDOR").queryList(); inventoryItemsForSupplier = []; orderRoles.each { orderRole -> - shipmentReceiptAndItems = delegator.findByAnd("ShipmentReceiptAndItem", [productId : productId, orderId : orderRole.orderId], null, false); + shipmentReceiptAndItems = from("ShipmentReceiptAndItem").where("productId", productId, "orderId", orderRole.orderId).queryList(); inventoryItemsForSupplier.addAll(shipmentReceiptAndItems); } context.inventoryItemsForSupplier = inventoryItemsForSupplier; @@ -39,9 +39,9 @@ if (partyId && productId) { } if (productId) { - inventoryItems = delegator.findByAnd("InventoryItem", [productId : productId], null, false); + inventoryItems = from("InventoryItem").where("productId", productId).queryList(); context.inventoryItemsForProduct = inventoryItems; context.productId = productId; - product = delegator.findOne("Product", [productId : productId], false); + product = from("Product").where("productId", productId).queryOne(); context.internalName = product.internalName; } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/PhysicalInventoryVariance.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/PhysicalInventoryVariance.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/PhysicalInventoryVariance.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/PhysicalInventoryVariance.groovy Mon Jan 5 08:50:30 2015 @@ -21,7 +21,7 @@ import org.ofbiz.entity.condition.Entity // get physicalInventoryAndVarianceDatas if this is a NON_SERIAL_INV_ITEM if (inventoryItem && "NON_SERIAL_INV_ITEM".equals(inventoryItem.inventoryItemTypeId)) { - physicalInventoryAndVariances = delegator.findList("PhysicalInventoryAndVariance", EntityCondition.makeCondition([inventoryItemId : inventoryItemId]), null, ['-physicalInventoryDate', '-physicalInventoryId'], null, false); + physicalInventoryAndVariances = from("PhysicalInventoryAndVariance").where("inventoryItemId", inventoryItemId).orderBy("-physicalInventoryDate", "-physicalInventoryId").queryList(); physicalInventoryAndVarianceDatas = new ArrayList(physicalInventoryAndVariances.size()); physicalInventoryAndVariances.each { physicalInventoryAndVariance -> physicalInventoryAndVarianceData = [:]; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/ReceiveInventory.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/ReceiveInventory.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/ReceiveInventory.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/ReceiveInventory.groovy Mon Jan 5 08:50:30 2015 @@ -34,14 +34,14 @@ if (partialReceive) { facility = null; if (facilityId) { - facility = delegator.findOne("Facility", [facilityId : facilityId], false); + facility = from("Facility").where("facilityId", facilityId).queryOne(); } ownerAcctgPref = null; if (facility) { owner = facility.getRelatedOne("OwnerParty", false); if (owner) { - result = dispatcher.runSync("getPartyAccountingPreferences", [organizationPartyId : owner.partyId, userLogin : request.getAttribute("userLogin")]); + result = runService('getPartyAccountingPreferences', [organizationPartyId : owner.partyId, userLogin : request.getAttribute("userLogin")]); if (!ServiceUtil.isError(result) && result.partyAccountingPreference) { ownerAcctgPref = result.partyAccountingPreference; } @@ -50,7 +50,7 @@ if (facility) { purchaseOrder = null; if (purchaseOrderId) { - purchaseOrder = delegator.findOne("OrderHeader", [orderId : purchaseOrderId], false); + purchaseOrder = from("OrderHeader").where("orderId", purchaseOrderId).queryOne(); if (purchaseOrder && !"PURCHASE_ORDER".equals(purchaseOrder.orderTypeId)) { purchaseOrder = null; } @@ -58,13 +58,13 @@ if (purchaseOrderId) { product = null; if (productId) { - product = delegator.findOne("Product", [productId : productId], false); - context.supplierPartyIds = EntityUtil.getFieldListFromEntityList(EntityUtil.filterByDate(delegator.findList("SupplierProduct", EntityCondition.makeCondition([productId : productId]), null, ["partyId"], null, false), nowTimestamp, "availableFromDate", "availableThruDate", true), "partyId", true); + product = from("Product").where("productId", productId).queryOne(); + context.supplierPartyIds = EntityUtil.getFieldListFromEntityList(from("SupplierProduct").where("productId", productId).orderBy("partyId").filterByDate(nowTimestamp, "availableFromDate", "availableThruDate").queryList(), "partyId", true); } shipments = null; if (purchaseOrder && !shipmentId) { - orderShipments = delegator.findList("OrderShipment", EntityCondition.makeCondition([orderId : purchaseOrderId]), null, null, null, false); + orderShipments = from("OrderShipment").where("orderId", purchaseOrderId).queryList(); if (orderShipments) { shipments = [] as TreeSet; orderShipments.each { orderShipment -> @@ -77,7 +77,7 @@ if (purchaseOrder && !shipmentId) { } } // This is here for backward compatibility: ItemIssuances are no more created for purchase shipments. - issuances = delegator.findList("ItemIssuance", EntityCondition.makeCondition([orderId : purchaseOrderId]), null, null, null, false); + issuances = from("ItemIssuance").where("orderId", purchaseOrderId).queryList(); if (issuances) { shipments = [] as TreeSet; issuances.each { issuance -> @@ -93,7 +93,7 @@ if (purchaseOrder && !shipmentId) { shipment = null; if (shipmentId && !shipmentId.equals("_NA_")) { - shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false); + shipment = from("Shipment").where("shipmentId", shipmentId).queryOne(); } shippedQuantities = [:]; @@ -141,7 +141,7 @@ if (purchaseOrder && facility) { if (!orderCurrencyUomId.equals(ownerCurrencyUomId)) { purchaseOrderItems.each { item -> orderCurrencyUnitPriceMap.(item.orderItemSeqId) = item.unitPrice; - serviceResults = dispatcher.runSync("convertUom", + serviceResults = runService('convertUom', [uomId : orderCurrencyUomId, uomIdTo : ownerCurrencyUomId, originalValue : item.unitPrice]); if (ServiceUtil.isError(serviceResults)) { request.setAttribute("_ERROR_MESSAGE_", ServiceUtil.getErrorMessage(serviceResults)); @@ -188,10 +188,7 @@ if (purchaseOrderItems) { } receivedQuantities.put(thisItem.orderItemSeqId, new Double(totalReceived)); //---------------------- - salesOrderItemAssocs = delegator.findList("OrderItemAssoc", EntityCondition.makeCondition([orderItemAssocTypeId : 'PURCHASE_ORDER', - toOrderId : thisItem.orderId, - toOrderItemSeqId : thisItem.orderItemSeqId]), - null, null, null, false); + salesOrderItemAssocs = from("OrderItemAssoc").where(orderItemAssocTypeId : 'PURCHASE_ORDER', toOrderId : thisItem.orderId, toOrderItemSeqId : thisItem.orderItemSeqId).queryList(); if (salesOrderItemAssocs) { salesOrderItem = EntityUtil.getFirst(salesOrderItemAssocs); salesOrderItems.put(thisItem.orderItemSeqId, salesOrderItem); @@ -201,7 +198,7 @@ if (purchaseOrderItems) { receivedItems = null; if (purchaseOrder) { - receivedItems = delegator.findList("ShipmentReceiptAndItem", EntityCondition.makeCondition([orderId : purchaseOrderId, facilityId : facilityId]), null, null, null, false); + receivedItems = from("ShipmentReceiptAndItem").where("orderId", purchaseOrderId, "facilityId", facilityId).queryList(); context.receivedItems = receivedItems; } @@ -212,13 +209,13 @@ if (productId && !product) { } // reject reasons -rejectReasons = delegator.findList("RejectionReason", null, null, null, null, false); +rejectReasons = from("RejectionReason").queryList(); // inv item types -inventoryItemTypes = delegator.findList("InventoryItemType", null, null, null, null, false); +inventoryItemTypes = from("InventoryItemType").queryList(); // facilities -facilities = delegator.findList("Facility", null, null, null, null, false); +facilities = from("Facility").queryList(); // default per unit cost for both shipment or individual product standardCosts = [:]; @@ -229,7 +226,7 @@ if (ownerAcctgPref) { purchaseOrderItems.each { orderItem -> productId = orderItem.productId; if (productId) { - result = dispatcher.runSync("getProductCost", [productId : productId, currencyUomId : ownerAcctgPref.baseCurrencyUomId, + result = runService('getProductCost', [productId : productId, currencyUomId : ownerAcctgPref.baseCurrencyUomId, costComponentTypePrefix : 'EST_STD', userLogin : request.getAttribute("userLogin")]); if (!ServiceUtil.isError(result)) { standardCosts.put(productId, result.productCost); @@ -240,7 +237,7 @@ if (ownerAcctgPref) { // get the unit cost of a single product if (productId) { - result = dispatcher.runSync("getProductCost", [productId : productId, currencyUomId : ownerAcctgPref.baseCurrencyUomId, + result = runService('getProductCost', [productId : productId, currencyUomId : ownerAcctgPref.baseCurrencyUomId, costComponentTypePrefix : 'EST_STD', userLogin : request.getAttribute("userLogin")]); if (!ServiceUtil.isError(result)) { standardCosts.put(productId, result.productCost); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/TransferInventoryItem.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/TransferInventoryItem.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/TransferInventoryItem.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/inventory/TransferInventoryItem.groovy Mon Jan 5 08:50:30 2015 @@ -29,7 +29,7 @@ inventoryItemId = request.getParameter(" inventoryTransfer = null; if (inventoryTransferId) { - inventoryTransfer = delegator.findOne("InventoryTransfer", [inventoryTransferId : inventoryTransferId], false); + inventoryTransfer = from("InventoryTransfer").where("inventoryTransferId", inventoryTransferId).queryOne(); if (inventoryTransfer) { context.inventoryTransfer = inventoryTransfer; if (!facilityId) { @@ -42,18 +42,18 @@ if (inventoryTransferId) { } } -facility = delegator.findOne("Facility", [facilityId : facilityId], false); +facility = from("Facility").where("facilityId", facilityId).queryOne(); context.facilityId = facilityId; context.facility = facility; context.inventoryItemId = inventoryItemId; if (facilityId) { - facility = delegator.findOne("Facility", [facilityId : facilityId], false); + facility = from("Facility").where("facilityId", facilityId).queryOne(); } String illegalInventoryItem = null; if (inventoryItemId) { - inventoryItem = delegator.findOne("InventoryItem", [inventoryItemId : inventoryItemId], false); + inventoryItem = from("InventoryItem").where("inventoryItemId", inventoryItemId).queryOne(); if (facilityId && inventoryItem && inventoryItem.facilityId && !inventoryItem.facilityId.equals(facilityId)) { illegalInventoryItem = "Inventory item not found for this facility."; inventoryItem = null; @@ -75,15 +75,15 @@ if (inventoryItemId) { } // facilities -context.facilities = delegator.findList("Facility", null, null, null, null, false); +context.facilities = from("Facility").queryList(); // status items if (inventoryTransfer && inventoryTransfer.statusId) { - statusChange = delegator.findList("StatusValidChange", EntityCondition.makeCondition([statusId : inventoryTransfer.statusId]), null, null, null, false); + statusChange = from("StatusValidChange").where("statusId", inventoryTransfer.statusId).queryList(); if (statusChange) { statusItems = [] as ArrayList; statusChange.each { curStatusChange -> - curStatusItem = delegator.findOne("StatusItem", [statusId : curStatusChange.statusIdTo], false); + curStatusItem = from("StatusItem").where("statusId", curStatusChange.statusIdTo).queryOne(); if (curStatusItem) { statusItems.add(curStatusItem); } @@ -92,7 +92,7 @@ if (inventoryTransfer && inventoryTransf context.statusItems = statusItems; } } else { - statusItems = delegator.findList("StatusItem", EntityCondition.makeCondition([statusTypeId : 'INVENTORY_XFER_STTS']), null, ['sequenceId'], null, false); + statusItems = from("StatusItem").where("statusTypeId", "INVENTORY_XFER_STTS").orderBy("sequenceId").queryList(); if (statusItems) { context.statusItems = statusItems; } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/returns/ReceiveReturn.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/returns/ReceiveReturn.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/returns/ReceiveReturn.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/returns/ReceiveReturn.groovy Mon Jan 5 08:50:30 2015 @@ -27,13 +27,13 @@ returnId = request.getParameter("returnI facility = null; if (facilityId) { - facility = delegator.findOne("Facility", [facilityId : facilityId], false); + facility = from("Facility").where("facilityId", facilityId).queryOne(); } returnHeader = null; returnItems = null; if (returnId) { - returnHeader = delegator.findOne("ReturnHeader", [returnId : returnId], false); + returnHeader = from("ReturnHeader").where("returnId", returnId).queryOne(); if (returnHeader) { if ("RETURN_ACCEPTED".equals(returnHeader.statusId)) { returnItems = returnHeader.getRelated("ReturnItem", null, null, false); @@ -71,14 +71,14 @@ if (returnItems) { } if (returnHeader) { - context.receivedItems = delegator.findList("ShipmentReceipt", EntityCondition.makeCondition("returnId", returnId), null, null, null, false); + context.receivedItems = from("ShipmentReceipt").where("returnId", returnId).queryList(); } // facilities -facilities = delegator.findList("Facility", null, null, null, null, false); +facilities = from("Facility").queryList(); //all possible inventory item types -inventoryItemTypes = delegator.findList("InventoryItemType", null, null, ['description'], null, true); +inventoryItemTypes = from("InventoryItemType").orderBy("description").cache(true).queryList(); context.facilityId = facilityId; context.facility = facility; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/AddItemsFromInventory.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/AddItemsFromInventory.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/AddItemsFromInventory.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/AddItemsFromInventory.groovy Mon Jan 5 08:50:30 2015 @@ -23,7 +23,7 @@ import org.ofbiz.entity.condition.Entity shipmentId = parameters.shipmentId; items = []; -shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false); +shipment = from("Shipment").where("shipmentId", shipmentId).queryOne(); partyId = shipment.partyIdTo; shipmentItems = shipment.getRelated("ShipmentItem", null, null, false); shipmentItems.each { shipmentItem -> @@ -31,7 +31,7 @@ shipmentItems.each { shipmentItem -> internalName = shipmentItem.getRelated("Product", null, null, false).internalName; EntityCondition cond = EntityCondition.makeCondition([EntityCondition.makeCondition("returnId", shipment.primaryReturnId), EntityCondition.makeCondition("productId", productId)], EntityOperator.AND); - returnItem = EntityUtil.getFirst(delegator.findList("ReturnItem", cond, null, null, null, true)); + returnItem = from("ReturnItem").where("returnId", shipment.primaryReturnId, "productId", productId).cache(true).queryFirst(); returnQuantity = Double.valueOf(returnItem.returnQuantity); shipmentItemQty = Double.valueOf(shipmentItem.quantity); Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/AddItemsFromOrder.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/AddItemsFromOrder.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/AddItemsFromOrder.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/AddItemsFromOrder.groovy Mon Jan 5 08:50:30 2015 @@ -26,7 +26,7 @@ orderId = request.getParameter("orderId" shipGroupSeqId = request.getParameter("shipGroupSeqId"); selectFromShipmentPlan = request.getParameter("selectFromShipmentPlan"); -shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false); +shipment = from("Shipment").where("shipmentId", shipmentId).queryOne(); if (shipment) { context.originFacility = shipment.getRelatedOne("OriginFacility", false); @@ -41,7 +41,7 @@ if (!shipGroupSeqId && shipment) { } if (orderId && shipment) { - orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false); + orderHeader = from("OrderHeader").where("orderId", orderId).queryOne(); context.orderHeader = orderHeader; if (orderHeader) { @@ -53,7 +53,7 @@ if (orderId && shipment) { orderItemShipGroup = null; if (shipGroupSeqId) { - orderItemShipGroup = delegator.findOne("OrderItemShipGroup", [orderId : orderId, shipGroupSeqId : shipGroupSeqId], false); + orderItemShipGroup = from("OrderItemShipGroup").where("orderId", orderId, "shipGroupSeqId", shipGroupSeqId).queryOne(); context.orderItemShipGroup = orderItemShipGroup; } @@ -114,7 +114,7 @@ if (orderId && shipment) { } } if (shipment && selectFromShipmentPlan) { - shipmentPlans = delegator.findList("OrderShipment", EntityCondition.makeCondition([shipmentId : shipment.shipmentId]), null, ['orderId', 'orderItemSeqId'], null, false); + shipmentPlans = from("OrderShipment").where("shipmentId", shipment.shipmentId).orderBy("orderId", "orderItemSeqId").queryList(); orderItemDatas = [] as LinkedList; context.isSalesOrder = true; @@ -124,7 +124,7 @@ if (shipment && selectFromShipmentPlan) orderItemShipGroup = null; if (shipGroupSeqId) { - orderItemShipGroup = delegator.findOne("OrderItemShipGroup", [orderId : orderItem.orderId, shipGroupSeqId : shipGroupSeqId], false); + orderItemShipGroup = from("OrderItemShipGroup").where("orderId", orderItem.orderId, "shipGroupSeqId", shipGroupSeqId).queryOne(); context.orderItemShipGroup = orderItemShipGroup; } Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipment.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipment.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipment.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipment.groovy Mon Jan 5 08:50:30 2015 @@ -21,7 +21,7 @@ import org.ofbiz.entity.condition.* import org.ofbiz.widget.html.HtmlFormWrapper shipmentId = parameters.shipmentId; -shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false); +shipment = from("Shipment").where("shipmentId", shipmentId).queryOne(); // orderHeader is needed here to determine type of order and hence types of shipment status if (!shipment) { @@ -29,7 +29,7 @@ if (!shipment) { } else { primaryOrderId = shipment.primaryOrderId; } -orderHeader = delegator.findOne("OrderHeader", [orderId : primaryOrderId], false); +orderHeader = from("OrderHeader").where(orderId : primaryOrderId).queryOne(); // the kind of StatusItem to use is based on the type of order statusItemTypeId = "SHIPMENT_STATUS"; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentItems.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentItems.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentItems.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentItems.groovy Mon Jan 5 08:50:30 2015 @@ -27,7 +27,7 @@ if (!shipmentId) { shipment = null; if (shipmentId) { - shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false); + shipment = from("Shipment").where("shipmentId", shipmentId).queryOne(); } if (shipment) { Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentPackages.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentPackages.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentPackages.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentPackages.groovy Mon Jan 5 08:50:30 2015 @@ -26,7 +26,7 @@ if (!shipmentId) { shipment = null; if (shipmentId) { - shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false); + shipment = from("Shipment").where("shipmentId", shipmentId).queryOne(); } if (shipment) { @@ -45,8 +45,8 @@ if (shipment) { shipmentItems = shipment.getRelated("ShipmentItem", null, ['shipmentItemSeqId'], false); shipmentRouteSegments = shipment.getRelated("ShipmentRouteSegment", null, ['shipmentRouteSegmentId'], false); - weightUoms = delegator.findList("Uom", EntityCondition.makeCondition([uomTypeId : 'WEIGHT_MEASURE']), null, ['description'], null, false); - boxTypes = delegator.findList("ShipmentBoxType", null, null, null, null, false); + weightUoms = from("Uom").where("uomTypeId", "WEIGHT_MEASURE").orderBy("description").queryList(); + boxTypes = from("ShipmentBoxType").queryList(); context.shipment = shipment; context.shipmentPackageDatas = shipmentPackageDatas; Modified: ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentPlan.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentPlan.groovy?rev=1649482&r1=1649481&r2=1649482&view=diff ============================================================================== --- ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentPlan.groovy (original) +++ ofbiz/branches/OFBIZ-5312-ofbiz-ecommerce-seo-2013-10-23/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentPlan.groovy Mon Jan 5 08:50:30 2015 @@ -31,7 +31,7 @@ action = request.getParameter("action"); shipment = null; if (shipmentId) { - shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false); + shipment = from("Shipment").where("shipmentId", shipmentId).queryOne(); } @@ -44,9 +44,9 @@ orderItemShipGroupAssocs = null; // ************************************** if (action && orderId) { if (shipGroupSeqId) { - orderItemShipGroupAssocs = delegator.findList("OrderItemShipGroupAssoc", EntityCondition.makeCondition([orderId : orderId, shipGroupSeqId : shipGroupSeqId]), null, null, null, false); + orderItemShipGroupAssocs = from("OrderItemShipGroupAssoc").where("orderId", orderId, "shipGroupSeqId", shipGroupSeqId).queryList(); } else { - orderItemShipGroupAssocs = delegator.findList("OrderItemShipGroupAssoc", EntityCondition.makeCondition([orderId : orderId]), null, null, null, false); + orderItemShipGroupAssocs = from("OrderItemShipGroupAssoc").where("orderId", orderId).queryList(); } } @@ -59,7 +59,7 @@ shipmentPlans = null; shipmentPlansIt = null; rows = [] as ArrayList; if (shipment) { - shipmentPlans = delegator.findList("OrderShipment", EntityCondition.makeCondition([shipmentId : shipment.shipmentId]), null, null, null, false); + shipmentPlans = from("OrderShipment").where("shipmentId", shipment.shipmentId).queryList(); } if (shipmentPlans) { shipmentPlans.each { shipmentPlan -> @@ -104,7 +104,7 @@ if (shipmentPlans) { // Total quantity planned not issued plannedQuantity = 0.0; qtyPlannedInShipment = [:]; - plans = delegator.findList("OrderShipment", EntityCondition.makeCondition([orderId : orderItem.orderId, orderItemSeqId : orderItem.orderItemSeqId]), null, null, null, false); + plans = from("OrderShipment").where("orderId", orderItem.orderId, "orderItemSeqId", orderItem.orderItemSeqId).queryList(); plans.each { plan -> if (plan.quantity) { netPlanQty = plan.getDouble("quantity"); @@ -158,7 +158,7 @@ if (shipmentPlans) { } oneRow.weight = weight; if (product.weightUomId) { - weightUom = delegator.findOne("Uom", [uomId : product.weightUomId], false); + weightUom = from("Uom").where("uomId", product.weightUomId).queryOne(); oneRow.weightUom = weightUom.abbreviation; } volume = 0.0; @@ -173,9 +173,9 @@ if (shipmentPlans) { } oneRow.volume = volume; if (product.heightUomId && product.widthUomId && product.depthUomId) { - heightUom = delegator.findOne("Uom",[uomId : product.heightUomId], true); - widthUom = delegator.findOne("Uom", [uomId : product.widthUomId], true); - depthUom = delegator.findOne("Uom", [uomId : product.depthUomId], true); + heightUom = from("Uom").where("uomId", product.heightUomId).cache(true).queryOne(); + widthUom = from("Uom").where("uomId", product.widthUomId).cache(true).queryOne(); + depthUom = from("Uom").where("uomId", product.depthUomId).cache(true).queryOne(); oneRow.volumeUom = heightUom.abbreviation + "x" + widthUom.abbreviation + "x" + depthUom.abbreviation; } totWeight += weight; @@ -235,7 +235,7 @@ if (orderItemShipGroupAssocs) { } else { orderShipmentCondition = EntityCondition.makeCondition([orderId : orderItemShipGroupAssoc.orderId, orderItemSeqId : orderItemShipGroupAssoc.orderItemSeqId]); } - plans = delegator.findList("OrderShipment", orderShipmentCondition, null, null, null, false); + plans = from("OrderShipment").where(orderShipmentCondition).queryList(); plans.each { plan -> if (plan.quantity) { netPlanQty = plan.getDouble("quantity"); @@ -257,7 +257,7 @@ if (orderItemShipGroupAssocs) { oneRow.weight = weight; if (product.weightUomId) { - weightUom = delegator.findOne("Uom", [uomId : product.weightUomId], true); + weightUom = from("Uom").where("uomId", product.weightUomId).cache(true).queryOne(); oneRow.weightUom = weightUom.abbreviation; } volume = 0.0; @@ -270,9 +270,9 @@ if (orderItemShipGroupAssocs) { oneRow.volume = volume; if (product.heightUomId && product.widthUomId && product.depthUomId) { - heightUom = delegator.findOne("Uom", [uomId : product.heightUomId], true); - widthUom = delegator.findOne("Uom", [uomId : product.widthUomId], true); - depthUom = delegator.findOne("Uom", [uomId : product.depthUomId], true); + heightUom = from("Uom").where("uomId", product.heightUomId).cache(true).queryOne(); + widthUom = from("Uom").where("uomId", product.widthUomId).cache(true).queryOne(); + depthUom = from("Uom").where("uomId", product.depthUomId).cache(true).queryOne(); oneRow.volumeUom = heightUom.abbreviation + "x" + widthUom.abbreviation + "x" + depthUom.abbreviation; } addRows.add(oneRow); |
Free forum by Nabble | Edit this page |