Package org.ofbiz.entity

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


        BigDecimal qtyToVerified = ZERO;
        BigDecimal verifiedQuantity = ZERO;
        BigDecimal readyToVerifyQty = ZERO;
        int counter = 0;
        try {
            List<GenericValue> orderItems = delegator.findByAnd("OrderItem", UtilMisc.toMap("orderId", orderId));
            for (GenericValue orderItem : orderItems) {
                if (productId.equals(orderItem.getString("productId"))) {
                    orderItemSeqIds.add(orderItem.getString("orderItemSeqId"));
                    isProductId = true;
                }
View Full Code Here


                for (String orderItemSeqId : orderItemSeqIds) {
                    counter++;
                    if (quantity.compareTo(ZERO) > 0) {
                        GenericValue orderItem = delegator.findOne("OrderItem", UtilMisc.toMap("orderId", orderId , "orderItemSeqId", orderItemSeqId), false);
                        BigDecimal orderedQuantity = orderItem.getBigDecimal("quantity");
                        List<GenericValue> shipments = delegator.findByAnd("Shipment", UtilMisc.toMap("primaryOrderId", orderId , "statusId", "SHIPMENT_PICKED"));
                        for(GenericValue shipment : shipments) {
                            List<GenericValue> orderShipments = shipment.getRelatedByAnd("OrderShipment" , UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId));
                            for(GenericValue orderShipment : orderShipments) {
                                verifiedQuantity = verifiedQuantity.add(orderShipment.getBigDecimal("quantity"));
                            }
View Full Code Here

                BigDecimal quantity = new BigDecimal(quantityMap.get(rowKey));
                if (quantity.compareTo(ZERO) > 0) {
                    try {
                        GenericValue orderItem = delegator.findOne("OrderItem", UtilMisc.toMap("orderId", orderId , "orderItemSeqId", orderItemSeqId), false);
                        BigDecimal orderedQuantity = orderItem.getBigDecimal("quantity");
                        List<GenericValue> shipments = delegator.findByAnd("Shipment", UtilMisc.toMap("primaryOrderId", orderId , "statusId", "SHIPMENT_PICKED"));
                        for(GenericValue shipment : shipments) {
                            List<GenericValue> orderShipments = shipment.getRelatedByAnd("OrderShipment" , UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId));
                            for(GenericValue orderShipment : orderShipments) {
                                verifiedQuantity = verifiedQuantity.add(orderShipment.getBigDecimal("quantity"));
                            }
View Full Code Here

            GenericValue orderPaymentPreferenceSum = (GenericValue) oppsi.next();
            BigDecimal maxAmount = orderPaymentPreferenceSum.getBigDecimal("maxAmount");
            balance = maxAmount != null ? balance.subtract(maxAmount) : balance;
        }

        List paymentAppls = delegator.findByAnd("PaymentApplication", UtilMisc.toMap("billingAccountId", billingAccountId));
        // TODO: cancelled payments?
        for (Iterator pAi = paymentAppls.iterator(); pAi.hasNext(); ) {
            GenericValue paymentAppl = (GenericValue) pAi.next();
            if (paymentAppl.getString("invoiceId") == null) {
                BigDecimal amountApplied = paymentAppl.getBigDecimal("amountApplied");
View Full Code Here

        LocalDispatcher dispatcher = dctx.getDispatcher();
        String shipmentId = (String) context.get("shipmentId");
        GenericValue userLogin = (GenericValue) context.get("userLogin");
        try {

            List<GenericValue> shipmentReceipts = delegator.findByAnd("ShipmentReceipt", UtilMisc.toMap("shipmentId", shipmentId));
            if (shipmentReceipts.size() == 0) return ServiceUtil.returnSuccess();

            // If there are shipment receipts, the shipment must have been shipped, so set the shipment status to PURCH_SHIP_SHIPPED if it's only PURCH_SHIP_CREATED
            GenericValue shipment = delegator.findByPrimaryKey("Shipment", UtilMisc.toMap("shipmentId", shipmentId));
            if ((! UtilValidate.isEmpty(shipment)) && "PURCH_SHIP_CREATED".equals(shipment.getString("statusId"))) {
View Full Code Here

                if (ServiceUtil.isError(updateShipmentMap)) {
                    return updateShipmentMap;
                }
            }

            List<GenericValue> shipmentAndItems = delegator.findByAnd("ShipmentAndItem", UtilMisc.toMap("shipmentId", shipmentId, "statusId", "PURCH_SHIP_SHIPPED"));
            if (shipmentAndItems.size() == 0) {
                return ServiceUtil.returnSuccess();
            }

            // store the quantity of each product shipped in a hashmap keyed to productId
View Full Code Here

                String errorMessage = UtilProperties.getMessage(resource, "ProductShipmentPackageNotFound", context, locale);
                Debug.logError(errorMessage, module);
                return ServiceUtil.returnError(errorMessage);
            }

            List<GenericValue> packageContents = delegator.findByAnd("PackedQtyVsOrderItemQuantity", UtilMisc.toMap("shipmentId", shipmentId, "shipmentPackageSeqId", shipmentPackageSeqId));
            for (GenericValue packageContent: packageContents) {
                String orderId = packageContent.getString("orderId");
                String orderItemSeqId = packageContent.getString("orderItemSeqId");

                // Get the value of the orderItem by calling the getOrderItemInvoicedAmountAndQuantity service
View Full Code Here

        // Proposed requirements are deleted
        listResult = null;
        List listResultRoles = new ArrayList();
        try {
            listResult = delegator.findByAnd("Requirement", UtilMisc.toMap("requirementTypeId", "PRODUCT_REQUIREMENT", "statusId", "REQ_PROPOSED"));
        } catch (GenericEntityException e) {
            return ServiceUtil.returnError("Problem, we can not find all the items of MrpEvent, for more detail look at the log");
        }
        if (listResult != null) {
            try {
View Full Code Here

                return ServiceUtil.returnError("Problem, we can not remove the MrpEvent items, for more detail look at the log");
            }
        }
        listResult = null;
        try {
            listResult = delegator.findByAnd("Requirement", UtilMisc.toMap("requirementTypeId", "INTERNAL_REQUIREMENT", "statusId", "REQ_PROPOSED"));
        } catch (GenericEntityException e) {
            return ServiceUtil.returnError("Problem, we can not find all the items of MrpEvent, for more detail look at the log");
        }
        if (listResult != null) {
            try {
View Full Code Here

        resultList = null;
        iteratorResult = null;
        parameters = UtilMisc.toMap("orderTypeId", "SALES_ORDER", "oiStatusId", "ITEM_APPROVED");
        parameters.put("facilityId", facilityId);
        try {
            resultList = delegator.findByAnd("OrderHeaderItemAndShipGroup", parameters, UtilMisc.toList("orderId"));
        } catch (GenericEntityException e) {
            Debug.logError(e, "Error : findByAnd(\"OrderItem\", parameters\")", module);
            Debug.logError(e, "Error : parameters = "+parameters,module);
            return ServiceUtil.returnError("Problem, we can not find the order items, for more detail look at the log");
        }
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.