Modified: ofbiz/trunk/applications/manufacturing/groovyScripts/reports/PackageContentsAndOrder.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/groovyScripts/reports/PackageContentsAndOrder.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/groovyScripts/reports/PackageContentsAndOrder.groovy (original) +++ ofbiz/trunk/applications/manufacturing/groovyScripts/reports/PackageContentsAndOrder.groovy Wed Nov 2 19:09:13 2016 @@ -20,49 +20,49 @@ // PackageContentsAndOrder // ReportB -import org.apache.ofbiz.entity.util.EntityUtil; -import org.apache.ofbiz.order.order.OrderReadHelper; -import org.apache.ofbiz.order.order.OrderContentWrapper; +import org.apache.ofbiz.entity.util.EntityUtil +import org.apache.ofbiz.order.order.OrderReadHelper +import org.apache.ofbiz.order.order.OrderContentWrapper if (productCategoryIdPar) { - category = from("ProductCategory").where("productCategoryId", productCategoryIdPar).queryOne(); - context.category = category; + category = from("ProductCategory").where("productCategoryId", productCategoryIdPar).queryOne() + context.category = category } if (productFeatureTypeIdPar) { - featureType = from("ProductFeatureType").where("productFeatureTypeId", productFeatureTypeIdPar).queryOne(); - context.featureType = featureType; + featureType = from("ProductFeatureType").where("productFeatureTypeId", productFeatureTypeIdPar).queryOne() + context.featureType = featureType } -packageContents = from("ShipmentPackageContent").where("shipmentId", shipmentId).queryList(); +packageContents = from("ShipmentPackageContent").where("shipmentId", shipmentId).queryList() -packagesMap = [:]; +packagesMap = [:] if (packageContents) { packageContents.each { packageContent -> - 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); + 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) { if (!isProductInCategory(delegator, product.productId, productCategoryIdPar)) { // the production run's product is not a member of the given category, skip it - return; + return } } if (!packagesMap.containsKey(packageContent.shipmentPackageSeqId)) { - OrderReadHelper orh = new OrderReadHelper(delegator, orderItem.orderId); + OrderReadHelper orh = new OrderReadHelper(delegator, orderItem.orderId) packagesMap.put(packageContent.shipmentPackageSeqId, [packageId : packageContent.shipmentPackageSeqId, party : orh.getPlacingParty(), address : orh.getShippingAddress(), orderHeader : orh.getOrderHeader(), orderShipment : orderShipment, - components : []]); + components : []]) } - OrderContentWrapper orderContentWrapper = OrderContentWrapper.makeOrderContentWrapper(orderItem, request); + OrderContentWrapper orderContentWrapper = OrderContentWrapper.makeOrderContentWrapper(orderItem, request) String imageUrl = orderContentWrapper.get("IMAGE_URL", "url") - packageMap = (Map)packagesMap.packageContent.shipmentPackageSeqId; - components = (List)packageMap.components; - components.add([product : product, orderItem : orderItem, imageUrl : imageUrl]); + packageMap = (Map)packagesMap.packageContent.shipmentPackageSeqId + components = (List)packageMap.components + components.add([product : product, orderItem : orderItem, imageUrl : imageUrl]) } } -context.packages = packagesMap.values(); +context.packages = packagesMap.values() Modified: ofbiz/trunk/applications/manufacturing/groovyScripts/reports/ShipmentLabel.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/groovyScripts/reports/ShipmentLabel.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/groovyScripts/reports/ShipmentLabel.groovy (original) +++ ofbiz/trunk/applications/manufacturing/groovyScripts/reports/ShipmentLabel.groovy Wed Nov 2 19:09:13 2016 @@ -17,73 +17,73 @@ * under the License. */ -import org.apache.ofbiz.entity.util.EntityUtil; -import org.apache.ofbiz.order.order.OrderReadHelper; +import org.apache.ofbiz.entity.util.EntityUtil +import org.apache.ofbiz.order.order.OrderReadHelper -shipmentId = parameters.shipmentId; -shipment = from("Shipment").where("shipmentId", shipmentId).queryOne(); +shipmentId = parameters.shipmentId +shipment = from("Shipment").where("shipmentId", shipmentId).queryOne() -context.shipmentIdPar = shipment.shipmentId; +context.shipmentIdPar = shipment.shipmentId if (shipment) { - shipmentPackages = from("ShipmentPackage").where("shipmentId", shipmentId).queryList(); - records = []; - orderReaders = [:]; + shipmentPackages = from("ShipmentPackage").where("shipmentId", shipmentId).queryList() + records = [] + orderReaders = [:] shipmentPackages.each { shipmentPackage -> - shipmentPackageComponents = from("ShipmentPackageContent").where("shipmentId", shipmentId, "shipmentPackageSeqId", shipmentPackage.shipmentPackageSeqId).queryList();; + 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); - orderShipment = EntityUtil.getFirst(orderShipments); + shipmentItem = shipmentPackageComponent.getRelatedOne("ShipmentItem", false) + orderShipments = shipmentItem.getRelated("OrderShipment", null, null, false) + orderShipment = EntityUtil.getFirst(orderShipments) - String orderId = null; - String orderItemSeqId = null; + String orderId = null + String orderItemSeqId = null if (orderShipment) { - orderId = orderShipment.orderId; - orderItemSeqId = orderShipment.orderItemSeqId; + orderId = orderShipment.orderId + orderItemSeqId = orderShipment.orderItemSeqId } - record = [:]; + record = [:] if (shipmentPackageComponent.subProductId) { - record.productId = shipmentPackageComponent.subProductId; - record.quantity = shipmentPackageComponent.subQuantity; + record.productId = shipmentPackageComponent.subProductId + record.quantity = shipmentPackageComponent.subQuantity } else { - record.productId = shipmentItem.productId; - record.quantity = shipmentPackageComponent.quantity; + record.productId = shipmentItem.productId + record.quantity = shipmentPackageComponent.quantity } - record.shipmentPackageSeqId = shipmentPackageComponent.shipmentPackageSeqId; - record.orderId = orderId; - record.orderItemSeqId = orderItemSeqId; - product = from("Product").where("productId", record.productId).queryOne(); - record.productName = product.internalName; - record.shipDate = shipment.estimatedShipDate; + record.shipmentPackageSeqId = shipmentPackageComponent.shipmentPackageSeqId + record.orderId = orderId + record.orderItemSeqId = orderItemSeqId + product = from("Product").where("productId", record.productId).queryOne() + record.productName = product.internalName + record.shipDate = shipment.estimatedShipDate // --- - orderReadHelper = null; + orderReadHelper = null if (orderReaders.containsKey(orderId)) { - orderReadHelper = (OrderReadHelper)orderReaders.get(orderId); + orderReadHelper = (OrderReadHelper)orderReaders.get(orderId) } else { - orderHeader = from("OrderHeader").where("orderId", orderId).queryOne(); - orderReadHelper = new OrderReadHelper(orderHeader); - orderReaders.put(orderId, orderReadHelper); + orderHeader = from("OrderHeader").where("orderId", orderId).queryOne() + orderReadHelper = new OrderReadHelper(orderHeader) + orderReaders.put(orderId, orderReadHelper) } - displayParty = orderReadHelper.getPlacingParty(); - shippingAddress = orderReadHelper.getShippingAddress(); - record.shippingAddressName = shippingAddress.toName; - record.shippingAddressAddress = shippingAddress.address1; - record.shippingAddressCity = shippingAddress.city; - record.shippingAddressPostalCode = shippingAddress.postalCode; - record.shippingAddressCountry = shippingAddress.countryGeoId; - records.add(record); + displayParty = orderReadHelper.getPlacingParty() + shippingAddress = orderReadHelper.getShippingAddress() + record.shippingAddressName = shippingAddress.toName + record.shippingAddressAddress = shippingAddress.address1 + record.shippingAddressCity = shippingAddress.city + record.shippingAddressPostalCode = shippingAddress.postalCode + record.shippingAddressCountry = shippingAddress.countryGeoId + records.add(record) } } - context.records = records; + context.records = records // check permission - hasPermission = false; + hasPermission = false if (security.hasEntityPermission("MANUFACTURING", "_VIEW", session)) { - hasPermission = true; + hasPermission = true } - context.hasPermission = hasPermission; + context.hasPermission = hasPermission } -return "success"; +return "success" Modified: ofbiz/trunk/applications/manufacturing/groovyScripts/reports/ShipmentPlanStockReport.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/groovyScripts/reports/ShipmentPlanStockReport.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/groovyScripts/reports/ShipmentPlanStockReport.groovy (original) +++ ofbiz/trunk/applications/manufacturing/groovyScripts/reports/ShipmentPlanStockReport.groovy Wed Nov 2 19:09:13 2016 @@ -17,78 +17,78 @@ * under the License. */ -import org.apache.ofbiz.entity.*; -import org.apache.ofbiz.base.util.*; +import org.apache.ofbiz.entity.* +import org.apache.ofbiz.base.util.* -inventoryStock = [:]; -shipmentId = parameters.shipmentId; -shipment = from("Shipment").where("shipmentId", shipmentId).queryOne(); - -context.shipmentIdPar = shipment.shipmentId; -context.estimatedReadyDatePar = shipment.estimatedReadyDate; -context.estimatedShipDatePar = shipment.estimatedShipDate; -records = []; +inventoryStock = [:] +shipmentId = parameters.shipmentId +shipment = from("Shipment").where("shipmentId", shipmentId).queryOne() + +context.shipmentIdPar = shipment.shipmentId +context.estimatedReadyDatePar = shipment.estimatedReadyDate +context.estimatedShipDatePar = shipment.estimatedShipDate +records = [] if (shipment) { - shipmentPlans = from("OrderShipment").where("shipmentId", shipmentId).queryList(); + shipmentPlans = from("OrderShipment").where("shipmentId", shipmentId).queryList() shipmentPlans.each { shipmentPlan -> - orderLine = from("OrderItem").where("orderId", shipmentPlan.orderId , "orderItemSeqId", shipmentPlan.orderItemSeqId).queryOne(); - recordGroup = [:]; - recordGroup.ORDER_ID = shipmentPlan.orderId; - recordGroup.ORDER_ITEM_SEQ_ID = shipmentPlan.orderItemSeqId; - recordGroup.SHIPMENT_ID = shipmentPlan.shipmentId; - recordGroup.SHIPMENT_ITEM_SEQ_ID = shipmentPlan.shipmentItemSeqId; - - recordGroup.PRODUCT_ID = orderLine.productId; - recordGroup.QUANTITY = shipmentPlan.quantity; - product = from("Product").where("productId", orderLine.productId).queryOne(); - recordGroup.PRODUCT_NAME = product.internalName; + orderLine = from("OrderItem").where("orderId", shipmentPlan.orderId , "orderItemSeqId", shipmentPlan.orderItemSeqId).queryOne() + recordGroup = [:] + recordGroup.ORDER_ID = shipmentPlan.orderId + recordGroup.ORDER_ITEM_SEQ_ID = shipmentPlan.orderItemSeqId + recordGroup.SHIPMENT_ID = shipmentPlan.shipmentId + recordGroup.SHIPMENT_ITEM_SEQ_ID = shipmentPlan.shipmentItemSeqId + + recordGroup.PRODUCT_ID = orderLine.productId + recordGroup.QUANTITY = shipmentPlan.quantity + product = from("Product").where("productId", orderLine.productId).queryOne() + recordGroup.PRODUCT_NAME = product.internalName inputPar = [productId : orderLine.productId, quantity : shipmentPlan.quantity, fromDate : "" + new Date(), - userLogin: userLogin]; + userLogin: userLogin] - result = [:]; - result = runService('getNotAssembledComponents',inputPar); + result = [:] + result = runService('getNotAssembledComponents',inputPar) if (result) { - components = (List)result.get("notAssembledComponents"); + components = (List)result.get("notAssembledComponents") } components.each { oneComponent -> - record = new HashMap(recordGroup); - record.componentId = oneComponent.getProduct().productId; - record.componentName = oneComponent.getProduct().internalName; - record.componentQuantity = new Float(oneComponent.getQuantity()); - facilityId = shipment.originFacilityId; - float qty = 0; + record = new HashMap(recordGroup) + record.componentId = oneComponent.getProduct().productId + record.componentName = oneComponent.getProduct().internalName + record.componentQuantity = new Float(oneComponent.getQuantity()) + facilityId = shipment.originFacilityId + float qty = 0 if (facilityId) { if (!inventoryStock.containsKey(oneComponent.getProduct().productId)) { - serviceInput = [productId : oneComponent.getProduct().productId , facilityId : facilityId]; - serviceOutput = runService('getInventoryAvailableByFacility',serviceInput); - qha = serviceOutput.quantityOnHandTotal ?: 0.0; - inventoryStock.put(oneComponent.getProduct().productId, qha); + serviceInput = [productId : oneComponent.getProduct().productId , facilityId : facilityId] + serviceOutput = runService('getInventoryAvailableByFacility',serviceInput) + qha = serviceOutput.quantityOnHandTotal ?: 0.0 + inventoryStock.put(oneComponent.getProduct().productId, qha) } - qty = inventoryStock[oneComponent.getProduct().productId]; - qty = qty - oneComponent.getQuantity(); - inventoryStock.put(oneComponent.getProduct().productId, qty); + qty = inventoryStock[oneComponent.getProduct().productId] + qty = qty - oneComponent.getQuantity() + inventoryStock.put(oneComponent.getProduct().productId, qty) } - record.componentOnHand = qty; + record.componentOnHand = qty // Now we get the products qty already reserved by production runs serviceInput = [productId : oneComponent.getProduct().productId, - userLogin : userLogin]; - serviceOutput = runService('getProductionRunTotResQty', serviceInput); - resQty = serviceOutput.reservedQuantity; - record.reservedQuantity = resQty; - records.add(record); + userLogin : userLogin] + serviceOutput = runService('getProductionRunTotResQty', serviceInput) + resQty = serviceOutput.reservedQuantity + record.reservedQuantity = resQty + records.add(record) } } - context.records = records; + context.records = records // check permission - hasPermission = false; + hasPermission = false if (security.hasEntityPermission("MANUFACTURING", "_VIEW", session)) { - hasPermission = true; + hasPermission = true } - context.hasPermission = hasPermission; + context.hasPermission = hasPermission } -return "success"; +return "success" Modified: ofbiz/trunk/applications/manufacturing/groovyScripts/reports/ShipmentWorkEffortTasks.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/groovyScripts/reports/ShipmentWorkEffortTasks.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/groovyScripts/reports/ShipmentWorkEffortTasks.groovy (original) +++ ofbiz/trunk/applications/manufacturing/groovyScripts/reports/ShipmentWorkEffortTasks.groovy Wed Nov 2 19:09:13 2016 @@ -17,56 +17,56 @@ * under the License. */ -import org.apache.ofbiz.entity.GenericValue; +import org.apache.ofbiz.entity.GenericValue -shipmentId = parameters.shipmentId; -shipment = from("Shipment").where("shipmentId", shipmentId).queryOne(); +shipmentId = parameters.shipmentId +shipment = from("Shipment").where("shipmentId", shipmentId).queryOne() -context.shipmentIdPar = shipment.shipmentId; -context.date = new Date(); -Double fixedAssetTime = new Double(0); -records = []; +context.shipmentIdPar = shipment.shipmentId +context.date = new Date() +Double fixedAssetTime = new Double(0) +records = [] if (shipment) { - shipmentPlans = from("OrderShipment").where("shipmentId", shipmentId).queryList(); + shipmentPlans = from("OrderShipment").where("shipmentId", shipmentId).queryList() shipmentPlans.each { shipmentPlan -> - productionRuns = from("WorkOrderItemFulfillment").where("orderId", shipmentPlan.orderId, "orderItemSeqId", shipmentPlan.orderItemSeqId).orderBy("workEffortId").queryList(); + productionRuns = from("WorkOrderItemFulfillment").where("orderId", shipmentPlan.orderId, "orderItemSeqId", shipmentPlan.orderItemSeqId).orderBy("workEffortId").queryList() if (productionRuns) { productionRuns.each { productionRun -> - productionRunProduct = [:]; - productionRunProducts = from("WorkEffortGoodStandard").where("workEffortId", productionRun.workEffortId , "workEffortGoodStdTypeId", "PRUN_PROD_DELIV", "statusId", "WEGS_CREATED").queryList(); + productionRunProduct = [:] + 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); + productionRunProduct = ((GenericValue)productionRunProducts.get(0)).getRelatedOne("Product", false) } - tasks = from("WorkEffort").where("workEffortParentId", productionRun.workEffortId, "workEffortTypeId", "PROD_ORDER_TASK").queryList(); + tasks = from("WorkEffort").where("workEffortParentId", productionRun.workEffortId, "workEffortTypeId", "PROD_ORDER_TASK").queryList() tasks.each { task -> - record = [:]; - record.productId = productionRunProduct.productId; - record.productName = productionRunProduct.internalName; - record.fixedAssetId = task.fixedAssetId; - record.priority = task.getLong("priority"); - record.workEffortId = productionRun.workEffortId; - record.taskId = task.workEffortId; - record.taskName = task.workEffortName; - record.taskDescription = task.description; - record.taskEstimatedTime = task.getDouble("estimatedMilliSeconds"); - record.taskEstimatedSetup = task.getDouble("estimatedSetupMillis"); - records.add(record); + record = [:] + record.productId = productionRunProduct.productId + record.productName = productionRunProduct.internalName + record.fixedAssetId = task.fixedAssetId + record.priority = task.getLong("priority") + record.workEffortId = productionRun.workEffortId + record.taskId = task.workEffortId + record.taskName = task.workEffortName + record.taskDescription = task.description + record.taskEstimatedTime = task.getDouble("estimatedMilliSeconds") + record.taskEstimatedSetup = task.getDouble("estimatedSetupMillis") + records.add(record) if(task.getDouble("estimatedMilliSeconds") != null){ - fixedAssetTime = fixedAssetTime + task.getDouble("estimatedMilliSeconds"); + fixedAssetTime = fixedAssetTime + task.getDouble("estimatedMilliSeconds") } } } } } - context.fixedAssetTime = fixedAssetTime; - context.records = records; + context.fixedAssetTime = fixedAssetTime + context.records = records // check permission - hasPermission = false; + hasPermission = false if (security.hasEntityPermission("MANUFACTURING", "_VIEW", session)) { - hasPermission = true; + hasPermission = true } - context.hasPermission = hasPermission; + context.hasPermission = hasPermission } -return "success"; +return "success" Modified: ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendar.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendar.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendar.groovy (original) +++ ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendar.groovy Wed Nov 2 19:09:13 2016 @@ -17,29 +17,29 @@ * under the License. */ -import org.apache.ofbiz.base.util.UtilHttp; +import org.apache.ofbiz.base.util.UtilHttp -requestParams = UtilHttp.getParameterMap(request); -calendarId = requestParams.get("calendarId") ?: request.getAttribute("calendarId"); +requestParams = UtilHttp.getParameterMap(request) +calendarId = requestParams.get("calendarId") ?: request.getAttribute("calendarId") if (calendarId != null) { - techDataCalendar = from("TechDataCalendar").where("calendarId", calendarId).queryOne(); - context.techDataCalendar = techDataCalendar; + techDataCalendar = from("TechDataCalendar").where("calendarId", calendarId).queryOne() + context.techDataCalendar = techDataCalendar } -tryEntity = true; -errorMessage = request.getAttribute("_ERROR_MESSAGE_"); +tryEntity = true +errorMessage = request.getAttribute("_ERROR_MESSAGE_") if (errorMessage) { - tryEntity = false; + tryEntity = false } -calendarData = context.techDataCalendar; +calendarData = context.techDataCalendar if (!tryEntity) { - calendarData = requestParams ?: [:]; + calendarData = requestParams ?: [:] } if (!calendarData) { - calendarData = [:]; + calendarData = [:] } -context.calendarData = calendarData; +context.calendarData = calendarData -allCalendarWeek = from("TechDataCalendarWeek").queryList(); -context.calendarWeeks = allCalendarWeek; +allCalendarWeek = from("TechDataCalendarWeek").queryList() +context.calendarWeeks = allCalendarWeek Modified: ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendarExceptionDay.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendarExceptionDay.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendarExceptionDay.groovy (original) +++ ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendarExceptionDay.groovy Wed Nov 2 19:09:13 2016 @@ -18,34 +18,34 @@ */ -import java.util.*; -import org.apache.ofbiz.base.util.*; -import org.apache.ofbiz.entity.*; +import java.util.* +import org.apache.ofbiz.base.util.* +import org.apache.ofbiz.entity.* if (security.hasEntityPermission("MANUFACTURING", "_VIEW", session)) { - context.hasPermission = Boolean.TRUE; + context.hasPermission = Boolean.TRUE } else { - context.hasPermission = Boolean.FALSE; + context.hasPermission = Boolean.FALSE } -techDataCalendar = [:]; -calendarExceptionDays = []; +techDataCalendar = [:] +calendarExceptionDays = [] -calendarId = parameters.calendarId ?: request.getAttribute("calendarId"); +calendarId = parameters.calendarId ?: request.getAttribute("calendarId") if (calendarId) { - techDataCalendar = from("TechDataCalendar").where("calendarId", calendarId).queryOne(); - context.techDataCalendar = techDataCalendar; + techDataCalendar = from("TechDataCalendar").where("calendarId", calendarId).queryOne() + context.techDataCalendar = techDataCalendar } if (techDataCalendar) { - calendarExceptionDays = techDataCalendar.getRelated("TechDataCalendarExcDay", null, null, false); - context.calendarExceptionDays = calendarExceptionDays; + calendarExceptionDays = techDataCalendar.getRelated("TechDataCalendarExcDay", null, null, false) + context.calendarExceptionDays = calendarExceptionDays } -exceptionDateStartTime = parameters.exceptionDateStartTime ?: request.getAttribute("exceptionDateStartTime"); -exceptionDateStartTime = ObjectType.simpleTypeConvert(exceptionDateStartTime, "Timestamp", null, null); +exceptionDateStartTime = parameters.exceptionDateStartTime ?: request.getAttribute("exceptionDateStartTime") +exceptionDateStartTime = ObjectType.simpleTypeConvert(exceptionDateStartTime, "Timestamp", null, null) if (exceptionDateStartTime) { - calendarExceptionDay = from("TechDataCalendarExcDay").where("calendarId", calendarId , "exceptionDateStartTime", exceptionDateStartTime).queryOne(); + calendarExceptionDay = from("TechDataCalendarExcDay").where("calendarId", calendarId , "exceptionDateStartTime", exceptionDateStartTime).queryOne() if (calendarExceptionDay) { - context.calendarExceptionDay = calendarExceptionDay; + context.calendarExceptionDay = calendarExceptionDay } } Modified: ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendarExceptionWeek.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendarExceptionWeek.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendarExceptionWeek.groovy (original) +++ ofbiz/trunk/applications/manufacturing/groovyScripts/routing/EditCalendarExceptionWeek.groovy Wed Nov 2 19:09:13 2016 @@ -18,37 +18,37 @@ */ -import org.apache.ofbiz.base.util.*; +import org.apache.ofbiz.base.util.* if (security.hasEntityPermission("MANUFACTURING", "_VIEW", session)) { - context.hasPermission = Boolean.TRUE; + context.hasPermission = Boolean.TRUE } else { - context.hasPermission = Boolean.FALSE; + context.hasPermission = Boolean.FALSE } -techDataCalendar = [:]; -calendarExceptionWeeks = []; +techDataCalendar = [:] +calendarExceptionWeeks = [] -calendarId = parameters.calendarId ?: request.getAttribute("calendarId");; +calendarId = parameters.calendarId ?: request.getAttribute("calendarId") if (calendarId) { - techDataCalendar = from("TechDataCalendar").where("calendarId", calendarId).queryOne(); - context.techDataCalendar = techDataCalendar; + techDataCalendar = from("TechDataCalendar").where("calendarId", calendarId).queryOne() + context.techDataCalendar = techDataCalendar } if (techDataCalendar) { - calendarExceptionWeeks = techDataCalendar.getRelated("TechDataCalendarExcWeek", null, null, false); + calendarExceptionWeeks = techDataCalendar.getRelated("TechDataCalendarExcWeek", null, null, false) } -calendarExceptionWeeksDatas = []; +calendarExceptionWeeksDatas = [] calendarExceptionWeeks.each { calendarExceptionWeek -> - calendarWeek = calendarExceptionWeek.getRelatedOne("TechDataCalendarWeek", false); - calendarExceptionWeeksDatas.add([calendarExceptionWeek : calendarExceptionWeek , calendarWeek : calendarWeek]); - context.calendarExceptionWeeksDatas = calendarExceptionWeeksDatas; + calendarWeek = calendarExceptionWeek.getRelatedOne("TechDataCalendarWeek", false) + calendarExceptionWeeksDatas.add([calendarExceptionWeek : calendarExceptionWeek , calendarWeek : calendarWeek]) + context.calendarExceptionWeeksDatas = calendarExceptionWeeksDatas } -exceptionDateStart = parameters.exceptionDateStart ?: request.getAttribute("exceptionDateStart"); -exceptionDateStart = ObjectType.simpleTypeConvert(exceptionDateStart, "java.sql.Date", null, null); +exceptionDateStart = parameters.exceptionDateStart ?: request.getAttribute("exceptionDateStart") +exceptionDateStart = ObjectType.simpleTypeConvert(exceptionDateStart, "java.sql.Date", null, null) if (exceptionDateStart) { - calendarExceptionWeek = from("TechDataCalendarExcWeek").where("calendarId", calendarId , "exceptionDateStart", exceptionDateStart).queryOne(); + calendarExceptionWeek = from("TechDataCalendarExcWeek").where("calendarId", calendarId , "exceptionDateStart", exceptionDateStart).queryOne() if (calendarExceptionWeek) { - context.calendarExceptionWeek = calendarExceptionWeek; + context.calendarExceptionWeek = calendarExceptionWeek } } \ No newline at end of file Modified: ofbiz/trunk/applications/marketing/groovyScripts/marketing/contact/GetContactListMarketingEmail.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/groovyScripts/marketing/contact/GetContactListMarketingEmail.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/groovyScripts/marketing/contact/GetContactListMarketingEmail.groovy (original) +++ ofbiz/trunk/applications/marketing/groovyScripts/marketing/contact/GetContactListMarketingEmail.groovy Wed Nov 2 19:09:13 2016 @@ -19,18 +19,18 @@ // figure out the MARKETING_EMAIL of the ContactList owner, for setting in the send email link if (!contactList && contactListId) { - contactList = from("ContactList").where("contactListId", "contactListId").cache(true).queryOne(); + contactList = from("ContactList").where("contactListId", "contactListId").cache(true).queryOne() } if (contactList) { - ownerParty = contactList.getRelatedOne("OwnerParty", false); + ownerParty = contactList.getRelatedOne("OwnerParty", false) if (ownerParty) { - contactMechs = ownerParty.getRelated("PartyContactMechPurpose", [contactMechPurposeTypeId : "MARKETING_EMAIL"], null, false); + contactMechs = ownerParty.getRelated("PartyContactMechPurpose", [contactMechPurposeTypeId : "MARKETING_EMAIL"], null, false) if (!contactMechs) { - contactMechs = ownerParty.getRelated("PartyContactMechPurpose", [contactMechPurposeTypeId : "PRIMARY_EMAIL"], null, false); + contactMechs = ownerParty.getRelated("PartyContactMechPurpose", [contactMechPurposeTypeId : "PRIMARY_EMAIL"], null, false) } if (contactMechs) { - context.marketingEmail = contactMechs.get(0); + context.marketingEmail = contactMechs.get(0) } } } Modified: ofbiz/trunk/applications/marketing/groovyScripts/marketing/reports/EmailStatusReport.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/groovyScripts/marketing/reports/EmailStatusReport.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/groovyScripts/marketing/reports/EmailStatusReport.groovy (original) +++ ofbiz/trunk/applications/marketing/groovyScripts/marketing/reports/EmailStatusReport.groovy Wed Nov 2 19:09:13 2016 @@ -17,31 +17,31 @@ * under the License. */ -import org.apache.ofbiz.entity.condition.EntityCondition; -import org.apache.ofbiz.entity.condition.EntityOperator; +import org.apache.ofbiz.entity.condition.EntityCondition +import org.apache.ofbiz.entity.condition.EntityOperator -conditionList = []; +conditionList = [] if (fromDate) { - conditionList.add(EntityCondition.makeCondition("entryDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); + conditionList.add(EntityCondition.makeCondition("entryDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)) } if (thruDate) { - conditionList.add(EntityCondition.makeCondition("entryDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)); + conditionList.add(EntityCondition.makeCondition("entryDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)) } if (partyIdTo) { - conditionList.add(EntityCondition.makeCondition("partyIdTo", EntityOperator.EQUALS, partyIdTo)); + conditionList.add(EntityCondition.makeCondition("partyIdTo", EntityOperator.EQUALS, partyIdTo)) } else { - conditionList.add(EntityCondition.makeCondition("partyIdTo", EntityOperator.NOT_EQUAL, null)); + conditionList.add(EntityCondition.makeCondition("partyIdTo", EntityOperator.NOT_EQUAL, null)) } if (partyIdFrom) { - conditionList.add(EntityCondition.makeCondition("partyIdFrom", EntityOperator.EQUALS, partyIdFrom)); + conditionList.add(EntityCondition.makeCondition("partyIdFrom", EntityOperator.EQUALS, partyIdFrom)) } if (statusId) { - conditionList.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, statusId)); + conditionList.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, statusId)) } if (roleStatusId) { - conditionList.add(EntityCondition.makeCondition("roleStatusId", EntityOperator.EQUALS, roleStatusId)); + conditionList.add(EntityCondition.makeCondition("roleStatusId", EntityOperator.EQUALS, roleStatusId)) } -conditionList.add(EntityCondition.makeCondition("roleTypeId", EntityOperator.EQUALS, "ADDRESSEE")); +conditionList.add(EntityCondition.makeCondition("roleTypeId", EntityOperator.EQUALS, "ADDRESSEE")) -commStatausList = from("CommunicationEventAndRole").where(conditionList).queryList(); -context.commStatausList = commStatausList; +commStatausList = from("CommunicationEventAndRole").where(conditionList).queryList() +context.commStatausList = commStatausList Modified: ofbiz/trunk/applications/marketing/groovyScripts/marketing/reports/MarketingCampaignReport.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/groovyScripts/marketing/reports/MarketingCampaignReport.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/groovyScripts/marketing/reports/MarketingCampaignReport.groovy (original) +++ ofbiz/trunk/applications/marketing/groovyScripts/marketing/reports/MarketingCampaignReport.groovy Wed Nov 2 19:09:13 2016 @@ -23,26 +23,26 @@ import org.apache.ofbiz.marketing.report //query for both number of visits and number of orders -marketingCampaignId = request.getParameter("marketingCampaignId"); -visitConditionList = [] as LinkedList; -orderConditionList = [] as LinkedList; +marketingCampaignId = request.getParameter("marketingCampaignId") +visitConditionList = [] as LinkedList +orderConditionList = [] as LinkedList if (fromDate) { - visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); - orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); + visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)) + orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)) } if (thruDate) { - visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)); - orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)); + visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)) + orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)) } if (marketingCampaignId) { - visitConditionList.add(EntityCondition.makeCondition("marketingCampaignId", EntityOperator.EQUALS, marketingCampaignId)); - orderConditionList.add(EntityCondition.makeCondition("marketingCampaignId", EntityOperator.EQUALS, marketingCampaignId)); + visitConditionList.add(EntityCondition.makeCondition("marketingCampaignId", EntityOperator.EQUALS, marketingCampaignId)) + orderConditionList.add(EntityCondition.makeCondition("marketingCampaignId", EntityOperator.EQUALS, marketingCampaignId)) } -visits = select("marketingCampaignId", "visitId").from("MarketingCampaignAndVisit").where(visitConditionList).orderBy("marketingCampaignId").queryList(); -orders = select("marketingCampaignId", "orderId", "grandTotal").from("MarketingCampaignAndOrderHeader").where(orderConditionList).orderBy("marketingCampaignId").queryList(); +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"); -context.marketingCampaignVisitAndOrders = marketingCampaignVisitAndOrders; +marketingCampaignVisitAndOrders = ReportHelper.calcConversionRates(visits, orders, "marketingCampaignId") +context.marketingCampaignVisitAndOrders = marketingCampaignVisitAndOrders Modified: ofbiz/trunk/applications/marketing/groovyScripts/marketing/reports/PartyStatusReport.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/groovyScripts/marketing/reports/PartyStatusReport.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/groovyScripts/marketing/reports/PartyStatusReport.groovy (original) +++ ofbiz/trunk/applications/marketing/groovyScripts/marketing/reports/PartyStatusReport.groovy Wed Nov 2 19:09:13 2016 @@ -17,24 +17,24 @@ * under the License. */ -import org.apache.ofbiz.entity.condition.EntityCondition; -import org.apache.ofbiz.entity.condition.EntityOperator; +import org.apache.ofbiz.entity.condition.EntityCondition +import org.apache.ofbiz.entity.condition.EntityOperator -conditionList = []; +conditionList = [] if (fromDate) { - conditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); + conditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)) } if (statusDate) { - conditionList.add(EntityCondition.makeCondition("statusDate", EntityOperator.GREATER_THAN_EQUAL_TO, statusDate)); + conditionList.add(EntityCondition.makeCondition("statusDate", EntityOperator.GREATER_THAN_EQUAL_TO, statusDate)) } if (thruDate) { - conditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)); + conditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)) } if (contactListId) { - conditionList.add(EntityCondition.makeCondition("contactListId", EntityOperator.EQUALS, contactListId)); + conditionList.add(EntityCondition.makeCondition("contactListId", EntityOperator.EQUALS, contactListId)) } if (statusId) { - conditionList.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, statusId)); + conditionList.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, statusId)) } -partyStatusLists = from("ContactListPartyStatus").where(conditionList).queryList(); -context.partyStatusLists = partyStatusLists; +partyStatusLists = from("ContactListPartyStatus").where(conditionList).queryList() +context.partyStatusLists = partyStatusLists Modified: ofbiz/trunk/applications/marketing/groovyScripts/marketing/reports/TrackingCodeReport.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/groovyScripts/marketing/reports/TrackingCodeReport.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/groovyScripts/marketing/reports/TrackingCodeReport.groovy (original) +++ ofbiz/trunk/applications/marketing/groovyScripts/marketing/reports/TrackingCodeReport.groovy Wed Nov 2 19:09:13 2016 @@ -23,25 +23,25 @@ import org.apache.ofbiz.marketing.report // query for both number of visits and number of orders -visitConditionList = [] as LinkedList; -orderConditionList = [] as LinkedList; +visitConditionList = [] as LinkedList +orderConditionList = [] as LinkedList if (fromDate) { - visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); - orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)); + visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)) + orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate)) } if (thruDate) { - visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)); - orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)); + visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)) + orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate)) } if (trackingCodeId) { - visitConditionList.add(EntityCondition.makeCondition("trackingCodeId", EntityOperator.EQUALS, trackingCodeId)); - orderConditionList.add(EntityCondition.makeCondition("trackingCodeId", EntityOperator.EQUALS, trackingCodeId)); + visitConditionList.add(EntityCondition.makeCondition("trackingCodeId", EntityOperator.EQUALS, trackingCodeId)) + orderConditionList.add(EntityCondition.makeCondition("trackingCodeId", EntityOperator.EQUALS, trackingCodeId)) } -visits = select("trackingCodeId", "visitId").from("TrackingCodeAndVisit").where(visitConditionList).orderBy("trackingCodeId").queryList(); -orders = select("trackingCodeId", "orderId", "grandTotal").from("TrackingCodeAndOrderHeader").where(orderConditionList).orderBy("trackingCodeId").queryList(); +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"); -context.trackingCodeVisitAndOrders = trackingCodeVisitAndOrders; +trackingCodeVisitAndOrders = ReportHelper.calcConversionRates(visits, orders, "trackingCodeId") +context.trackingCodeVisitAndOrders = trackingCodeVisitAndOrders Modified: ofbiz/trunk/applications/marketing/groovyScripts/sfa/CloneLead.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/groovyScripts/sfa/CloneLead.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/groovyScripts/sfa/CloneLead.groovy (original) +++ ofbiz/trunk/applications/marketing/groovyScripts/sfa/CloneLead.groovy Wed Nov 2 19:09:13 2016 @@ -20,75 +20,75 @@ import org.apache.ofbiz.entity.util.EntityUtil import org.apache.ofbiz.party.contact.ContactHelper -partyId = parameters.partyId; +partyId = parameters.partyId if (partyId) { - party = from("Party").where("partyId", partyId).queryOne(); - person = party.getRelatedOne("Person", false); - contactDetailMap = [partyId : partyId, firstName : person.firstName, lastName : person.lastName, suffix : person.suffix]; + 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 = from("PartyRelationship") .where("partyIdTo", partyId, "roleTypeIdTo", "EMPLOYEE", "roleTypeIdFrom", "LEAD", "partyRelationshipTypeId", "EMPLOYMENT") .orderBy("-fromDate") .filterByDate() - .queryFirst(); + .queryFirst() if (partyRelationship) { - contactDetailMap.title = partyRelationship.positionTitle; - partyGroup = from("PartyGroup").where("partyId", partyRelationship.partyIdFrom).queryOne(); + contactDetailMap.title = partyRelationship.positionTitle + partyGroup = from("PartyGroup").where("partyId", partyRelationship.partyIdFrom).queryOne() if (partyGroup) { if (partyGroup.groupName) { - contactDetailMap.groupName = partyGroup.groupName; + contactDetailMap.groupName = partyGroup.groupName } if (partyGroup.officeSiteName) { - contactDetailMap.officeSiteName = partyGroup.officeSiteName; + contactDetailMap.officeSiteName = partyGroup.officeSiteName } if (partyGroup.numEmployees) { - contactDetailMap.numEmployees = partyGroup.numEmployees; + contactDetailMap.numEmployees = partyGroup.numEmployees } } } - generalContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(person, "GENERAL_LOCATION", "POSTAL_ADDRESS", false)); + generalContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(person, "GENERAL_LOCATION", "POSTAL_ADDRESS", false)) if (generalContactMech) { - contactDetailMap.addrContactMechId = generalContactMech.contactMechId; - postalAddress = generalContactMech.getRelatedOne("PostalAddress", false); + contactDetailMap.addrContactMechId = generalContactMech.contactMechId + postalAddress = generalContactMech.getRelatedOne("PostalAddress", false) if (postalAddress) { - contactDetailMap.address1 = postalAddress.address1; - contactDetailMap.city = postalAddress.city; - contactDetailMap.stateProvinceGeoId = postalAddress.stateProvinceGeoId; - contactDetailMap.countryGeoId = postalAddress.countryGeoId; - contactDetailMap.postalCode = postalAddress.postalCode; - address2 = postalAddress.address2; + contactDetailMap.address1 = postalAddress.address1 + contactDetailMap.city = postalAddress.city + contactDetailMap.stateProvinceGeoId = postalAddress.stateProvinceGeoId + contactDetailMap.countryGeoId = postalAddress.countryGeoId + contactDetailMap.postalCode = postalAddress.postalCode + address2 = postalAddress.address2 if (address2) { - contactDetailMap.address2 = address2; + contactDetailMap.address2 = address2 } } } - emailContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(person, "PRIMARY_EMAIL", "EMAIL_ADDRESS", false)); + emailContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(person, "PRIMARY_EMAIL", "EMAIL_ADDRESS", false)) if (emailContactMech) { - contactDetailMap.emailAddress = emailContactMech.infoString; - contactDetailMap.emailContactMechId = emailContactMech.contactMechId; + contactDetailMap.emailAddress = emailContactMech.infoString + contactDetailMap.emailContactMechId = emailContactMech.contactMechId } - phoneContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(person, "PRIMARY_PHONE", "TELECOM_NUMBER", false)); + phoneContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(person, "PRIMARY_PHONE", "TELECOM_NUMBER", false)) if (phoneContactMech) { - contactDetailMap.phoneContactMechId = phoneContactMech.contactMechId; - telecomNumber = phoneContactMech.getRelatedOne("TelecomNumber", false); + contactDetailMap.phoneContactMechId = phoneContactMech.contactMechId + telecomNumber = phoneContactMech.getRelatedOne("TelecomNumber", false) if (telecomNumber) { - countryCode = telecomNumber.countryCode; + countryCode = telecomNumber.countryCode if (countryCode) { - contactDetailMap.countryCode = countryCode; + contactDetailMap.countryCode = countryCode } - areaCode = telecomNumber.areaCode; + areaCode = telecomNumber.areaCode if (areaCode) { - contactDetailMap.areaCode = areaCode; + contactDetailMap.areaCode = areaCode } - contactNumber = telecomNumber.contactNumber; + contactNumber = telecomNumber.contactNumber if (contactNumber) { - contactDetailMap.contactNumber = contactNumber; + contactDetailMap.contactNumber = contactNumber } } } - partyDataSource = EntityUtil.getFirst(party.getRelated("PartyDataSource", null, null, false)); + partyDataSource = EntityUtil.getFirst(party.getRelated("PartyDataSource", null, null, false)) if (partyDataSource) { - dataSource = partyDataSource.getRelatedOne("DataSource", false); - contactDetailMap.leadSource = dataSource.description; + dataSource = partyDataSource.getRelatedOne("DataSource", false) + contactDetailMap.leadSource = dataSource.description } } -context.contactDetailMap = contactDetailMap; +context.contactDetailMap = contactDetailMap Modified: ofbiz/trunk/applications/marketing/groovyScripts/sfa/MergeContacts.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/marketing/groovyScripts/sfa/MergeContacts.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/marketing/groovyScripts/sfa/MergeContacts.groovy (original) +++ ofbiz/trunk/applications/marketing/groovyScripts/sfa/MergeContacts.groovy Wed Nov 2 19:09:13 2016 @@ -20,60 +20,60 @@ import org.apache.ofbiz.entity.util.EntityUtil import org.apache.ofbiz.party.contact.ContactHelper -contactInfoList = []; -partyIdFrom = parameters.partyIdFrom; -partyIdTo = parameters.partyIdTo; +contactInfoList = [] +partyIdFrom = parameters.partyIdFrom +partyIdTo = parameters.partyIdTo if (partyIdFrom && partyIdTo) { - partyList = [partyIdTo, partyIdFrom]; + partyList = [partyIdTo, partyIdFrom] partyList.each { partyId -> - party = from("Party").where("partyId", partyId).queryOne(); - person = party.getRelatedOne("Person", false); - contactDetailMap = [partyId : partyId, firstName : person.firstName, lastName : person.lastName]; + party = from("Party").where("partyId", partyId).queryOne() + person = party.getRelatedOne("Person", false) + contactDetailMap = [partyId : partyId, firstName : person.firstName, lastName : person.lastName] - generalContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "GENERAL_LOCATION", "POSTAL_ADDRESS", false)); + generalContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "GENERAL_LOCATION", "POSTAL_ADDRESS", false)) if (generalContactMech) { - contactDetailMap.addrContactMechId = generalContactMech.contactMechId; - postalAddress = generalContactMech.getRelatedOne("PostalAddress", false); + contactDetailMap.addrContactMechId = generalContactMech.contactMechId + postalAddress = generalContactMech.getRelatedOne("PostalAddress", false) if (postalAddress) { - contactDetailMap.address1 = postalAddress.address1; - contactDetailMap.city = postalAddress.city; - address2 = postalAddress.address2; + contactDetailMap.address1 = postalAddress.address1 + contactDetailMap.city = postalAddress.city + address2 = postalAddress.address2 if (address2) { - contactDetailMap.address2 = address2; + contactDetailMap.address2 = address2 } - geo = from("Geo").where("geoId", postalAddress.stateProvinceGeoId).queryOne(); - contactDetailMap.state = geo.geoName; + geo = from("Geo").where("geoId", postalAddress.stateProvinceGeoId).queryOne() + contactDetailMap.state = geo.geoName - geo = from("Geo").where("geoId", postalAddress.countryGeoId).queryOne(); - contactDetailMap.country = geo.geoName; + geo = from("Geo").where("geoId", postalAddress.countryGeoId).queryOne() + contactDetailMap.country = geo.geoName } } - emailContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "PRIMARY_EMAIL", "EMAIL_ADDRESS", false)); + emailContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "PRIMARY_EMAIL", "EMAIL_ADDRESS", false)) if (emailContactMech) { - contactDetailMap.primaryEmail = emailContactMech.infoString; - contactDetailMap.emailContactMechId = emailContactMech.contactMechId; + contactDetailMap.primaryEmail = emailContactMech.infoString + contactDetailMap.emailContactMechId = emailContactMech.contactMechId } - phoneContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "PRIMARY_PHONE", "TELECOM_NUMBER", false)); + phoneContactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "PRIMARY_PHONE", "TELECOM_NUMBER", false)) if (phoneContactMech) { - contactDetailMap.phoneContactMechId = phoneContactMech.contactMechId; - telecomNumber = phoneContactMech.getRelatedOne("TelecomNumber", false); + contactDetailMap.phoneContactMechId = phoneContactMech.contactMechId + telecomNumber = phoneContactMech.getRelatedOne("TelecomNumber", false) if (telecomNumber) { - countryCode = telecomNumber.countryCode; + countryCode = telecomNumber.countryCode if (countryCode) { - contactDetailMap.countryCode = countryCode; + contactDetailMap.countryCode = countryCode } - areaCode = telecomNumber.areaCode; + areaCode = telecomNumber.areaCode if (areaCode) { - contactDetailMap.areaCode = areaCode; + contactDetailMap.areaCode = areaCode } - contactNumber = telecomNumber.contactNumber; + contactNumber = telecomNumber.contactNumber if (contactNumber) { - contactDetailMap.contactNumber = contactNumber; + contactDetailMap.contactNumber = contactNumber } } } - contactInfoList.add(contactDetailMap); + contactInfoList.add(contactDetailMap) } } context.contactInfoList = contactInfoList; \ No newline at end of file Modified: ofbiz/trunk/applications/order/groovyScripts/entry/AddGiftCertificates.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/groovyScripts/entry/AddGiftCertificates.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/order/groovyScripts/entry/AddGiftCertificates.groovy (original) +++ ofbiz/trunk/applications/order/groovyScripts/entry/AddGiftCertificates.groovy Wed Nov 2 19:09:13 2016 @@ -16,40 +16,40 @@ * specific language governing permissions and limitations * under the License. */ -import org.apache.ofbiz.base.util.UtilValidate; -import org.apache.ofbiz.entity.condition.EntityCondition; -import org.apache.ofbiz.entity.condition.EntityOperator; -import org.apache.ofbiz.product.store.ProductStoreWorker; +import org.apache.ofbiz.base.util.UtilValidate +import org.apache.ofbiz.entity.condition.EntityCondition +import org.apache.ofbiz.entity.condition.EntityOperator +import org.apache.ofbiz.product.store.ProductStoreWorker -cart = session.getAttribute("shoppingCart"); -productStoreId = ProductStoreWorker.getProductStoreId(request); +cart = session.getAttribute("shoppingCart") +productStoreId = ProductStoreWorker.getProductStoreId(request) if (productStoreId == null) { - productStoreId = cart.getProductStoreId(); + productStoreId = cart.getProductStoreId() } // Get Gift cards availbale in data -giftCardCategories = from("ProductCategory").where("productCategoryTypeId", "GIFT_CARD_CATEGORY").queryList(); -giftCardProductList = []; +giftCardCategories = from("ProductCategory").where("productCategoryTypeId", "GIFT_CARD_CATEGORY").queryList() +giftCardProductList = [] if (UtilValidate.isNotEmpty(giftCardCategories)) { giftCardCategories.each { giftCardCategory -> - giftCardCategoryMembers = from("ProductCategoryMember").where("productCategoryId", giftCardCategory.productCategoryId).queryList(); + giftCardCategoryMembers = from("ProductCategoryMember").where("productCategoryId", giftCardCategory.productCategoryId).queryList() if (UtilValidate.isNotEmpty(giftCardCategoryMembers)) { giftCardCategoryMembers.each { giftCardCategoryMember -> - giftCardProducts = from("ProductAndPriceView").where("productId", giftCardCategoryMember.productId).queryList(); + giftCardProducts = from("ProductAndPriceView").where("productId", giftCardCategoryMember.productId).queryList() if (UtilValidate.isNotEmpty(giftCardProducts)) { giftCardProducts.each { giftCardProduct -> - giftCardProductList.add(giftCardProduct); + giftCardProductList.add(giftCardProduct) } } } } } } -context.giftCardProductList = giftCardProductList; +context.giftCardProductList = giftCardProductList // Get Survey Id for Gift Certificates -productStoreFinActSetting = from("ProductStoreFinActSetting").where("productStoreId", productStoreId, "finAccountTypeId", "GIFTCERT_ACCOUNT").queryOne(); -context.surveyId = productStoreFinActSetting.purchaseSurveyId; +productStoreFinActSetting = from("ProductStoreFinActSetting").where("productStoreId", productStoreId, "finAccountTypeId", "GIFTCERT_ACCOUNT").queryOne() +context.surveyId = productStoreFinActSetting.purchaseSurveyId Modified: ofbiz/trunk/applications/order/groovyScripts/entry/AdditionalPartyListing.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/groovyScripts/entry/AdditionalPartyListing.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/order/groovyScripts/entry/AdditionalPartyListing.groovy (original) +++ ofbiz/trunk/applications/order/groovyScripts/entry/AdditionalPartyListing.groovy Wed Nov 2 19:09:13 2016 @@ -17,39 +17,39 @@ * under the License. */ -import org.apache.ofbiz.order.shoppingcart.ShoppingCartEvents; -import org.apache.ofbiz.order.shoppingcart.ShoppingCart; -import org.apache.ofbiz.entity.*; -import org.apache.ofbiz.base.util.*; +import org.apache.ofbiz.order.shoppingcart.ShoppingCartEvents +import org.apache.ofbiz.order.shoppingcart.ShoppingCart +import org.apache.ofbiz.entity.* +import org.apache.ofbiz.base.util.* -cart = ShoppingCartEvents.getCartObject(request); -additionalPartyRole = cart.getAdditionalPartyRoleMap(); +cart = ShoppingCartEvents.getCartObject(request) +additionalPartyRole = cart.getAdditionalPartyRoleMap() -roleData = [:]; -partyData = [:]; +roleData = [:] +partyData = [:] additionalPartyRole.each { roleTypeId, partyList -> - roleData[roleTypeId] = from("RoleType").where("roleTypeId", roleTypeId).queryOne(); + roleData[roleTypeId] = from("RoleType").where("roleTypeId", roleTypeId).queryOne() partyList.each { partyId -> - partyMap = [:]; - partyMap.partyId = partyId; - party = from("Party").where("partyId", partyId).cache(true).queryOne(); + partyMap = [:] + partyMap.partyId = partyId + party = from("Party").where("partyId", partyId).cache(true).queryOne() if (party.partyTypeId.equals("PERSON")) { - party = party.getRelatedOne("Person", true); - partyMap.type = "person"; - partyMap.firstName = party.firstName; - partyMap.lastName = party.lastName; + party = party.getRelatedOne("Person", true) + partyMap.type = "person" + partyMap.firstName = party.firstName + partyMap.lastName = party.lastName } else { - party = party.getRelatedOne("PartyGroup", true); - partyMap.type = "group"; - partyMap.groupName = party.groupName; + party = party.getRelatedOne("PartyGroup", true) + partyMap.type = "group" + partyMap.groupName = party.groupName } - partyData[partyId] = partyMap; + partyData[partyId] = partyMap } } -context.additionalPartyRoleMap = additionalPartyRole; -context.roleList = additionalPartyRole.keySet(); -context.roleData = roleData; -context.partyData = partyData; +context.additionalPartyRoleMap = additionalPartyRole +context.roleList = additionalPartyRole.keySet() +context.roleData = roleData +context.partyData = partyData Modified: ofbiz/trunk/applications/order/groovyScripts/entry/BillSettings.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/groovyScripts/entry/BillSettings.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/order/groovyScripts/entry/BillSettings.groovy (original) +++ ofbiz/trunk/applications/order/groovyScripts/entry/BillSettings.groovy Wed Nov 2 19:09:13 2016 @@ -17,77 +17,77 @@ * under the License. */ -import org.apache.ofbiz.entity.*; -import org.apache.ofbiz.entity.util.*; -import org.apache.ofbiz.base.util.*; -import org.apache.ofbiz.accounting.payment.*; -import org.apache.ofbiz.order.shoppingcart.*; -import org.apache.ofbiz.party.contact.*; - -cart = session.getAttribute("shoppingCart"); -orderPartyId = cart.getPartyId(); -currencyUomId = cart.getCurrency(); -context.cart = cart; -context.paymentMethodType = request.getParameter("paymentMethodType"); +import org.apache.ofbiz.entity.* +import org.apache.ofbiz.entity.util.* +import org.apache.ofbiz.base.util.* +import org.apache.ofbiz.accounting.payment.* +import org.apache.ofbiz.order.shoppingcart.* +import org.apache.ofbiz.party.contact.* + +cart = session.getAttribute("shoppingCart") +orderPartyId = cart.getPartyId() +currencyUomId = cart.getCurrency() +context.cart = cart +context.paymentMethodType = request.getParameter("paymentMethodType") // nuke the event messages -request.removeAttribute("_EVENT_MESSAGE_"); +request.removeAttribute("_EVENT_MESSAGE_") // If there's a paymentMethodId request attribute, the user has just created a new payment method, // so put the new paymentMethodId in the context for the UI -newPaymentMethodId=request.getAttribute("paymentMethodId"); +newPaymentMethodId=request.getAttribute("paymentMethodId") if (newPaymentMethodId) { - context.checkOutPaymentId = newPaymentMethodId; + context.checkOutPaymentId = newPaymentMethodId } if (orderPartyId && !orderPartyId.equals("_NA_")) { - orderParty = from("Party").where("partyId", orderPartyId).queryOne(); - orderPerson = orderParty.getRelatedOne("Person", false); - context.orderParty = orderParty; - context.orderPerson = orderPerson; + orderParty = from("Party").where("partyId", orderPartyId).queryOne() + orderPerson = orderParty.getRelatedOne("Person", false) + context.orderParty = orderParty + context.orderPerson = orderPerson if (orderParty) { - context.paymentMethodList = EntityUtil.filterByDate(orderParty.getRelated("PaymentMethod", null, null, false), true); + context.paymentMethodList = EntityUtil.filterByDate(orderParty.getRelated("PaymentMethod", null, null, false), true) - billingAccountList = BillingAccountWorker.makePartyBillingAccountList(userLogin, currencyUomId, orderPartyId, delegator, dispatcher); + billingAccountList = BillingAccountWorker.makePartyBillingAccountList(userLogin, currencyUomId, orderPartyId, delegator, dispatcher) if (billingAccountList) { - context.selectedBillingAccountId = cart.getBillingAccountId(); - context.billingAccountList = billingAccountList; + context.selectedBillingAccountId = cart.getBillingAccountId() + context.billingAccountList = billingAccountList } } } if (request.getParameter("useShipAddr") && cart.getShippingContactMechId()) { - shippingContactMech = cart.getShippingContactMechId(); - postalAddress = from("PostalAddress").where("contactMechId", shippingContactMech).queryOne(); - context.postalFields = postalAddress; + shippingContactMech = cart.getShippingContactMechId() + postalAddress = from("PostalAddress").where("contactMechId", shippingContactMech).queryOne() + context.postalFields = postalAddress } else { - context.postalFields = UtilHttp.getParameterMap(request); + context.postalFields = UtilHttp.getParameterMap(request) } if (cart) { if (cart.getPaymentMethodIds()) { - checkOutPaymentId = cart.getPaymentMethodIds().get(0); - context.checkOutPaymentId = checkOutPaymentId; + checkOutPaymentId = cart.getPaymentMethodIds().get(0) + context.checkOutPaymentId = checkOutPaymentId if (!orderParty) { - paymentMethod = from("PaymentMethod").where("paymentMethodId", checkOutPaymentId).queryOne(); + paymentMethod = from("PaymentMethod").where("paymentMethodId", checkOutPaymentId).queryOne() if ("CREDIT_CARD".equals(paymentMethod?.paymentMethodTypeId)) { - paymentMethodType = "CC"; - account = paymentMethod.getRelatedOne("CreditCard", false); - context.creditCard = account; - context.paymentMethodType = paymentMethodType; + paymentMethodType = "CC" + account = paymentMethod.getRelatedOne("CreditCard", false) + context.creditCard = account + context.paymentMethodType = paymentMethodType } else if ("EFT_ACCOUNT".equals(paymentMethod.paymentMethodTypeId)) { - paymentMethodType = "EFT"; - account = paymentMethod.getRelatedOne("EftAccount", false); - context.eftAccount = account; - context.paymentMethodType = paymentMethodType; + paymentMethodType = "EFT" + account = paymentMethod.getRelatedOne("EftAccount", false) + context.eftAccount = account + context.paymentMethodType = paymentMethodType } if (account) { - address = account.getRelatedOne("PostalAddress", false); - context.postalAddress = address; + address = account.getRelatedOne("PostalAddress", false) + context.postalAddress = address } } } else if (cart.getPaymentMethodTypeIds()) { - checkOutPaymentId = cart.getPaymentMethodTypeIds().get(0); - context.checkOutPaymentId = checkOutPaymentId; + checkOutPaymentId = cart.getPaymentMethodTypeIds().get(0) + context.checkOutPaymentId = checkOutPaymentId } } Modified: ofbiz/trunk/applications/order/groovyScripts/entry/CheckInits.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/groovyScripts/entry/CheckInits.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/order/groovyScripts/entry/CheckInits.groovy (original) +++ ofbiz/trunk/applications/order/groovyScripts/entry/CheckInits.groovy Wed Nov 2 19:09:13 2016 @@ -17,51 +17,51 @@ * under the License. */ -import org.apache.ofbiz.service.*; -import org.apache.ofbiz.entity.*; -import org.apache.ofbiz.entity.condition.*; -import org.apache.ofbiz.entity.util.*; -import org.apache.ofbiz.base.util.*; -import org.apache.ofbiz.order.shoppingcart.*; -import org.apache.ofbiz.party.party.PartyWorker; -import org.apache.ofbiz.party.contact.ContactHelper; -import org.apache.ofbiz.product.catalog.CatalogWorker; -import org.apache.ofbiz.product.store.ProductStoreWorker; -import org.apache.ofbiz.order.shoppingcart.product.ProductDisplayWorker; -import org.apache.ofbiz.order.shoppingcart.product.ProductPromoWorker; +import org.apache.ofbiz.service.* +import org.apache.ofbiz.entity.* +import org.apache.ofbiz.entity.condition.* +import org.apache.ofbiz.entity.util.* +import org.apache.ofbiz.base.util.* +import org.apache.ofbiz.order.shoppingcart.* +import org.apache.ofbiz.party.party.PartyWorker +import org.apache.ofbiz.party.contact.ContactHelper +import org.apache.ofbiz.product.catalog.CatalogWorker +import org.apache.ofbiz.product.store.ProductStoreWorker +import org.apache.ofbiz.order.shoppingcart.product.ProductDisplayWorker +import org.apache.ofbiz.order.shoppingcart.product.ProductPromoWorker -productStore = ProductStoreWorker.getProductStore(request); +productStore = ProductStoreWorker.getProductStore(request) if (productStore) { - context.defaultProductStore = productStore; + context.defaultProductStore = productStore if (productStore.defaultSalesChannelEnumId) - context.defaultSalesChannel = from("Enumeration").where("enumId", productStore.defaultSalesChannelEnumId).cache(true).queryOne(); + context.defaultSalesChannel = from("Enumeration").where("enumId", productStore.defaultSalesChannelEnumId).cache(true).queryOne() } // Get the Cart -shoppingCart = session.getAttribute("shoppingCart"); -context.shoppingCart = shoppingCart; +shoppingCart = session.getAttribute("shoppingCart") +context.shoppingCart = shoppingCart -salesChannels = from("Enumeration").where("enumTypeId", "ORDER_SALES_CHANNEL").orderBy("sequenceId").cache(true).queryList(); -context.salesChannels = salesChannels; +salesChannels = from("Enumeration").where("enumTypeId", "ORDER_SALES_CHANNEL").orderBy("sequenceId").cache(true).queryList() +context.salesChannels = salesChannels -productStores = from("ProductStore").orderBy("productStoreId", "storeName").cache(true).queryList(); -context.productStores = productStores; +productStores = from("ProductStore").orderBy("productStoreId", "storeName").cache(true).queryList() +context.productStores = productStores -suppliers = from("PartyRoleAndPartyDetail").where("roleTypeId", "SUPPLIER").orderBy("groupName", "partyId").queryList(); -context.suppliers = suppliers; +suppliers = from("PartyRoleAndPartyDetail").where("roleTypeId", "SUPPLIER").orderBy("groupName", "partyId").queryList() +context.suppliers = suppliers -organizations = from("PartyAcctgPrefAndGroup").queryList(); -context.organizations = organizations; +organizations = from("PartyAcctgPrefAndGroup").queryList() +context.organizations = organizations // Set Shipping From the Party -partyId = null; -partyId = parameters.partyId; +partyId = null +partyId = parameters.partyId if (partyId) { - party = from("Person").where("partyId", partyId).queryOne(); + party = from("Person").where("partyId", partyId).queryOne() if (party) { - contactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false)); + contactMech = EntityUtil.getFirst(ContactHelper.getContactMech(party, "SHIPPING_LOCATION", "POSTAL_ADDRESS", false)) if (contactMech) { - ShoppingCart shoppingCart = ShoppingCartEvents.getCartObject(request); - shoppingCart.setAllShippingContactMechId(contactMech.contactMechId); + ShoppingCart shoppingCart = ShoppingCartEvents.getCartObject(request) + shoppingCart.setAllShippingContactMechId(contactMech.contactMechId) } } } Modified: ofbiz/trunk/applications/order/groovyScripts/entry/CheckoutOptions.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/groovyScripts/entry/CheckoutOptions.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/order/groovyScripts/entry/CheckoutOptions.groovy (original) +++ ofbiz/trunk/applications/order/groovyScripts/entry/CheckoutOptions.groovy Wed Nov 2 19:09:13 2016 @@ -17,81 +17,81 @@ * under the License. */ -import org.apache.ofbiz.base.util.*; -import org.apache.ofbiz.entity.*; -import org.apache.ofbiz.entity.util.*; -import org.apache.ofbiz.accounting.payment.*; -import org.apache.ofbiz.party.contact.*; -import org.apache.ofbiz.product.store.*; -import org.apache.ofbiz.order.shoppingcart.shipping.*; - -shoppingCart = session.getAttribute("shoppingCart"); -currencyUomId = shoppingCart.getCurrency(); -partyId = shoppingCart.getPartyId(); -party = from("Party").where("partyId", partyId).cache(true).queryOne(); -productStore = ProductStoreWorker.getProductStore(request); +import org.apache.ofbiz.base.util.* +import org.apache.ofbiz.entity.* +import org.apache.ofbiz.entity.util.* +import org.apache.ofbiz.accounting.payment.* +import org.apache.ofbiz.party.contact.* +import org.apache.ofbiz.product.store.* +import org.apache.ofbiz.order.shoppingcart.shipping.* + +shoppingCart = session.getAttribute("shoppingCart") +currencyUomId = shoppingCart.getCurrency() +partyId = shoppingCart.getPartyId() +party = from("Party").where("partyId", partyId).cache(true).queryOne() +productStore = ProductStoreWorker.getProductStore(request) -shippingEstWpr = null; +shippingEstWpr = null if (shoppingCart) { - shippingEstWpr = new ShippingEstimateWrapper(dispatcher, shoppingCart, 0); - context.shippingEstWpr = shippingEstWpr; - context.carrierShipmentMethodList = shippingEstWpr.getShippingMethods(); + shippingEstWpr = new ShippingEstimateWrapper(dispatcher, shoppingCart, 0) + context.shippingEstWpr = shippingEstWpr + context.carrierShipmentMethodList = shippingEstWpr.getShippingMethods() // Reassign items requiring drop-shipping to new or existing drop-ship groups - shoppingCart.createDropShipGroups(dispatcher); + shoppingCart.createDropShipGroups(dispatcher) } -profiledefs = from("PartyProfileDefault").where("partyId", userLogin.partyId, "productStoreId", productStoreId).queryOne(); -context.profiledefs = profiledefs; +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 = 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); +context.shoppingCart = shoppingCart +context.userLogin = userLogin +context.productStoreId = productStore.get("productStoreId") +context.productStore = productStore +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) if (shoppingCart.getShipmentMethodTypeId() && shoppingCart.getCarrierPartyId()) { - context.chosenShippingMethod = shoppingCart.getShipmentMethodTypeId() + '@' + shoppingCart.getCarrierPartyId(); + context.chosenShippingMethod = shoppingCart.getShipmentMethodTypeId() + '@' + shoppingCart.getCarrierPartyId() } else if (profiledefs?.defaultShipMeth) { - context.chosenShippingMethod = profiledefs.defaultShipMeth; + context.chosenShippingMethod = profiledefs.defaultShipMeth } // other profile defaults if (!shoppingCart.getShippingAddress() && profiledefs?.defaultShipAddr) { - shoppingCart.setAllShippingContactMechId(profiledefs.defaultShipAddr); + shoppingCart.setAllShippingContactMechId(profiledefs.defaultShipAddr) } if (shoppingCart.selectedPayments() == 0 && profiledefs?.defaultPayMeth) { - shoppingCart.addPayment(profiledefs.defaultPayMeth); + shoppingCart.addPayment(profiledefs.defaultPayMeth) } // create a list containing all the parties associated to the current cart, useful to change // the ship to party id -cartParties = [shoppingCart.getShipToCustomerPartyId()]; +cartParties = [shoppingCart.getShipToCustomerPartyId()] if (!cartParties.contains(partyId)) { - cartParties.add(partyId); + cartParties.add(partyId) } if (!cartParties.contains(shoppingCart.getOrderPartyId())) { - cartParties.add(shoppingCart.getOrderPartyId()); + cartParties.add(shoppingCart.getOrderPartyId()) } if (!cartParties.contains(shoppingCart.getPlacingCustomerPartyId())) { - cartParties.add(shoppingCart.getPlacingCustomerPartyId()); + cartParties.add(shoppingCart.getPlacingCustomerPartyId()) } if (!cartParties.contains(shoppingCart.getBillToCustomerPartyId())) { - cartParties.add(shoppingCart.getBillToCustomerPartyId()); + cartParties.add(shoppingCart.getBillToCustomerPartyId()) } if (!cartParties.contains(shoppingCart.getEndUserCustomerPartyId())) { - cartParties.add(shoppingCart.getEndUserCustomerPartyId()); + cartParties.add(shoppingCart.getEndUserCustomerPartyId()) } if (!cartParties.contains(shoppingCart.getSupplierAgentPartyId())) { - cartParties.add(shoppingCart.getSupplierAgentPartyId()); + cartParties.add(shoppingCart.getSupplierAgentPartyId()) } -salesReps = shoppingCart.getAdditionalPartyRoleMap().SALES_REP; +salesReps = shoppingCart.getAdditionalPartyRoleMap().SALES_REP if (salesReps) { salesReps.each { salesRep -> if (!cartParties.contains(salesRep)) { - cartParties.add(salesRep); + cartParties.add(salesRep) } } } -context.cartParties = cartParties; +context.cartParties = cartParties Modified: ofbiz/trunk/applications/order/groovyScripts/entry/CheckoutPayment.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/groovyScripts/entry/CheckoutPayment.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/applications/order/groovyScripts/entry/CheckoutPayment.groovy (original) +++ ofbiz/trunk/applications/order/groovyScripts/entry/CheckoutPayment.groovy Wed Nov 2 19:09:13 2016 @@ -17,59 +17,59 @@ * under the License. */ -import org.apache.ofbiz.base.util.*; -import org.apache.ofbiz.entity.*; -import org.apache.ofbiz.entity.util.*; -import org.apache.ofbiz.accounting.payment.*; -import org.apache.ofbiz.party.contact.*; -import org.apache.ofbiz.product.store.*; - -cart = session.getAttribute("shoppingCart"); -currencyUomId = cart.getCurrency(); -userLogin = session.getAttribute("userLogin"); -partyId = cart.getPartyId(); -party = from("Party").where("partyId", partyId).cache(true).queryOne(); -productStoreId = ProductStoreWorker.getProductStoreId(request); +import org.apache.ofbiz.base.util.* +import org.apache.ofbiz.entity.* +import org.apache.ofbiz.entity.util.* +import org.apache.ofbiz.accounting.payment.* +import org.apache.ofbiz.party.contact.* +import org.apache.ofbiz.product.store.* + +cart = session.getAttribute("shoppingCart") +currencyUomId = cart.getCurrency() +userLogin = session.getAttribute("userLogin") +partyId = cart.getPartyId() +party = from("Party").where("partyId", partyId).cache(true).queryOne() +productStoreId = ProductStoreWorker.getProductStoreId(request) -checkOutPaymentId = ""; +checkOutPaymentId = "" if (cart) { if (cart.getPaymentMethodIds()) { - checkOutPaymentId = cart.getPaymentMethodIds().get(0); + checkOutPaymentId = cart.getPaymentMethodIds().get(0) } else if (cart.getPaymentMethodTypeIds()) { - checkOutPaymentId = cart.getPaymentMethodTypeIds().get(0); + checkOutPaymentId = cart.getPaymentMethodTypeIds().get(0) } } -finAccounts = from("FinAccountAndRole").where("partyId", partyId, "roleTypeId", "OWNER").filterByDate(UtilDateTime.nowTimestamp(), "fromDate", "thruDate", "roleFromDate", "roleThruDate").queryList(); -context.finAccounts = finAccounts; +finAccounts = from("FinAccountAndRole").where("partyId", partyId, "roleTypeId", "OWNER").filterByDate(UtilDateTime.nowTimestamp(), "fromDate", "thruDate", "roleFromDate", "roleThruDate").queryList() +context.finAccounts = finAccounts -context.shoppingCart = cart; -context.userLogin = userLogin; -context.productStoreId = productStoreId; -context.checkOutPaymentId = checkOutPaymentId; -context.paymentMethodList = EntityUtil.filterByDate(party.getRelated("PaymentMethod", null, ["paymentMethodTypeId"], false), true); +context.shoppingCart = cart +context.userLogin = userLogin +context.productStoreId = productStoreId +context.checkOutPaymentId = checkOutPaymentId +context.paymentMethodList = EntityUtil.filterByDate(party.getRelated("PaymentMethod", null, ["paymentMethodTypeId"], false), true) -billingAccountList = BillingAccountWorker.makePartyBillingAccountList(userLogin, currencyUomId, partyId, delegator, dispatcher); +billingAccountList = BillingAccountWorker.makePartyBillingAccountList(userLogin, currencyUomId, partyId, delegator, dispatcher) if (billingAccountList) { - context.selectedBillingAccountId = cart.getBillingAccountId(); - context.billingAccountList = billingAccountList; + context.selectedBillingAccountId = cart.getBillingAccountId() + context.billingAccountList = billingAccountList } -checkIdealPayment = false; -productStore = ProductStoreWorker.getProductStore(request); -productStorePaymentSettingList = productStore.getRelated("ProductStorePaymentSetting", null, null, true); -productStorePaymentSettingIter = productStorePaymentSettingList.iterator(); +checkIdealPayment = false +productStore = ProductStoreWorker.getProductStore(request) +productStorePaymentSettingList = productStore.getRelated("ProductStorePaymentSetting", null, null, true) +productStorePaymentSettingIter = productStorePaymentSettingList.iterator() while (productStorePaymentSettingIter.hasNext()) { - productStorePaymentSetting = productStorePaymentSettingIter.next(); + productStorePaymentSetting = productStorePaymentSettingIter.next() if (productStorePaymentSetting.get("paymentMethodTypeId") == "EXT_IDEAL") { - checkIdealPayment = true; + checkIdealPayment = true } } if (checkIdealPayment) { - issuerList = org.apache.ofbiz.accounting.thirdparty.ideal.IdealEvents.getIssuerList(); + issuerList = org.apache.ofbiz.accounting.thirdparty.ideal.IdealEvents.getIssuerList() if (issuerList) { - context.issuerList = issuerList; + context.issuerList = issuerList } } |
Free forum by Nabble | Edit this page |