inv.setBaseCDay(cDay);
inv.setBaseCDay(startingCDay);
  private UISimpleInventory getInventoryForClient(UIInventoryImpl inventory,						  boolean provider,						  Date cDay) {    UISimpleInventory inv = new UISimpleInventory();        inv.setAssetName(inventory.getAssetName());    inv.setUnitType(inventory.getUnitType());    inv.setProvider(provider); // ui uses this to determine chart labels    String scheduleType = inventory.getScheduleType();    if (scheduleType.equals(ScheduleType.OTHER)) {      scheduleType = PlanScheduleType.TOTAL_INVENTORY;      System.out.println("WARNING: Treating Other schedule as total inventory");    }    inv.setScheduleType(scheduleType);    inv.setBaseCDay(cDay);    if (scheduleType.equals(PlanScheduleType.TOTAL_CAPACITY)) {      inv.addNamedSchedule(ALLOCATED,   inventory.getDueOutLaborSchedule());      inv.addNamedSchedule(TOTAL_LABOR, inventory.getLaborSchedule());    } else if (scheduleType.equals(PlanScheduleType.ACTUAL_CAPACITY)) {      inv.addNamedSchedule(ALLOCATED, inventory.getDueOutLaborSchedule());      inv.addNamedSchedule(ON_HAND,   inventory.getOnHandDailySchedule());    } else if (scheduleType.equals(PlanScheduleType.TOTAL_INVENTORY)) {      inv.addNamedSchedule(ON_HAND,                               inventory.getOnHandDailySchedule());      inv.addNamedSchedule(ON_HAND_DETAILED,                      inventory.getOnHandDetailedSchedule());      /*** MWD Remove       **  Generate a false detailed schedule       *      if(inventory.getOnHandDetailedSchedule() != null) {	  Vector lotsODetails = new Vector();	  int divElement=5;	  Vector onHand = inventory.getOnHandDailySchedule();	  for(int i=0; i < onHand.size() ; i++) {	      UIQuantityScheduleElement orig = (UIQuantityScheduleElement) onHand.elementAt(i);	      long  myStart = orig.getStartTime();	      long  myEnd = orig.getEndTime(); 	      divElement = (int) i%7;	      if(divElement==0) divElement=1;	      long  addTime = (long) (myEnd - myStart)/divElement;	      double  changeQty = 10;	      for (int j=0; j < divElement; j++) {		  changeQty = ((changeQty) * j);		  double elQty = orig.getQuantity() + changeQty;		  if(elQty != orig.getQuantity()) {		      System.out.println("Different! I'd say orig: " + orig.getQuantity() + " elQty: " + elQty);		  }		  lotsODetails.add(new UIQuantityScheduleElement(myStart, myStart + addTime, elQty));		  myStart+=addTime;	      }	  }	  inv.addNamedSchedule(ON_HAND_DETAILED,lotsODetails);      }            **      ***/      inv.addNamedSchedule(DUE_IN,                                inventory.getDueInSchedule());      inv.addNamedSchedule(UNCONFIRMED_DUE_IN,                    inventory.getUnconfirmedDueInSchedule());      inv.addNamedSchedule(REQUESTED_DUE_IN,                      inventory.getRequestedDueInSchedule());      inv.addNamedSchedule(PROJECTED_DUE_IN,                      inventory.getProjectedDueInSchedule());      inv.addNamedSchedule(PROJECTED_REQUESTED_DUE_IN,            inventory.getProjectedRequestedDueInSchedule());      inv.addNamedSchedule(DUE_IN                      +INACTIVE, inventory.getInactiveDueInSchedule());      inv.addNamedSchedule(UNCONFIRMED_DUE_IN          +INACTIVE, inventory.getInactiveUnconfirmedDueInSchedule());      inv.addNamedSchedule(REQUESTED_DUE_IN            +INACTIVE, inventory.getInactiveRequestedDueInSchedule());      inv.addNamedSchedule(PROJECTED_DUE_IN            +INACTIVE, inventory.getInactiveProjectedDueInSchedule());      inv.addNamedSchedule(PROJECTED_REQUESTED_DUE_IN  +INACTIVE, inventory.getInactiveProjectedRequestedDueInSchedule());                inv.addNamedSchedule(DUE_OUT,                               inventory.getDueOutSchedule());      inv.addNamedSchedule(REQUESTED_DUE_OUT,                     inventory.getRequestedDueOutSchedule());      inv.addNamedSchedule(PROJECTED_DUE_OUT,                     inventory.getProjectedDueOutSchedule());      inv.addNamedSchedule(PROJECTED_REQUESTED_DUE_OUT,           inventory.getProjectedRequestedDueOutSchedule());                                           inv.addNamedSchedule(DUE_OUT                     +INACTIVE, inventory.getInactiveDueOutSchedule());      inv.addNamedSchedule(PROJECTED_DUE_OUT           +INACTIVE, inventory.getInactiveProjectedDueOutSchedule());      inv.addNamedSchedule(REQUESTED_DUE_OUT           +INACTIVE, inventory.getInactiveRequestedDueOutSchedule());      inv.addNamedSchedule(PROJECTED_REQUESTED_DUE_OUT +INACTIVE, inventory.getInactiveProjectedRequestedDueOutSchedule());      inventory.computeSimulatedProjectionSchedules();            //inv.addNamedSchedule(ON_HAND,                               inventory.getOnHandMockSchedule());      //inv.addNamedSchedule(PROJECTED_DUE_IN,                      inventory.getProjectedMockDueInSchedule());      //inv.addNamedSchedule(PROJECTED_REQUESTED_DUE_IN,            inventory.getProjectedRequestedMockDueInSchedule());      //inv.addNamedSchedule(PROJECTED_DUE_OUT,                     inventory.getProjectedMockDueOutSchedule());      //inv.addNamedSchedule(PROJECTED_REQUESTED_DUE_OUT,           inventory.getProjectedRequestedMockDueOutSchedule());            inv.addNamedSchedule(ON_HAND_MOCK_PERIOD,                    inventory.getOnHandMockSchedule());      inv.addNamedSchedule(PROJECTED_DUE_IN_MOCK_PERIOD,           inventory.getProjectedMockDueInSchedule());      inv.addNamedSchedule(PROJECTED_REQUESTED_DUE_IN_MOCK_PERIOD, inventory.getProjectedRequestedMockDueInSchedule());      inv.addNamedSchedule(PROJECTED_DUE_OUT_MOCK_PERIOD,          inventory.getProjectedMockDueOutSchedule());      inv.addNamedSchedule(PROJECTED_REQUESTED_DUE_OUT_MOCK_PERIOD,inventory.getProjectedRequestedMockDueOutSchedule());      //inv.addNamedSchedule(ON_HAND_MOCK_PERIOD,                    inventory.getOnHandDailySchedule());      //inv.addNamedSchedule(PROJECTED_DUE_IN_MOCK_PERIOD,           inventory.getProjectedDueInSchedule());      //inv.addNamedSchedule(PROJECTED_REQUESTED_DUE_IN_MOCK_PERIOD, inventory.getProjectedRequestedDueInSchedule());      //inv.addNamedSchedule(PROJECTED_DUE_OUT_MOCK_PERIOD,          inventory.getProjectedDueOutSchedule());      //inv.addNamedSchedule(PROJECTED_REQUESTED_DUE_OUT_MOCK_PERIOD,inventory.getProjectedRequestedDueOutSchedule());      inv.addNamedSchedule(GOAL_LEVEL,              inventory.getGoalLevelSchedule());      inv.addNamedSchedule(REORDER_LEVEL,           inventory.getReorderLevelSchedule());      inv.addNamedSchedule(AVERAGE_DEMAND_LEVEL,    inventory.getAverageDemandSchedule());    }     else if (scheduleType.equals(inventory.NO_INVENTORY_SCHEDULE_JUST_CONSUME)){	inv.addNamedSchedule(DUE_IN,                              inventory.getDueInSchedule());	inv.addNamedSchedule(UNCONFIRMED_DUE_IN,                  inventory.getUnconfirmedDueInSchedule());	inv.addNamedSchedule(REQUESTED_DUE_IN,                    inventory.getRequestedDueInSchedule());	inv.addNamedSchedule(PROJECTED_DUE_IN,                    inventory.getProjectedDueInSchedule());	inv.addNamedSchedule(PROJECTED_REQUESTED_DUE_IN,          inventory.getProjectedRequestedDueInSchedule());	inv.addNamedSchedule(DUE_IN                    +INACTIVE, inventory.getInactiveDueInSchedule());	inv.addNamedSchedule(PROJECTED_DUE_IN          +INACTIVE, inventory.getInactiveProjectedDueInSchedule());	inv.addNamedSchedule(UNCONFIRMED_DUE_IN        +INACTIVE, inventory.getInactiveUnconfirmedDueInSchedule());	inv.addNamedSchedule(REQUESTED_DUE_IN          +INACTIVE, inventory.getInactiveRequestedDueInSchedule());	inv.addNamedSchedule(PROJECTED_REQUESTED_DUE_IN+INACTIVE, inventory.getInactiveProjectedRequestedDueInSchedule());	System.out.println("getInventoryForClient: returning schedule type: " + scheduleType);    }     else {      System.out.println("WARNING: Unsupported schedule type: " + 			 scheduleType);      return null;    }    return inv;  }