/******************************************************************************* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. *******************************************************************************/ package org.ofbiz.manufacturing.mrp; import java.sql.Timestamp; import java.util.HashMap; import java.util.List; import java.util.ArrayList; import java.util.ListIterator; import java.util.Map; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.manufacturing.bom.BOMTree; import org.ofbiz.manufacturing.jobshopmgt.ProductionRun; import org.ofbiz.manufacturing.techdata.TechDataServices; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; import org.ofbiz.manufacturing.bom.BOMTree; /** * Proposed Order Object generated by the MRP process or other re-Order process * */ public class ProposedOrder { public static final String module = ProposedOrder.class.getName(); public static final String resource = "ManufacturingUiLabels"; protected GenericValue product; protected boolean isBuilt; protected String productId; protected String facilityId; protected String manufacturingFacilityId; protected String mrpName; protected Timestamp requiredByDate; protected Timestamp requirementStartDate; protected double quantity; public ProposedOrder(GenericValue product, String facilityId, String manufacturingFacilityId, boolean isBuilt, Timestamp requiredByDate, double quantity) { this.product = product; this.productId = product.getString("productId"); this.facilityId = facilityId; this.manufacturingFacilityId = manufacturingFacilityId; this.isBuilt = isBuilt; this.requiredByDate = requiredByDate; this.quantity = quantity; this.requirementStartDate = null; } /** * get the quantity property. * @return the quantity property **/ public double getQuantity(){ return quantity; } /** * get the requirementStartDate property. * @return the quantity property **/ public Timestamp getRequirementStartDate(){ return requirementStartDate; } /** * calculate the ProposedOrder requirementStartDate and update the requirementStartDate property. *
  • For the build product, *
  • For the bought product, the first ProductFacility.daysToShip is used to calculated the startDate * @return