/// <summary> /// Gets the un priced quantity. /// </summary> /// <param name="itemID">The item ID.</param> /// <param name="storeID">The store ID.</param> /// <param name="unitID">The unit ID.</param> /// <param name="manufacturerID">The manufacturer ID.</param> /// <param name="physicalStoreID">The physical store ID.</param> /// <param name="preferredExpiryDate">The preferred expiry date.</param> /// <returns></returns> public Int64 GetUnPricedQuantity(int itemID, int storeID, int? unitID, int? manufacturerID,int? physicalStoreID, DateTime? preferredExpiryDate) { string query; if (BLL.Settings.IsCenter) //If it is center, we don't require it to have been received by delivery notes. { query = HCMIS.Repository.Queries.Balance.SelectGetUnPricedQuantityForCenter(itemID, storeID, unitID, manufacturerID, physicalStoreID, preferredExpiryDate); } else { query = HCMIS.Repository.Queries.Balance.SelectGetUnPricedQuantityForHub(itemID, storeID, unitID, manufacturerID, physicalStoreID, preferredExpiryDate); } BLL.Balance bal = new Balance(); bal.LoadFromRawSql(query); try { if (bal.IsColumnNull("UQ")) return 0; return Convert.ToInt64(bal.GetColumn("UQ")); } catch { return 0; } }