Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsComponentsByFeature.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsComponentsByFeature.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsComponentsByFeature.groovy (original) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsComponentsByFeature.groovy Sat Dec 20 04:31:20 2014 @@ -24,15 +24,15 @@ import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.product.category.CategoryWorker; if (productCategoryIdPar) { - category = delegator.findOne("ProductCategory", [productCategoryId : productCategoryIdPar], false); + category = from("ProductCategory").where("productCategoryId", productCategoryIdPar).queryOne(); context.category = category; } if (productFeatureTypeIdPar) { - featureType = delegator.findOne("ProductFeatureType", [productFeatureTypeId : productFeatureTypeIdPar], false); + featureType = from("ProductFeatureType").where("productFeatureTypeId", productFeatureTypeIdPar).queryOne(); context.featureType = featureType; } -allProductionRuns = delegator.findByAnd("WorkEffortAndGoods", [workEffortName : planName],["productId"], false); +allProductionRuns = from("WorkEffortAndGoods").where("workEffortName", planName).orderBy("productId").queryList(); productionRuns = []; features = [:]; // each entry is a productFeatureId|{productFeature,products} products = [:]; // each entry is a productId|{product,quantity} @@ -43,15 +43,14 @@ if (!productFeatureTypeIdPar) { if (allProductionRuns) { allProductionRuns.each { productionRun -> // select the production run's task of a given name (i.e. type) if any (based on the report's parameter) - productionRunTasks = delegator.findByAnd("WorkEffort", [workEffortParentId : productionRun.workEffortId, workEffortName : taskNamePar], null, false); - productionRunTask = EntityUtil.getFirst(productionRunTasks); + productionRunTask = from("WorkEffort").where("workEffortParentId", productionRun.workEffortId, "workEffortName", taskNamePar).queryFirst(); if (!productionRunTask) { // the production run doesn't include the given task, skip it return; } // select the task's components, if any - allProductionRunComponents = delegator.findByAnd("WorkEffortGoodStandard", [workEffortId : productionRunTask.workEffortId,workEffortGoodStdTypeId : "PRUNT_PROD_NEEDED"], null, false); + allProductionRunComponents = from("WorkEffortGoodStandard").where("workEffortId", productionRunTask.workEffortId, "workEffortGoodStdTypeId", "PRUNT_PROD_NEEDED").queryList(); allProductionRunComponents.each { productionRunComponent -> // verify if the product is a member of the given category (based on the report's parameter) if (productCategoryIdPar) { @@ -60,19 +59,16 @@ if (allProductionRuns) { return; } } - productionRunProduct = delegator.findOne("Product", [productId : productionRunComponent.productId], false); + productionRunProduct = from("Product").where("productId", productionRunComponent.productId).queryOne(); location = null; if (productionRunProduct) { - locations = delegator.findByAnd("ProductFacilityLocation", [facilityId : productionRun.facilityId, productId : productionRunProduct.productId], null, false); - location = EntityUtil.getFirst(locations); + location = from("ProductFacilityLocation").where("facilityId", productionRun.facilityId, "productId", productionRunProduct.productId).queryFirst(); } // group by standard feature of type productFeatureTypeIdPar if (productFeatureTypeIdPar) { - standardFeatures = delegator.findByAnd("ProductFeatureAndAppl", [productFeatureTypeId : productFeatureTypeIdPar, productId : productionRunComponent.productId, productFeatureApplTypeId : "STANDARD_FEATURE"], null, false); - standardFeatures = EntityUtil.filterByDate(standardFeatures); - standardFeature = EntityUtil.getFirst(standardFeatures); + standardFeature = from("ProductFeatureAndAppl").where("productFeatureTypeId", productFeatureTypeIdPar, "productId", productionRunComponent.productId, "productFeatureApplTypeId", "STANDARD_FEATURE").filterByDate().queryFirst(); standardFeatureId = null; if (standardFeature) { standardFeatureId = standardFeature.productFeatureId; Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsInfoAndOrder.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsInfoAndOrder.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsInfoAndOrder.groovy (original) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsInfoAndOrder.groovy Sat Dec 20 04:31:20 2014 @@ -25,11 +25,11 @@ import org.ofbiz.manufacturing.jobshopmg import org.ofbiz.order.order.OrderReadHelper; if (productCategoryIdPar) { - category = delegator.findOne("ProductCategory", [productCategoryId : productCategoryIdPar], false); + category = from("ProductCategory").where("productCategoryId", productCategoryIdPar).queryOne(); context.category = category; } -allProductionRuns = delegator.findByAnd("WorkEffortAndGoods", [workEffortName : planName, statusId : "WEGS_CREATED", workEffortGoodStdTypeId : "PRUN_PROD_DELIV"], ["productId"], false); +allProductionRuns = from("WorkEffortAndGoods").where("workEffortName", planName, "statusId", "WEGS_CREATED", "workEffortGoodStdTypeId", "PRUN_PROD_DELIV").orderBy("productId").queryList(); productionRuns = []; if (allProductionRuns) { @@ -41,16 +41,14 @@ if (allProductionRuns) { return; } } - productionRunProduct = delegator.findOne("Product", [productId : productionRun.productId], false); + productionRunProduct = from("Product").where("productId", productionRun.productId).queryOne(); String rootProductionRunId = ProductionRunHelper.getRootProductionRun(delegator, productionRun.workEffortId); - productionRunOrders = delegator.findByAnd("WorkOrderItemFulfillment", [workEffortId : rootProductionRunId], null, false); - productionRunOrder = EntityUtil.getFirst(productionRunOrders); + productionRunOrder = from("WorkOrderItemFulfillment").where("workEffortId", rootProductionRunId).queryFirst(); OrderReadHelper orh = new OrderReadHelper(delegator, productionRunOrder.orderId); // select the production run's task of a given name (i.e. type) if any (based on the report's parameter) - productionRunTasks = delegator.findByAnd("WorkEffort", [workEffortParentId : productionRun.workEffortId, workEffortName : taskNamePar], null, false); - productionRunTask = EntityUtil.getFirst(productionRunTasks); + productionRunTask = from("WorkEffort").where("workEffortParentId", productionRun.workEffortId, "workEffortName", taskNamePar).queryFirst(); if (!productionRunTask) { // the production run doesn't include the given task, skip it return; @@ -62,12 +60,13 @@ if (allProductionRuns) { productionRunOrder : productionRunOrder, customer : orh.getPlacingParty(), address : orh.getShippingAddress()]; - allProductionComponents = delegator.findByAnd("WorkEffortAndGoods", [workEffortId : productionRunTask.workEffortId, statusId : "WEGS_CREATED", workEffortGoodStdTypeId : "PRUNT_PROD_NEEDED"], ["productId"], false); + allProductionComponents = from("WorkEffortAndGoods").where("workEffortId", productionRunTask.workEffortId, "statusId", "WEGS_CREATED", "workEffortGoodStdTypeId", "PRUNT_PROD_NEEDED").orderBy("productId").queryList(); + componentList = []; if (allProductionComponents) { allProductionComponents.each { productionComponent -> - productionRunProductComp = delegator.findOne("Product", [productId : productionComponent.productId], false); + productionRunProductComp = from("Product").where("productId", productionComponent.productId).queryOne(); productionRunProductMap = [component : productionComponent,componentProduct : productionRunProductComp]; componentList.add(productionRunProductMap); } Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsAndOrder.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsAndOrder.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsAndOrder.groovy (original) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsAndOrder.groovy Sat Dec 20 04:31:20 2014 @@ -25,11 +25,11 @@ import org.ofbiz.manufacturing.jobshopmg import org.ofbiz.order.order.OrderReadHelper; if (productCategoryIdPar) { - category = delegator.findOne("ProductCategory", [productCategoryId : productCategoryIdPar], false); + category = from("ProductCategory").where("productCategoryId", productCategoryIdPar).queryOne(); context.category = category; } -allProductionRuns = delegator.findByAnd("WorkEffortAndGoods", UtilMisc.toMap("workEffortName", planName, "statusId", "WEGS_CREATED", "workEffortGoodStdTypeId", "PRUN_PROD_DELIV"), UtilMisc.toList("productId"), false); +allProductionRuns = from("WorkEffortAndGoods").where("workEffortName", planName, "statusId", "WEGS_CREATED", "workEffortGoodStdTypeId", "PRUN_PROD_DELIV").orderBy("productId").queryList(); productionRuns = []; if (allProductionRuns) { @@ -41,14 +41,12 @@ if (allProductionRuns) { return; } } - productionRunProduct = delegator.findOne("Product", [productId : productionRun.productId], false); + productionRunProduct = from("Product").where("productId", productionRun.productId).queryOne(); String rootProductionRunId = ProductionRunHelper.getRootProductionRun(delegator, productionRun.workEffortId); - productionRunOrders = delegator.findByAnd("WorkOrderItemFulfillment", [workEffortId : rootProductionRunId], null, false); - productionRunOrder = EntityUtil.getFirst(productionRunOrders); + productionRunOrder = from("WorkOrderItemFulfillment").where("workEffortId", rootProductionRunId).queryFirst(); OrderReadHelper orh = new OrderReadHelper(delegator, productionRunOrder.orderId); - locations = delegator.findByAnd("ProductFacilityLocation", [productId : productionRun.productId, facilityId : productionRun.facilityId], null, false); - location = EntityUtil.getFirst(locations); + location = from("ProductFacilityLocation").where("productId", productionRun.productId, "facilityId", productionRun.facilityId).queryFirst(); productionRunMap = [productionRun : productionRun, product : productionRunProduct, Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsByFeature.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsByFeature.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsByFeature.groovy (original) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsByFeature.groovy Sat Dec 20 04:31:20 2014 @@ -23,15 +23,15 @@ import org.ofbiz.entity.util.EntityUtil; if (productCategoryIdPar) { - category = delegator.findOne("ProductCategory", [productCategoryId : productCategoryIdPar], false); + category = from("ProductCategory").where("productCategoryId", productCategoryIdPar).queryOne(); context.category = category; } if (productFeatureTypeIdPar) { - featureType = delegator.findOne("ProductFeatureType", [productFeatureTypeId : productFeatureTypeIdPar], false); + featureType = from("ProductFeatureType").where("productFeatureTypeId", productFeatureTypeIdPar).queryOne(); context.featureType = featureType; } -allProductionRuns = delegator.findByAnd("WorkEffortAndGoods", [workEffortName : planName], ["productId"], false); +allProductionRuns = from("WorkEffortAndGoods").where("workEffortName", planName).orderBy("productId").queryList(); productionRuns = [:]; features = []; if (!productFeatureTypeIdPar) { @@ -47,13 +47,11 @@ if (allProductionRuns) { return; } } - productionRunProduct = delegator.findOne("Product", [productId : productionRun.productId], false); + productionRunProduct = from("Product").where("productId", productionRun.productId).queryOne(); // group by standard feature of type productFeatureTypeIdPar if (productFeatureTypeIdPar) { - standardFeatures = delegator.findByAnd("ProductFeatureAndAppl", [productFeatureTypeId : productFeatureTypeIdPar, productId : productionRun.productId, productFeatureApplTypeId : "STANDARD_FEATURE"], null, false); - standardFeatures = EntityUtil.filterByDate(standardFeatures); - standardFeature = EntityUtil.getFirst(standardFeatures); + standardFeature = from("ProductFeatureAndAppl").where("productFeatureTypeId", productFeatureTypeIdPar, "productId", productionRun.productId, "productFeatureApplTypeId", "STANDARD_FEATURE").filterByDate().queryFirst(); standardFeatureId = null; if (standardFeature) { standardFeatureId = standardFeature.productFeatureId; @@ -66,8 +64,7 @@ if (allProductionRuns) { } // select the production run's task of a given name (i.e. type) if any (based on the report's parameter) - productionRunTasks = delegator.findByAnd("WorkEffort", [workEffortParentId : productionRun.workEffortId, workEffortName : taskNamePar], null, false); - productionRunTask = EntityUtil.getFirst(productionRunTasks); + productionRunTask = from("WorkEffort").where("workEffortParentId", productionRun.workEffortId, "workEffortName", taskNamePar).queryFirst(); if (!productionRunTask) { // the production run doesn't include the given task, skip it return; Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsStacks.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsStacks.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsStacks.groovy (original) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PRunsProductsStacks.groovy Sat Dec 20 04:31:20 2014 @@ -23,15 +23,15 @@ import org.ofbiz.entity.util.EntityUtil; if (productCategoryIdPar) { - category = delegator.findOne("ProductCategory", [productCategoryId : productCategoryIdPar], false); + category = from("ProductCategory").where("productCategoryId", productCategoryIdPar).queryOne(); context.category = category; } if (productFeatureTypeIdPar) { - featureType = delegator.findOne("ProductFeatureType", [productFeatureTypeId : productFeatureTypeIdPar], false); + featureType = from("ProductFeatureType").where("productFeatureTypeId", productFeatureTypeIdPar).queryOne(); context.featureType = featureType; } -allProductionRuns = delegator.findByAnd("WorkEffortAndGoods", [workEffortName : planName], ["productId"], false); +allProductionRuns = from("WorkEffortAndGoods").where("workEffortName", planName).orderBy("productId").queryList(); productionRuns = []; features = [:]; products = [:]; @@ -45,16 +45,14 @@ if (allProductionRuns) { return; } } - productionRunProduct = delegator.findOne("Product", [productId : productionRun.productId], false); + productionRunProduct = from("Product").where("productId", productionRun.productId).queryOne(); location = [:]; if (productionRunProduct) { - locations = delegator.findByAnd("ProductFacilityLocation", [facilityId : productionRun.facilityId, productId : productionRun.productId], null, false); - location = EntityUtil.getFirst(locations); + location = form("ProductFacilityLocation").where(facilityId : productionRun.facilityId, productId : productionRun.productId).queryFirst(); } if (taskNamePar) { // select the production run's task of a given name (i.e. type) if any (based on the report's parameter) - productionRunTasks = delegator.findByAnd("WorkEffort", [workEffortParentId : productionRun.workEffortId , workEffortName : taskNamePar], null, false); - productionRunTask = EntityUtil.getFirst(productionRunTasks); + productionRunTask = from("WorkEffort").where("workEffortParentId", productionRun.workEffortId , "workEffortName", taskNamePar).queryFirst(); if (!productionRunTask) { // the production run doesn't include the given task, skip it return; Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PackageContentsAndOrder.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PackageContentsAndOrder.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PackageContentsAndOrder.groovy (original) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/PackageContentsAndOrder.groovy Sat Dec 20 04:31:20 2014 @@ -25,21 +25,20 @@ import org.ofbiz.order.order.OrderReadHe import org.ofbiz.order.order.OrderContentWrapper; if (productCategoryIdPar) { - category = delegator.findOne("ProductCategory", [productCategoryId : productCategoryIdPar], false); + category = from("ProductCategory").where("productCategoryId", productCategoryIdPar).queryOne(); context.category = category; } if (productFeatureTypeIdPar) { - featureType = delegator.findOne("ProductFeatureType", [productFeatureTypeId : productFeatureTypeIdPar], false); + featureType = from("ProductFeatureType").where("productFeatureTypeId", productFeatureTypeIdPar).queryOne(); context.featureType = featureType; } -packageContents = delegator.findByAnd("ShipmentPackageContent", [shipmentId : shipmentId], null, false); +packageContents = from("ShipmentPackageContent").where("shipmentId", shipmentId).queryList(); packagesMap = [:]; if (packageContents) { packageContents.each { packageContent -> - orderShipments = delegator.findByAnd("OrderShipment", [shipmentId : shipmentId, shipmentItemSeqId : packageContent.shipmentItemSeqId], null, false); - orderShipment = EntityUtil.getFirst(orderShipments); - orderItem = delegator.findOne("OrderItem", [orderId : orderShipment.orderId, orderItemSeqId : orderShipment.orderItemSeqId], false); + orderShipment = from("OrderShipment").where("shipmentId", shipmentId, "shipmentItemSeqId", packageContent.shipmentItemSeqId).queryFirst(); + orderItem = from("OrderItem").where("orderId", orderShipment.orderId, "orderItemSeqId", orderShipment.orderItemSeqId).queryOne(); product = orderItem.getRelatedOne("Product", false); // verify if the product is a member of the given category (based on the report's parameter) if (productCategoryIdPar) { Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentLabel.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentLabel.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentLabel.groovy (original) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentLabel.groovy Sat Dec 20 04:31:20 2014 @@ -21,16 +21,16 @@ import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.order.order.OrderReadHelper; shipmentId = parameters.shipmentId; -shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false); +shipment = from("Shipment").where("shipmentId", shipmentId).queryOne(); context.shipmentIdPar = shipment.shipmentId; if (shipment) { - shipmentPackages = delegator.findByAnd("ShipmentPackage", [shipmentId : shipmentId], null, false); + shipmentPackages = from("ShipmentPackage").where("shipmentId", shipmentId).queryList(); records = []; orderReaders = [:]; shipmentPackages.each { shipmentPackage -> - shipmentPackageComponents = delegator.findByAnd("ShipmentPackageContent", [shipmentId : shipmentId, shipmentPackageSeqId : shipmentPackage.shipmentPackageSeqId], null, false); + shipmentPackageComponents = from("ShipmentPackageContent").where("shipmentId", shipmentId, "shipmentPackageSeqId", shipmentPackage.shipmentPackageSeqId).queryList();; shipmentPackageComponents.each { shipmentPackageComponent -> shipmentItem = shipmentPackageComponent.getRelatedOne("ShipmentItem", false); orderShipments = shipmentItem.getRelated("OrderShipment", null, null, false); @@ -54,7 +54,7 @@ if (shipment) { record.shipmentPackageSeqId = shipmentPackageComponent.shipmentPackageSeqId; record.orderId = orderId; record.orderItemSeqId = orderItemSeqId; - product = delegator.findOne("Product", [productId : record.productId], false); + product = from("Product").where("productId", record.productId).queryOne(); record.productName = product.internalName; record.shipDate = shipment.estimatedShipDate; // --- @@ -62,7 +62,7 @@ if (shipment) { if (orderReaders.containsKey(orderId)) { orderReadHelper = (OrderReadHelper)orderReaders.get(orderId); } else { - orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false); + orderHeader = from("OrderHeader").where("orderId", orderId).queryOne(); orderReadHelper = new OrderReadHelper(orderHeader); orderReaders.put(orderId, orderReadHelper); } Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentPlanStockReport.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentPlanStockReport.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentPlanStockReport.groovy (original) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentPlanStockReport.groovy Sat Dec 20 04:31:20 2014 @@ -22,16 +22,16 @@ import org.ofbiz.base.util.*; inventoryStock = [:]; shipmentId = parameters.shipmentId; -shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false); +shipment = from("Shipment").where("shipmentId", shipmentId).queryOne(); context.shipmentIdPar = shipment.shipmentId; context.estimatedReadyDatePar = shipment.estimatedReadyDate; context.estimatedShipDatePar = shipment.estimatedShipDate; records = []; if (shipment) { - shipmentPlans = delegator.findByAnd("OrderShipment", [shipmentId : shipmentId], null, false); + shipmentPlans = from("OrderShipment").where("shipmentId", shipmentId).queryList(); shipmentPlans.each { shipmentPlan -> - orderLine = delegator.findOne("OrderItem", [orderId : shipmentPlan.orderId , orderItemSeqId : shipmentPlan.orderItemSeqId], false); + orderLine = from("OrderItem").where("orderId", shipmentPlan.orderId , "orderItemSeqId", shipmentPlan.orderItemSeqId).queryOne(); recordGroup = [:]; recordGroup.ORDER_ID = shipmentPlan.orderId; recordGroup.ORDER_ITEM_SEQ_ID = shipmentPlan.orderItemSeqId; @@ -40,7 +40,7 @@ if (shipment) { recordGroup.PRODUCT_ID = orderLine.productId; recordGroup.QUANTITY = shipmentPlan.quantity; - product = delegator.findOne("Product", [productId : orderLine.productId], false); + product = from("Product").where("productId", orderLine.productId).queryOne(); recordGroup.PRODUCT_NAME = product.internalName; inputPar = [productId : orderLine.productId, Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentWorkEffortTasks.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentWorkEffortTasks.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentWorkEffortTasks.groovy (original) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/reports/ShipmentWorkEffortTasks.groovy Sat Dec 20 04:31:20 2014 @@ -20,24 +20,24 @@ import org.ofbiz.entity.GenericValue; shipmentId = parameters.shipmentId; -shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false); +shipment = from("Shipment").where("shipmentId", shipmentId).queryOne(); context.shipmentIdPar = shipment.shipmentId; context.date = new Date(); Double fixedAssetTime = new Double(0); if (shipment) { - shipmentPlans = delegator.findByAnd("OrderShipment", [shipmentId : shipmentId], null, false); + shipmentPlans = from("OrderShipment").where("shipmentId", shipmentId).queryList(); shipmentPlans.each { shipmentPlan -> - productionRuns = delegator.findByAnd("WorkOrderItemFulfillment", [orderId : shipmentPlan.orderId, orderItemSeqId : shipmentPlan.orderItemSeqId] , ["workEffortId"], false); // TODO: add shipmentId + productionRuns = from("WorkOrderItemFulfillment").where("orderId", shipmentPlan.orderId, "orderItemSeqId", shipmentPlan.orderItemSeqId).orderBy("workEffortId").queryList(); if (productionRuns) { productionRuns.each { productionRun -> productionRunProduct = [:]; - productionRunProducts = delegator.findByAnd("WorkEffortGoodStandard", [workEffortId : productionRun.workEffortId , workEffortGoodStdTypeId : "PRUN_PROD_DELIV", statusId : "WEGS_CREATED"], null, false); + productionRunProducts = from("WorkEffortGoodStandard").where("workEffortId", productionRun.workEffortId , "workEffortGoodStdTypeId", "PRUN_PROD_DELIV", "statusId", "WEGS_CREATED").queryList(); if (productionRunProducts) { productionRunProduct = ((GenericValue)productionRunProducts.get(0)).getRelatedOne("Product", false); } - tasks = delegator.findByAnd("WorkEffort", [workEffortParentId : productionRun.workEffortId, workEffortTypeId : "PROD_ORDER_TASK"], null, false); + tasks = from("WorkEffort").where("workEffortParentId", productionRun.workEffortId, "workEffortTypeId", "PROD_ORDER_TASK").queryList(); tasks.each { task -> record = [:]; record.productId = productionRunProduct.productId; Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendar.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendar.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendar.groovy (original) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendar.groovy Sat Dec 20 04:31:20 2014 @@ -22,7 +22,7 @@ import org.ofbiz.base.util.UtilHttp; requestParams = UtilHttp.getParameterMap(request); calendarId = requestParams.get("calendarId") ?: request.getAttribute("calendarId"); if (calendarId != null) { - techDataCalendar = delegator.findOne("TechDataCalendar", [calendarId : calendarId], false); + techDataCalendar = from("TechDataCalendar").where("calendarId", calendarId).queryOne(); context.techDataCalendar = techDataCalendar; } @@ -41,5 +41,5 @@ if (!calendarData) { } context.calendarData = calendarData; -allCalendarWeek = delegator.findList("TechDataCalendarWeek", null, null, null, null, false); +allCalendarWeek = from("TechDataCalendarWeek").queryList(); context.calendarWeeks = allCalendarWeek; Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendarExceptionDay.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendarExceptionDay.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendarExceptionDay.groovy (original) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendarExceptionDay.groovy Sat Dec 20 04:31:20 2014 @@ -33,7 +33,7 @@ calendarExceptionDays = []; calendarId = parameters.calendarId ?: request.getAttribute("calendarId"); if (calendarId) { - techDataCalendar = delegator.findOne("TechDataCalendar", [calendarId : calendarId], false); + techDataCalendar = from("TechDataCalendar").where("calendarId", calendarId).queryOne(); } if (techDataCalendar) { calendarExceptionDays = techDataCalendar.getRelated("TechDataCalendarExcDay", null, null, false); @@ -52,7 +52,7 @@ exceptionDateStartTime = parameters.exce exceptionDateStartTime = ObjectType.simpleTypeConvert(exceptionDateStartTime, "Timestamp", null, null); if (exceptionDateStartTime) { - calendarExceptionDay = delegator.findOne("TechDataCalendarExcDay", [calendarId : calendarId , exceptionDateStartTime : exceptionDateStartTime], false); + calendarExceptionDay = from("TechDataCalendarExcDay").where("calendarId", calendarId , "exceptionDateStartTime", exceptionDateStartTime) if (calendarExceptionDay) { HtmlFormWrapper updateCalendarExceptionDayWrapper = new HtmlFormWrapper("component://manufacturing/widget/manufacturing/CalendarForms.xml", "UpdateCalendarExceptionDay", request, response); updateCalendarExceptionDayWrapper.putInContext("calendarExceptionDay", calendarExceptionDay); Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendarExceptionWeek.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendarExceptionWeek.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendarExceptionWeek.groovy (original) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/routing/EditCalendarExceptionWeek.groovy Sat Dec 20 04:31:20 2014 @@ -31,7 +31,7 @@ calendarExceptionWeeks = []; calendarId = parameters.calendarId ?: request.getAttribute("calendarId");; if (calendarId) { - techDataCalendar = delegator.findOne("TechDataCalendar", [calendarId : calendarId], false); + techDataCalendar = from("TechDataCalendar").where("calendarId", calendarId).queryOne(); } if (techDataCalendar) { calendarExceptionWeeks = techDataCalendar.getRelated("TechDataCalendarExcWeek", null, null, false); @@ -56,7 +56,7 @@ exceptionDateStart = parameters.exceptio exceptionDateStart = ObjectType.simpleTypeConvert(exceptionDateStart, "java.sql.Date", null, null); if (exceptionDateStart) { - calendarExceptionWeek = delegator.findOne("TechDataCalendarExcWeek", [calendarId : calendarId , exceptionDateStart : exceptionDateStart], false); + calendarExceptionWeek = from("TechDataCalendarExcWeek").where("calendarId", calendarId , "exceptionDateStart", exceptionDateStart).queryOne(); if (calendarExceptionWeek) { HtmlFormWrapper updateCalendarExceptionWeekWrapper = new HtmlFormWrapper("component://manufacturing/widget/manufacturing/CalendarForms.xml", "UpdateCalendarExceptionWeek", request, response); updateCalendarExceptionWeekWrapper.putInContext("calendarExceptionWeek", calendarExceptionWeek); Modified: ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy (original) +++ ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/contact/GetContactListMarketingEmail.groovy Sat Dec 20 04:31:20 2014 @@ -19,7 +19,7 @@ // figure out the MARKETING_EMAIL of the ContactList owner, for setting in the send email link if (!contactList && contactListId) { - contactList = delegator.findOne("ContactList", [contactListId : "contactListId"], true); + contactList = from("ContactList").where("contactListId", "contactListId").cache(true).queryOne(); } if (contactList) { ownerParty = contactList.getRelatedOne("OwnerParty", false); Modified: ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/EmailStatusReport.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/EmailStatusReport.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/EmailStatusReport.groovy (original) +++ ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/EmailStatusReport.groovy Sat Dec 20 04:31:20 2014 @@ -42,7 +42,6 @@ if (roleStatusId) { conditionList.add(EntityCondition.makeCondition("roleStatusId", EntityOperator.EQUALS, roleStatusId)); } conditionList.add(EntityCondition.makeCondition("roleTypeId", EntityOperator.EQUALS, "ADDRESSEE")); -conditions = EntityCondition.makeCondition(conditionList, EntityOperator.AND); -commStatausList = delegator.findList("CommunicationEventAndRole", conditions, null, null, null, false); +commStatausList = from("CommunicationEventAndRole").where(conditionList).queryList(); context.commStatausList = commStatausList; Modified: ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/MarketingCampaignReport.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/MarketingCampaignReport.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/MarketingCampaignReport.groovy (original) +++ ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/MarketingCampaignReport.groovy Sat Dec 20 04:31:20 2014 @@ -40,11 +40,8 @@ if (marketingCampaignId) { orderConditionList.add(EntityCondition.makeCondition("marketingCampaignId", EntityOperator.EQUALS, marketingCampaignId)); } -visitConditions = EntityCondition.makeCondition(visitConditionList, EntityOperator.AND); -orderConditions = EntityCondition.makeCondition(orderConditionList, EntityOperator.AND); - -visits = delegator.findList("MarketingCampaignAndVisit", visitConditions, ['marketingCampaignId', 'visitId'] as Set, ['marketingCampaignId'], null, false); -orders = delegator.findList("MarketingCampaignAndOrderHeader", orderConditions, ['marketingCampaignId', 'orderId', 'grandTotal'] as Set, ['marketingCampaignId'], null, false); +visits = select("marketingCampaignId", "visitId").from("MarketingCampaignAndVisit").where(visitConditionList).orderBy("marketingCampaignId").queryList(); +orders = select("marketingCampaignId", "orderId", "grandTotal").from("MarketingCampaignAndOrderHeader").where(orderConditionList).orderBy("marketingCampaignId").queryList(); //use this helper to build a List of visits, orders, order totals, and conversion rates marketingCampaignVisitAndOrders = ReportHelper.calcConversionRates(visits, orders, "marketingCampaignId"); Modified: ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/PartyStatusReport.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/PartyStatusReport.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/PartyStatusReport.groovy (original) +++ ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/PartyStatusReport.groovy Sat Dec 20 04:31:20 2014 @@ -36,6 +36,5 @@ if (contactListId) { if (statusId) { conditionList.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, statusId)); } -conditions = EntityCondition.makeCondition(conditionList, EntityOperator.AND); -partyStatusLists = delegator.findList("ContactListPartyStatus", conditions, null, null, null, false); +partyStatusLists = from("ContactListPartyStatus").where(conditionList).queryList(); context.partyStatusLists = partyStatusLists; Modified: ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy (original) +++ ofbiz/trunk/applications/marketing/webapp/marketing/WEB-INF/actions/reports/TrackingCodeReport.groovy Sat Dec 20 04:31:20 2014 @@ -42,11 +42,8 @@ if (trackingCodeId) { orderConditionList.add(EntityCondition.makeCondition("trackingCodeId", EntityOperator.EQUALS, trackingCodeId)); } -visitConditions = EntityCondition.makeCondition(visitConditionList, EntityOperator.AND); -orderConditions = EntityCondition.makeCondition(orderConditionList, EntityOperator.AND); - -visits = delegator.findList("TrackingCodeAndVisit", visitConditions, ['trackingCodeId', 'visitId'] as Set, ['trackingCodeId'], null, false); -orders = delegator.findList("TrackingCodeAndOrderHeader", orderConditions, ['trackingCodeId', 'orderId', 'grandTotal'] as Set, ['trackingCodeId'], null, false); +visits = select("trackingCodeId", "visitId").from("TrackingCodeAndVisit").where(visitConditionList).orderBy("trackingCodeId").queryList(); +orders = select("trackingCodeId", "orderId", "grandTotal").from("TrackingCodeAndOrderHeader").where(orderConditionList).orderBy("trackingCodeId").queryList(); // use this helper to build a List of visits, orders, order totals, and conversion rates trackingCodeVisitAndOrders = ReportHelper.calcConversionRates(visits, orders, "trackingCodeId"); Modified: ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/CloneLead.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/CloneLead.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/CloneLead.groovy (original) +++ ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/CloneLead.groovy Sat Dec 20 04:31:20 2014 @@ -23,15 +23,17 @@ import org.ofbiz.party.contact.ContactHe partyId = parameters.partyId; if (partyId) { - party = delegator.findOne("Party", [partyId : partyId], false); + party = from("Party").where("partyId", partyId).queryOne(); person = party.getRelatedOne("Person", false); contactDetailMap = [partyId : partyId, firstName : person.firstName, lastName : person.lastName, suffix : person.suffix]; - partyRelationship = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findList("PartyRelationship", - EntityCondition.makeCondition([partyIdTo : partyId, roleTypeIdTo : 'EMPLOYEE', roleTypeIdFrom : 'LEAD', partyRelationshipTypeId : 'EMPLOYMENT']), - null, ['-fromDate'], null, false))); + partyRelationship = from("PartyRelationship") + .where("partyIdTo", partyId, "roleTypeIdTo", "EMPLOYEE", "roleTypeIdFrom", "LEAD", "partyRelationshipTypeId", "EMPLOYMENT") + .orderBy("-fromDate") + .filterByDate() + .queryFirst(); if (partyRelationship) { contactDetailMap.title = partyRelationship.positionTitle; - partyGroup = delegator.findOne("PartyGroup", [partyId : partyRelationship.partyIdFrom], false); + partyGroup = from("PartyGroup").where("partyId", partyRelationship.partyIdFrom).queryOne(); if (partyGroup) { if (partyGroup.groupName) { contactDetailMap.groupName = partyGroup.groupName; Modified: ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/MergeContacts.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/MergeContacts.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/MergeContacts.groovy (original) +++ ofbiz/trunk/applications/marketing/webapp/sfa/WEB-INF/action/MergeContacts.groovy Sat Dec 20 04:31:20 2014 @@ -27,7 +27,7 @@ partyIdTo = parameters.partyIdTo; if (partyIdFrom && partyIdTo) { partyList = [partyIdTo, partyIdFrom]; partyList.each { partyId -> - party = delegator.findOne("Party", [partyId : partyId], false); + party = from("Party").where("partyId", partyId).queryOne(); person = party.getRelatedOne("Person", false); contactDetailMap = [partyId : partyId, firstName : person.firstName, lastName : person.lastName]; @@ -42,10 +42,10 @@ if (partyIdFrom && partyIdTo) { if (address2) { contactDetailMap.address2 = address2; } - geo = delegator.findOne("Geo", [geoId : postalAddress.stateProvinceGeoId], false); + geo = sfrom("Geo").where("geoId", postalAddress.stateProvinceGeoId).queryOne(); contactDetailMap.state = geo.geoName; - geo = delegator.findOne("Geo", [geoId : postalAddress.countryGeoId], false); + geo = from("Geo").where("geoId", postalAddress.countryGeoId).queryOne(); contactDetailMap.country = geo.geoName; } } Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/AddGiftCertificates.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/AddGiftCertificates.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/AddGiftCertificates.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/AddGiftCertificates.groovy Sat Dec 20 04:31:20 2014 @@ -30,14 +30,14 @@ if (productStoreId == null) { // Get Gift cards availbale in data -giftCardCategories = delegator.findList("ProductCategory", EntityCondition.makeCondition("productCategoryTypeId", EntityOperator.EQUALS, "GIFT_CARD_CATEGORY"), null, null, null, false); +giftCardCategories = from("ProductCategory").where("productCategoryTypeId", "GIFT_CARD_CATEGORY").queryList(); giftCardProductList = FastList.newInstance(); if (UtilValidate.isNotEmpty(giftCardCategories)) { giftCardCategories.each { giftCardCategory -> - giftCardCategoryMembers = delegator.findList("ProductCategoryMember", EntityCondition.makeCondition("productCategoryId", EntityOperator.EQUALS, giftCardCategory.productCategoryId), null, null, null, false); + giftCardCategoryMembers = from("ProductCategoryMember").where("productCategoryId", giftCardCategory.productCategoryId).queryList(); if (UtilValidate.isNotEmpty(giftCardCategoryMembers)) { giftCardCategoryMembers.each { giftCardCategoryMember -> - giftCardProducts = delegator.findList("ProductAndPriceView", EntityCondition.makeCondition("productId", EntityOperator.EQUALS, giftCardCategoryMember.productId), null, null, null, false); + giftCardProducts = from("ProductAndPriceView").where("productId", giftCardCategoryMember.productId).queryList(); if (UtilValidate.isNotEmpty(giftCardProducts)) { giftCardProducts.each { giftCardProduct -> giftCardProductList.add(giftCardProduct); @@ -51,6 +51,6 @@ context.giftCardProductList = giftCardPr // Get Survey Id for Gift Certificates -productStoreFinActSetting = delegator.findOne("ProductStoreFinActSetting", [productStoreId : productStoreId, finAccountTypeId : "GIFTCERT_ACCOUNT"], false); +productStoreFinActSetting = from("ProductStoreFinActSetting").where("productStoreId", productStoreId, "finAccountTypeId", "GIFTCERT_ACCOUNT").queryOne(); context.surveyId = productStoreFinActSetting.purchaseSurveyId; Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/AdditionalPartyListing.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/AdditionalPartyListing.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/AdditionalPartyListing.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/AdditionalPartyListing.groovy Sat Dec 20 04:31:20 2014 @@ -29,12 +29,12 @@ roleData = [:]; partyData = [:]; additionalPartyRole.each { roleTypeId, partyList -> - roleData[roleTypeId] = delegator.findOne("RoleType", [roleTypeId : roleTypeId], true); + roleData[roleTypeId] = from("RoleType").where("roleTypeId", roleTypeId).queryOne(); partyList.each { partyId -> partyMap = [:]; partyMap.partyId = partyId; - party = delegator.findOne("Party", [partyId : partyId], true); + party = from("Party").where("partyId", partyId).cache(true).queryOne(); if (party.partyTypeId.equals("PERSON")) { party = party.getRelatedOne("Person", true); partyMap.type = "person"; Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/BillSettings.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/BillSettings.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/BillSettings.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/BillSettings.groovy Sat Dec 20 04:31:20 2014 @@ -41,7 +41,7 @@ if (newPaymentMethodId) { } if (orderPartyId && !orderPartyId.equals("_NA_")) { - orderParty = delegator.findOne("Party", [partyId : orderPartyId], false); + orderParty = from("Party").where("partyId", orderPartyId).queryOne(); orderPerson = orderParty.getRelatedOne("Person", false); context.orderParty = orderParty; context.orderPerson = orderPerson; @@ -58,7 +58,7 @@ if (orderPartyId && !orderPartyId.equals if (request.getParameter("useShipAddr") && cart.getShippingContactMechId()) { shippingContactMech = cart.getShippingContactMechId(); - postalAddress = delegator.findOne("PostalAddress", [contactMechId : shippingContactMech], false); + postalAddress = from("PostalAddress").where("contactMechId", shippingContactMech).queryOne(); context.postalFields = postalAddress; } else { context.postalFields = UtilHttp.getParameterMap(request); @@ -69,7 +69,7 @@ if (cart) { checkOutPaymentId = cart.getPaymentMethodIds().get(0); context.checkOutPaymentId = checkOutPaymentId; if (!orderParty) { - paymentMethod = delegator.findOne("PaymentMethod", [paymentMethodId : checkOutPaymentId], false); + paymentMethod = from("PaymentMethod").where("paymentMethodId", checkOutPaymentId).queryOne(); if ("CREDIT_CARD".equals(paymentMethod?.paymentMethodTypeId)) { paymentMethodType = "CC"; account = paymentMethod.getRelatedOne("CreditCard", false); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckInits.groovy Sat Dec 20 04:31:20 2014 @@ -34,29 +34,29 @@ productStore = ProductStoreWorker.getPro if (productStore) { context.defaultProductStore = productStore; if (productStore.defaultSalesChannelEnumId) - context.defaultSalesChannel = delegator.findOne("Enumeration", [enumId : productStore.defaultSalesChannelEnumId], true); + context.defaultSalesChannel = from("Enumeration").where("enumId", productStore.defaultSalesChannelEnumId).cache(true).queryOne(); } // Get the Cart shoppingCart = session.getAttribute("shoppingCart"); context.shoppingCart = shoppingCart; -salesChannels = delegator.findByAnd("Enumeration", [enumTypeId : "ORDER_SALES_CHANNEL"], ["sequenceId"], true); +salesChannels = from("Enumeration").where("enumTypeId", "ORDER_SALES_CHANNEL").orderBy("sequenceId").cache(true).queryList(); context.salesChannels = salesChannels; -productStores = delegator.findList("ProductStore", null, null, ["productStoreId", "storeName"], null, true); +productStores = from("ProductStore").orderBy("productStoreId", "storeName").cache(true).queryList(); context.productStores = productStores; -suppliers = delegator.findByAnd("PartyRoleAndPartyDetail", [roleTypeId : "SUPPLIER"], ["groupName", "partyId"], false); +suppliers = from("PartyRoleAndPartyDetail").where("roleTypeId", "SUPPLIER").orderBy("groupName", "partyId").queryList(); context.suppliers = suppliers; -organizations = delegator.findByAnd("PartyAcctgPrefAndGroup", null, null, false); +organizations = from("PartyAcctgPrefAndGroup").queryList(); context.organizations = organizations; // Set Shipping From the Party partyId = null; partyId = parameters.partyId; if (partyId) { - party = delegator.findOne("Person", [partyId : partyId], false); + party = from("Person").where("partyId", partyId).queryOne(); if (party) { contactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false)); if (contactMech) { Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutOptions.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutOptions.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutOptions.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutOptions.groovy Sat Dec 20 04:31:20 2014 @@ -28,7 +28,7 @@ import org.ofbiz.order.shoppingcart.ship shoppingCart = session.getAttribute("shoppingCart"); currencyUomId = shoppingCart.getCurrency(); partyId = shoppingCart.getPartyId(); -party = delegator.findOne("Party", [partyId : partyId], true); +party = from("Party").where("partyId", partyId).cache(true).queryOne(); productStore = ProductStoreWorker.getProductStore(request); shippingEstWpr = null; @@ -40,14 +40,14 @@ if (shoppingCart) { shoppingCart.createDropShipGroups(dispatcher); } -profiledefs = delegator.findOne("PartyProfileDefault", [partyId : userLogin.partyId, productStoreId : productStoreId], false); +profiledefs = from("PartyProfileDefault").where("partyId", userLogin.partyId, "productStoreId", productStoreId).queryOne(); context.profiledefs = profiledefs; context.shoppingCart = shoppingCart; context.userLogin = userLogin; context.productStoreId = productStore.get("productStoreId"); context.productStore = productStore; -shipToParty = delegator.findOne("Party", [partyId : shoppingCart.getShipToCustomerPartyId()], true); +shipToParty = from("Party").where("partyId", shoppingCart.getShipToCustomerPartyId()).cache(true).queryOne(); context.shippingContactMechList = ContactHelper.getContactMech(shipToParty, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false); context.emailList = ContactHelper.getContactMechByType(party, "EMAIL_ADDRESS", false); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutPayment.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutPayment.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutPayment.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutPayment.groovy Sat Dec 20 04:31:20 2014 @@ -28,7 +28,7 @@ cart = session.getAttribute("shoppingCar currencyUomId = cart.getCurrency(); userLogin = session.getAttribute("userLogin"); partyId = cart.getPartyId(); -party = delegator.findOne("Party", [partyId : partyId], true); +party = from("Party").where("partyId", partyId).cache(true).queryOne(); productStoreId = ProductStoreWorker.getProductStoreId(request); checkOutPaymentId = ""; @@ -40,9 +40,7 @@ if (cart) { } } -finAccounts = delegator.findByAnd("FinAccountAndRole", [partyId : partyId, roleTypeId : "OWNER"], null, false); -finAccounts = EntityUtil.filterByDate(finAccounts, UtilDateTime.nowTimestamp(), "roleFromDate", "roleThruDate", true); -finAccounts = EntityUtil.filterByDate(finAccounts); +finAccounts = from("FinAccountAndRole").where("partyId", partyId, "roleTypeId", "OWNER").filterByDate(UtilDateTime.nowTimestamp(), "fromDate", "thruDate", "roleFromDate", "roleThruDate").queryList(); context.finAccounts = finAccounts; context.shoppingCart = cart; Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutReview.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutReview.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutReview.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutReview.groovy Sat Dec 20 04:31:20 2014 @@ -87,7 +87,7 @@ paymentMethodType = null; paymentMethodTypeId = null; if (paymentMethodTypeIds) { paymentMethodTypeId = paymentMethodTypeIds.get(0); - paymentMethodType = delegator.findOne("PaymentMethodType", [paymentMethodTypeId : paymentMethodTypeId], false); + paymentMethodType = from("PaymentMethodType").where("paymentMethodTypeId", paymentMethodTypeId).queryOne(); context.paymentMethodType = paymentMethodType; } @@ -107,7 +107,7 @@ if (paymentMethod) { } if (billingAddress) context.billingAddress = billingAddress; -billingAccount = cart.getBillingAccountId() ? delegator.findOne("BillingAccount", [billingAccountId : cart.getBillingAccountId()], false) : null; +billingAccount = cart.getBillingAccountId() ? from("BillingAccount").where("billingAccountId", cart.getBillingAccountId()).queryOne() : null; if (billingAccount) context.billingAccount = billingAccount; context.customerPoNumber = cart.getPoNumber(); @@ -120,7 +120,7 @@ context.isGift = cart.getIsGift(); context.shipBeforeDate = cart.getShipBeforeDate(); context.shipAfterDate = cart.getShipAfterDate(); -shipmentMethodType = delegator.findOne("ShipmentMethodType", [shipmentMethodTypeId : cart.getShipmentMethodTypeId()], false); +shipmentMethodType = from("ShipmentMethodType").where("shipmentMethodTypeId", cart.getShipmentMethodTypeId()).queryOne(); if (shipmentMethodType) context.shipMethDescription = shipmentMethodType.description; orh = new OrderReadHelper(orderAdjustments, orderItems); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutShippingAddress.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutShippingAddress.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutShippingAddress.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/CheckoutShippingAddress.groovy Sat Dec 20 04:31:20 2014 @@ -44,11 +44,7 @@ for (shipGroupIndex = 0; shipGroupIndex supplierPartyId = cart.getSupplierPartyId(shipGroupIndex); context[shipGroupIndex + "_supplierPartyId"] = supplierPartyId; } -exprs = FastList.newInstance(); -exprs.add(EntityCondition.makeCondition("partyIdTo", EntityOperator.EQUALS, payToPartyId)); -exprs.add(EntityCondition.makeCondition("partyIdFrom", EntityOperator.EQUALS, partyId)); -agreements = delegator.findList("Agreement", EntityCondition.makeCondition(exprs, EntityOperator.AND), null, null, null, true); -agreements = EntityUtil.filterByDate(agreements); +agreements = from("Agreement").where("partyIdTo", payToPartyId, "partyIdFrom", partyId).filterByDate().cache(true).queryList(); context.agreements = agreements; context.shoppingCart = cart; Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OptionSettings.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OptionSettings.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OptionSettings.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OptionSettings.groovy Sat Dec 20 04:31:20 2014 @@ -30,7 +30,7 @@ context.cart = cart; productStore = ProductStoreWorker.getProductStore(request); if (productStore) { context.productStore = productStore; - context.carrierShipmentMethodList = delegator.findByAnd('ProductStoreShipmentMethView', [productStoreId: productStore.productStoreId], ['sequenceNumber'], true); + context.carrierShipmentMethodList = from("ProductStoreShipmentMethView").where("productStoreId", productStore.productStoreId).orderBy("sequenceNumber").cache(true).queryList(); } // nuke the event messages @@ -39,7 +39,7 @@ request.removeAttribute("_EVENT_MESSAGE_ party = null; orderPartyIdId = cart.getPartyId(); if (orderPartyIdId) { - orderPartyId = delegator.findOne("Party", [partyId : orderPartyIdId], false); + orderPartyId = from("Party").where("partyId", orderPartyIdId).queryOne(); context.orderPartyId = orderPartyId; } Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OrderAgreements.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OrderAgreements.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OrderAgreements.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OrderAgreements.groovy Sat Dec 20 04:31:20 2014 @@ -64,13 +64,12 @@ if ('PURCHASE_ORDER'.equals(shoppingCart } -agreements = delegator.findList('Agreement', agreementCondition, null, null, null, true); -agreements = EntityUtil.filterByDate(agreements); +agreements = from("Agreement").where(agreementCondition).filterByDate().cache(true).queryList(); if (agreements) { context.agreements = agreements; } -agreementRoles = delegator.findList('AgreementRole', agreementRoleCondition, null, null, null, true); +agreementRoles = from("AgreementRole").where(agreementRoleCondition).cache(true).queryList(); if (agreementRoles) { context.agreementRoles = agreementRoles; } @@ -92,5 +91,5 @@ if (catalogCol) { } // currencies and shopping cart currency -context.currencies = delegator.findByAnd('Uom', [uomTypeId: 'CURRENCY_MEASURE'], null, true); +context.currencies = from("Uom").where("uomTypeId", "CURRENCY_MEASURE").cache(true).queryList(); context.currencyUomId = shoppingCart.getCurrency(); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OrderTerms.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OrderTerms.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OrderTerms.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OrderTerms.groovy Sat Dec 20 04:31:20 2014 @@ -52,4 +52,4 @@ if (request.getParameter('createNew') == } -context.termTypes = delegator.findList('TermType', null, null, null, null, false); +context.termTypes = from("TermType").queryList(); \ No newline at end of file Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetAdditionalParty.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetAdditionalParty.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetAdditionalParty.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SetAdditionalParty.groovy Sat Dec 20 04:31:20 2014 @@ -32,7 +32,7 @@ if (!request.getParameterValues("additio additionalPartyId = request.getParameter("additionalPartyId"); context.additionalPartyId = additionalPartyId; - roles = delegator.findByAnd("PartyRole", [partyId : additionalPartyId], null, false); + roles = from("PartyRole").where("partyId", additionalPartyId).queryList(); roleData = []; roles.each { role -> roleData.add(role.getRelatedOne("RoleType", false)); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShipSettings.groovy Sat Dec 20 04:31:20 2014 @@ -46,7 +46,7 @@ request.removeAttribute("_EVENT_MESSAGE_ if ("SALES_ORDER".equals(cart.getOrderType())) { if (!"_NA_".equals(orderPartyId)) { - orderParty = delegator.findOne("Party", [partyId : orderPartyId], false); + orderParty = from("Party").where("partyId", orderPartyId).queryOne(); if (orderParty) { shippingContactMechList = ContactHelper.getContactMech(orderParty, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false); orderPerson = orderParty.getRelatedOne("Person", false); @@ -57,7 +57,7 @@ if ("SALES_ORDER".equals(cart.getOrderTy } // Ship to another party if (shipToPartyId) { - shipToParty = delegator.findOne("Party", [partyId : shipToPartyId], false); + shipToParty = from("Party").where("partyId", shipToPartyId).queryOne(); if (shipToParty) { context.shipToParty = shipToParty; shipToPartyShippingContactMechList = ContactHelper.getContactMech(shipToParty, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false); @@ -65,16 +65,16 @@ if ("SALES_ORDER".equals(cart.getOrderTy } } // suppliers for the drop-ship select box - suppliers = delegator.findByAnd("PartyRole", [roleTypeId : "SUPPLIER"], null, false); + suppliers = from("PartyRole").where("roleTypeId", "SUPPLIER").queryList(); context.suppliers = suppliers; // facilities used to reserve the items per ship group - productStoreFacilities = delegator.findByAnd("ProductStoreFacility", [productStoreId : cart.getProductStoreId()], null, false); + productStoreFacilities = from("ProductStoreFacility").where("productStoreId", cart.getProductStoreId()).queryList(); context.productStoreFacilities = productStoreFacilities; } else { // Purchase order if (!"_NA_".equals(orderPartyId)) { - orderParty = delegator.findOne("Party", [partyId : orderPartyId], false); + orderParty = from("Party").where("partyId", orderPartyId).queryOne(); if (orderParty) { orderPerson = orderParty.getRelatedOne("Person", false); context.orderParty = orderParty; @@ -85,14 +85,14 @@ if ("SALES_ORDER".equals(cart.getOrderTy companyId = cart.getBillToCustomerPartyId(); if (companyId) { facilityMaps = FastList.newInstance(); - facilities = delegator.findByAnd("Facility", [ownerPartyId : companyId], null, true); + facilities = from("Facility").where("ownerPartyId", companyId).cache(true).queryList(); // if facilites is null then check the PartyRelationship where there is a relationship set for Parent & Child organization. Then also fetch the value of companyId from there. if (UtilValidate.isEmpty(facilities)) { - partyRelationship = EntityUtil.getFirst(delegator.findList("PartyRelationship", EntityCondition.makeCondition(["roleTypeIdFrom": "PARENT_ORGANIZATION", "partyIdTo": companyId]), null, null, null, false)); + partyRelationship = from("PartyRelationship").where("roleTypeIdFrom": "PARENT_ORGANIZATION", "partyIdTo": companyId).queryFirst(); if (UtilValidate.isNotEmpty(partyRelationship)) { companyId = partyRelationship.partyIdFrom; - facilities = delegator.findByAnd("Facility", [ownerPartyId : companyId], null, true); + facilities = from("Facility").where("ownerPartyId", companyId).cache(true).queryList(); } } facilities.each { facility -> @@ -106,7 +106,7 @@ if ("SALES_ORDER".equals(cart.getOrderTy } // Ship to another party if (shipToPartyId) { - shipToParty = delegator.findOne("Party", [partyId : shipToPartyId], false); + shipToParty = from("Party").where("partyId", shipToPartyId).queryOne(); if (shipToParty) { context.shipToParty = shipToParty; Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShoppingList.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShoppingList.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShoppingList.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShoppingList.groovy Sat Dec 20 04:31:20 2014 @@ -28,7 +28,7 @@ shoppingCart = session.getAttribute("sho partyId = shoppingCart.getPartyId(); // Get the party's collection of Shopping Lists -shoppingLists = delegator.findByAnd("ShoppingList", [partyId : partyId], null, true); +shoppingLists = from("ShoppingList").where("partyId", partyId).cache(true).queryList(); if (shoppingLists) { context.shoppingLists = shoppingLists; } Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/ShowCart.groovy Sat Dec 20 04:31:20 2014 @@ -53,7 +53,7 @@ context.currencyUomId = shoppingCart.get context.orderType = shoppingCart.getOrderType(); // get all the possible gift wrap options -allgiftWraps = delegator.findByAnd("ProductFeature", [productFeatureTypeId : "GIFT_WRAP"], ["defaultSequenceNum"], false); +allgiftWraps = from("ProductFeature").where("productFeatureTypeId", "GIFT_WRAP").orderBy("defaultSequenceNum").queryList(); context.allgiftWraps = allgiftWraps; context.contentPathPrefix = CatalogWorker.getContentPathPrefix(request); @@ -82,12 +82,12 @@ context.defaultComment = defaultComment; // get all party shopping lists if (partyId) { - shoppingLists = delegator.findByAnd("ShoppingList", [partyId : partyId], null, false); + shoppingLists = from("ShoppingList").where("partyId", partyId).queryList(); context.shoppingLists = shoppingLists; } // get product inventory summary for each shopping cart item -productStore = delegator.findOne("ProductStore", [productStoreId : productStoreId], true); +productStore = from("ProductStore").where("productStoreId", productStoreId).cache(true).queryOne(); context.productStore = productStore productStoreFacilityId = null; if (productStore) { @@ -101,5 +101,5 @@ context.mktgPkgATPMap = inventorySummary context.mktgPkgQOHMap = inventorySummary.mktgPkgQOHMap; // get purchase order item types -purchaseOrderItemTypeList = delegator.findByAnd("OrderItemType", [parentTypeId : "PURCHASE_SPECIFIC"], null, true); +purchaseOrderItemTypeList = from("OrderItemType").where("parentTypeId", "PURCHASE_SPECIFIC").cache(true).queryList(); context.purchaseOrderItemTypeList = purchaseOrderItemTypeList; Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SplitShip.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SplitShip.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SplitShip.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/SplitShip.groovy Sat Dec 20 04:31:20 2014 @@ -22,11 +22,12 @@ import org.ofbiz.product.store.ProductSt shoppingCart = session.getAttribute("shoppingCart"); partyId = shoppingCart.getPartyId(); -party = delegator.findOne("Party", [partyId : partyId], true); +party = from("Party").where("partyId", partyId).cache(true).queryOne(); productStoreId = ProductStoreWorker.getProductStoreId(request); context.cart = shoppingCart; context.shippingContactMechList = ContactHelper.getContactMech(party, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false); -profiledefs = delegator.findOne("PartyProfileDefault", [partyId : partyId, productStoreId : productStoreId], true); +profiledefs = from("PartyProfileDefault").where("partyId", partyId, "productStoreId", productStoreId).cache(true).queryOne(); + context.profileDefs = profiledefs; Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddProducts.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddProducts.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddProducts.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddProducts.groovy Sat Dec 20 04:31:20 2014 @@ -50,6 +50,5 @@ conditions = EntityCondition.makeConditi mainConditionList.add(orConditions); mainConditionList.add(conditions); -mainConditions = EntityCondition.makeCondition(mainConditionList, EntityOperator.AND); -context.productList = delegator.findList("Product", mainConditions, ["productId", "brandName", "internalName"] as Set, ["productId"], null, false); +context.productList = select("productId", "brandName", "internalName").from("Product").where(mainConditionList).orderBy("productId").queryList(); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/LookupBulkAddSupplierProducts.groovy Sat Dec 20 04:31:20 2014 @@ -48,11 +48,9 @@ supplierPartyId = null; orderId = parameters.orderId; if (orderId) { - orderItemShipGroup = EntityUtil.getFirst(delegator.findList("OrderItemShipGroup", null, null, ["orderId" , "orderId"], null, false)); - orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false); - EntityCondition cond = EntityCondition.makeCondition([EntityCondition.makeCondition("orderId", orderId), - EntityCondition.makeCondition("roleTypeId", "BILL_FROM_VENDOR")], EntityOperator.AND); - supplier = EntityUtil.getFirst(delegator.findList("OrderHeaderAndRoles", cond, null, null, null, false)); + orderItemShipGroup = from("OrderItemShipGroup").orderBy("orderId").queryFirst(); + orderHeader = from("OrderHeader").where("orderId", orderId).queryOne(); + supplier = from("OrderHeaderAndRoles").where("orderId", orderId, "roleTypeId", "BILL_FROM_VENDOR").queryFirst(); context.shipGroupSeqId = orderItemShipGroup.shipGroupSeqId ; context.orderHeader = orderHeader; } @@ -75,10 +73,11 @@ conditionList.add(EntityCondition.makeCo conditionList.add(EntityCondition.makeCondition("currencyUomId", EntityOperator.EQUALS, shoppingCart.getCurrency())); conditionList.add(EntityCondition.makeConditionDate("availableFromDate", "availableThruDate")); -conditions = EntityCondition.makeCondition(conditionList, EntityOperator.AND); -selectedFields = ["productId", "supplierProductId", "supplierProductName", "lastPrice", "minimumOrderQuantity", "orderQtyIncrements"] as Set; -supplierProducts = delegator.findList("SupplierProduct", conditions, selectedFields, ["productId"], null, false); +supplierProducts = select("productId", "supplierProductId", "supplierProductName", "lastPrice", "minimumOrderQuantity", "orderQtyIncrements").from("SupplierProduct") + .where(conditionList) + .orderBy("productId") + .queryList(); newProductList = []; for (supplierProduct in supplierProducts) { @@ -86,9 +85,9 @@ for (supplierProduct in supplierProducts String facilityId = parameters.facilityId; if (facilityId) { - productFacilityList = delegator.findByAnd("ProductFacility", ["productId": productId, "facilityId" : facilityId], null, true); + productFacilityList = from("ProductFacility").where("productId", productId, "facilityId", facilityId).cache(true).queryList(); } else { - productFacilityList = delegator.findByAnd("ProductFacility", ["productId": productId], null, true); + productFacilityList = from("ProductFacility").where("productId", productId).cache(true).queryList(); } if (newProductList.size() >= maxRows) { // We've got enough results to display, keep going to get the result size but skip the heavy stuff @@ -96,10 +95,7 @@ for (supplierProduct in supplierProducts } else { quantityOnOrder = 0.0; // find approved purchase orders - condition = EntityCondition.makeCondition(EntityCondition.makeCondition("orderTypeId", "PURCHASE_ORDER"), EntityOperator.AND, - EntityCondition.makeCondition("statusId", "ORDER_APPROVED")); - - orderHeaders = delegator.findList("OrderHeader", condition, null, ["orderId DESC"], null, false); + orderHeaders = from("OrderHeader").where("orderTypeId", "PURCHASE_ORDER", "statusId", "ORDER_APPROVED").orderBy("orderId DESC").queryList(); orderHeaders.each { orderHeader -> orderReadHelper = new OrderReadHelper(orderHeader); orderItems = orderReadHelper.getOrderItems(); @@ -113,7 +109,7 @@ for (supplierProduct in supplierProducts } } } - product = delegator.findOne("Product", ["productId" : productId], true); + product = from("Product").where("productId", productId).cache(true).queryOne(); productFacilityList.each { productFacility -> result = runService('getInventoryAvailableByFacility', ["productId" : productId, "facilityId" : productFacility.facilityId]); qohAtp = result.quantityOnHandTotal.toPlainString() + "/" + result.availableToPromiseTotal.toPlainString(); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/ShowPromotionDetails.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/ShowPromotionDetails.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/ShowPromotionDetails.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/cart/ShowPromotionDetails.groovy Sat Dec 20 04:31:20 2014 @@ -23,11 +23,11 @@ import org.ofbiz.order.shoppingcart.prod productPromoId = request.getParameter("productPromoId"); if (!productPromoId) productPromoId = parameters.productPromoId; -productPromo = delegator.findOne("ProductPromo", [productPromoId : productPromoId], false); +productPromo = from("ProductPromo").where("productPromoId", productPromoId).queryOne(); promoAutoDescription = ProductPromoWorker.makeAutoDescription(productPromo, delegator, locale); -productPromoCategoryList = delegator.findByAnd("ProductPromoCategory", [productPromoId : productPromoId], null, true); +productPromoCategoryList = from("ProductPromoCategory").where("productPromoId", productPromoId).cache(true).queryList(); productPromoCategoryIncludeList = EntityUtil.filterByAnd(productPromoCategoryList, [productPromoApplEnumId : "PPPA_INCLUDE"]); productPromoCategoryExcludeList = EntityUtil.filterByAnd(productPromoCategoryList, [productPromoApplEnumId : "PPPA_EXCLUDE"]); productPromoCategoryAlwaysList = EntityUtil.filterByAnd(productPromoCategoryList, [productPromoApplEnumId : "PPPA_ALWAYS"]); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/AdvancedSearchOptions.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/AdvancedSearchOptions.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/AdvancedSearchOptions.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/AdvancedSearchOptions.groovy Sat Dec 20 04:31:20 2014 @@ -34,12 +34,12 @@ if (!searchCategoryId) { currentCatalogId = CatalogWorker.getCurrentCatalogId(request); searchCategoryId = CatalogWorker.getCatalogSearchCategoryId(request, currentCatalogId); } -searchCategory = delegator.findOne("ProductCategory", [productCategoryId : searchCategoryId], false); +searchCategory = from("ProductCategory").where("productCategoryId", searchCategoryId).queryOne(); productFeaturesByTypeMap = ParametricSearch.makeCategoryFeatureLists(searchCategoryId, delegator); productFeatureTypeIdsOrdered = new TreeSet(productFeaturesByTypeMap.keySet()) as List; if(productFeatureTypeIdsOrdered) { - context.productFeatureTypes = delegator.findList("ProductFeatureType", EntityCondition.makeCondition("productFeatureTypeId", EntityOperator.IN, productFeatureTypeIdsOrdered), null, null, null, false); + context.productFeatureTypes = from("ProductFeatureType").where(EntityCondition.makeCondition("productFeatureTypeId", EntityOperator.IN, productFeatureTypeIdsOrdered)).queryList(); } searchOperator = parameters.SEARCH_OPERATOR; Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/Category.groovy Sat Dec 20 04:31:20 2014 @@ -60,22 +60,22 @@ if (productCategoryId) { } */ -category = delegator.findOne("ProductCategory", [productCategoryId : productCategoryId], true); +category = from("ProductCategory").where("productCategoryId", productCategoryId).cache(true).queryOne(); if (category) { if (category.detailScreen) { detailScreen = category.detailScreen; } - categoryPageTitle = delegator.findByAnd("ProductCategoryContentAndInfo", [productCategoryId : productCategoryId, prodCatContentTypeId : "PAGE_TITLE"], null, true); + categoryPageTitle = from("ProductCategoryContentAndInfo").where("productCategoryId", productCategoryId, "prodCatContentTypeId", "PAGE_TITLE").cache(true).queryList(); if (categoryPageTitle) { - pageTitle = delegator.findOne("ElectronicText", [dataResourceId : categoryPageTitle.get(0).dataResourceId], true); + pageTitle = from("ElectronicText").where("dataResourceId", categoryPageTitle.get(0).dataResourceId).cache(true).queryOne(); } - categoryMetaDescription = delegator.findByAnd("ProductCategoryContentAndInfo", [productCategoryId : productCategoryId, prodCatContentTypeId : "META_DESCRIPTION"], null, true); + categoryMetaDescription = from("ProductCategoryContentAndInfo").where("productCategoryId", productCategoryId, "prodCatContentTypeId", "META_DESCRIPTION").cache(true).queryList(); if (categoryMetaDescription) { - metaDescription = delegator.findOne("ElectronicText", [dataResourceId : categoryMetaDescription.get(0).dataResourceId], true); + metaDescription = from("ElectronicText").where("dataResourceId", categoryMetaDescription.get(0).dataResourceId).cache(true).queryOne(); } - categoryMetaKeywords = delegator.findByAnd("ProductCategoryContentAndInfo", [productCategoryId : productCategoryId, prodCatContentTypeId : "META_KEYWORD"], null, true); + categoryMetaKeywords = from("ProductCategoryContentAndInfo").where("productCategoryId", productCategoryId, "prodCatContentTypeId", "META_KEYWORD").cache(true).queryList(); if (categoryMetaKeywords) { - metaKeywords = delegator.findOne("ElectronicText", [dataResourceId : categoryMetaKeywords.get(0).dataResourceId], true); + metaKeywords = from("ElectronicText").where("dataResourceId", categoryMetaKeywords.get(0).dataResourceId).cache(true).queryOne(); } categoryContentWrapper = new CategoryContentWrapper(category, request); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CompareProducts.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CompareProducts.groovy?rev=1646916&r1=1646915&r2=1646916&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CompareProducts.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/CompareProducts.groovy Sat Dec 20 04:31:20 2014 @@ -61,8 +61,7 @@ compareList.each { product -> EntityUtil.getFilterByDateExpr(), EntityCondition.makeCondition("productFeatureApplTypeId", EntityOperator.IN, ["STANDARD_FEATURE", "DISTINGUISHING_FEAT", "SELECTABLE_FEATURE"]) ]; - cond = EntityCondition.makeCondition(condList); - productFeatureAppls = delegator.findList("ProductFeatureAppl", cond, null, ["sequenceNum"], null, true); + productFeatureAppls = from("ProductFeatureAppl").where(condList).orderBy("sequenceNum").cache(true).queryList(); productFeatureAppls.each { productFeatureAppl -> productFeature = productFeatureAppl.getRelatedOne("ProductFeature", true); if (!productData[productFeature.productFeatureTypeId]) { @@ -76,5 +75,5 @@ compareList.each { product -> } } productFeatureTypeIds.each { productFeatureTypeId -> - productFeatureTypeMap[productFeatureTypeId] = delegator.findOne("ProductFeatureType", [productFeatureTypeId : productFeatureTypeId], true); + productFeatureTypeMap[productFeatureTypeId] = from("ProductFeatureType").where("productFeatureTypeId", productFeatureTypeId).cache(true).queryOne(); } |
Free forum by Nabble | Edit this page |