Package org.ofbiz.entity

Examples of org.ofbiz.entity.GenericDelegator.findList()


            // COD only applies if all orders involved with the shipment were paid only with EXT_COD - anything else becomes too complicated
            if (allowCOD) {

                // Get the paymentMethodTypeIds of all the orderPaymentPreferences involved with the shipment
                List<GenericValue> opps = delegator.findList("OrderPaymentPreference", EntityCondition.makeCondition("orderId", EntityOperator.IN, orderIdSet), null, null, null, false);
                List<String> paymentMethodTypeIds = EntityUtil.getFieldListFromEntityList(opps, "paymentMethodTypeId", true);

                if (paymentMethodTypeIds.size() > 1 || ! paymentMethodTypeIds.contains("EXT_COD")) {
                    allowCOD = false;
                }
View Full Code Here


        Map result = new HashMap();
        GenericDelegator delegator = dctx.getDelegator();
        LocalDispatcher dispatcher = dctx.getDispatcher();

        try {
            List products = delegator.findList("Product", null, null, UtilMisc.toList("isVirtual DESC"), null, false);
            Iterator productsIt = products.iterator();
            Long zero = new Long(0);
            List allProducts = new ArrayList();
            while (productsIt.hasNext()) {
                GenericValue product = (GenericValue)productsIt.next();
View Full Code Here

                        EntityCondition.makeCondition("currentStatusId", EntityOperator.NOT_EQUAL, "WF_TERMINATED"),
                        EntityCondition.makeCondition("currentStatusId", EntityOperator.NOT_EQUAL, "WF_ABORTED"),
                        EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "TASK"),
                        EntityCondition.makeCondition("workEffortPurposeTypeId", EntityOperator.EQUALS, "WEPT_PROJECT")),
                        EntityOperator.AND);
                validWorkEfforts = delegator.findList("WorkEffortAndPartyAssign", ecl, null, UtilMisc.toList("priority"), null, false);
            } catch (GenericEntityException e) {
                Debug.logWarning(e, module);
            }
        }
        if (validWorkEfforts == null || validWorkEfforts.size() <= 0)
View Full Code Here

                EntityConditionList<EntityExpr> ecl = EntityCondition.makeCondition(UtilMisc.toList(
                        EntityCondition.makeCondition("partyId", EntityOperator.EQUALS, userLogin.get("partyId")),
                        EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "TASK"),
                        EntityCondition.makeCondition("workEffortPurposeTypeId", EntityOperator.EQUALS, "WEPT_PROJECT")),
                        EntityOperator.AND);
                validWorkEfforts = delegator.findList("WorkEffortAndPartyAssign", ecl, null, UtilMisc.toList("priority"), null, false);
            } catch (GenericEntityException e) {
                Debug.logWarning(e, module);
            }
        }
        if (validWorkEfforts == null || validWorkEfforts.size() <= 0)
View Full Code Here

            try {
                EntityConditionList<EntityExpr> ecl = EntityCondition.makeCondition(UtilMisc.toList(
                        EntityCondition.makeCondition("workEffortIdFrom", EntityOperator.EQUALS, projectWorkEffortId),
                        EntityCondition.makeCondition("workEffortAssocTypeId", EntityOperator.EQUALS, "WORK_EFF_BREAKDOWN")),
                        EntityOperator.AND);
                relatedWorkEfforts = delegator.findList("WorkEffortAssoc", ecl, null, null, null, false);
            } catch (GenericEntityException e) {
                Debug.logWarning(e, module);
            }
        }
View Full Code Here

            try {
                EntityConditionList<EntityExpr> ecl = EntityCondition.makeCondition(UtilMisc.toList(
                        EntityCondition.makeCondition("workEffortIdFrom", EntityOperator.EQUALS, phaseWorkEffortId),
                        EntityCondition.makeCondition("workEffortAssocTypeId", EntityOperator.EQUALS, "WORK_EFF_BREAKDOWN")),
                        EntityOperator.AND);
                relatedWorkEfforts = delegator.findList("WorkEffortAssoc", ecl, null, null, null, false);
            } catch (GenericEntityException e) {
                Debug.logWarning(e, module);
            }
        }
View Full Code Here

        Collection<GenericValue> notes = null;

        if (userLogin != null && userLogin.get("partyId") != null) {
            try {
                EntityExpr ee = EntityCondition.makeCondition("workEffortId", EntityOperator.EQUALS, workEffortId);
                notes = delegator.findList("WorkEffortNoteAndData", ee, null, UtilMisc.toList("noteDateTime"), null, false);
            } catch (GenericEntityException e) {
                Debug.logWarning(e, module);
            }
        }
        if (notes == null || notes.size() <= 0)
View Full Code Here

        constraints.add(EntityCondition.makeCondition("currentStatusId", EntityOperator.EQUALS, "ROU_ACTIVE"));
        constraints.add(EntityCondition.makeCondition("workEffortTypeId", EntityOperator.EQUALS, "ROU_TASK"));

        EntityConditionList<EntityExpr> ecl = EntityCondition.makeCondition(constraints, EntityOperator.AND);
        try {
            listRoutingTask = delegator.findList("WorkEffort", ecl, null, UtilMisc.toList("workEffortName"), null, false);
        } catch (GenericEntityException e) {
            Debug.logWarning(e, module);
            return ServiceUtil.returnError("Error finding desired WorkEffort records: " + e.toString());
        }
        if (listRoutingTask == null) listRoutingTask = new LinkedList();
View Full Code Here

            }

            if ("Y".equals(productStore.getString("showPricesWithVatTax"))) {
                Set taxAuthoritySet = FastSet.newInstance();
                if (productStore.get("vatTaxAuthPartyId") == null) {
                    List taxAuthorityRawList = delegator.findList("TaxAuthority", EntityCondition.makeCondition("taxAuthGeoId", EntityOperator.EQUALS, productStore.get("vatTaxAuthGeoId")), null, null, null, true);
                    taxAuthoritySet.addAll(taxAuthorityRawList);
                } else {
                    GenericValue taxAuthority = delegator.findByPrimaryKeyCache("TaxAuthority", UtilMisc.toMap("taxAuthGeoId", productStore.get("vatTaxAuthGeoId"), "taxAuthPartyId", productStore.get("vatTaxAuthPartyId")));
                    taxAuthoritySet.add(taxAuthority);
                }
View Full Code Here

                    EntityCondition.makeConditionMap("isClosed", "Y"));
            if ((periodTypeId != null) && !(periodTypeId.equals(""))) {
                // if a periodTypeId was supplied, use it
                findClosedConditions.add(EntityCondition.makeConditionMap("periodTypeId", periodTypeId));
            }
            List<GenericValue> closedTimePeriods = delegator.findList("CustomTimePeriod", EntityCondition.makeCondition(findClosedConditions),
                    UtilMisc.toSet("customTimePeriodId", "periodTypeId", "isClosed", "fromDate", "thruDate"),
                    UtilMisc.toList("thruDate DESC"), null, false);

            if ((closedTimePeriods != null) && (closedTimePeriods.size() > 0) && (closedTimePeriods.get(0).get("thruDate") != null)) {
                lastClosedTimePeriod = closedTimePeriods.get(0);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.