/// <summary> /// Gets replenishment list for item id in logical store storeid /// </summary> /// <param name="itemId">The item id.</param> /// <param name="storeId">The store id.</param> /// <returns></returns> public DataTable GetReplenishmentListFor(int itemId, int storeId) { PalletLocation.CalculateAllVolumes(itemId); string query = HCMIS.Repository.Queries.PickFace.SelectGetReplenishmentListFor(itemId, storeId, StorageType.BulkStore); this.LoadFromRawSql(query); this.DataTable.Columns.Add("SKU", typeof(int)); this.DataTable.Columns.Add("CanReplenish", typeof(bool)); ItemManufacturer im = new ItemManufacturer(); DateTime exp = new DateTime(); int boxsize = -1; int j = 0; while (!this.EOF) { if (j == 0) { this.SetColumn("CanReplenish", true); boxsize = Convert.ToInt32(this.GetColumn("BoxSize")); if (!this.IsColumnNull("ExpiryDate")) { exp = Convert.ToDateTime(this.GetColumn("ExpiryDate")); } } else { int bs = Convert.ToInt32(this.GetColumn("BoxSize")); if (bs < boxsize && exp.Subtract(Convert.ToDateTime(this.GetColumn("ExpiryDate"))).Days == 0) { this.SetColumn("CanReplenish", true); } else { this.SetColumn("CanReplenish", false); } } j++; im.LoadIMbyLevel(Convert.ToInt32(this.GetColumn("ItemID")), Convert.ToInt32(this.GetColumn("ManufacturerID")), 0); int i = Convert.ToInt32(this.GetColumn("Balance")); this.SetColumn("SKU", i / im.QuantityInBasicUnit); this.MoveNext(); } return(this.DataTable); }