public static DataTable GetStockStatusByAccountDamagedExcluded(int AccountID,bool showUnitPrice = false)
        {
            string query;
            if(showUnitPrice)
            {
                query = HCMIS.Repository.Queries.Balance.SelectGetStockStatusByAccountDamagedExcludedShowUnitPrice(AccountID);
            }
            else
            {
                query = HCMIS.Repository.Queries.Balance.SelectGetStockStatusByAccountDamagedExcludedHideUnitPrice(AccountID);
            }

            Balance balance = new Balance();
            balance.LoadFromRawSql(query);
            balance.AddColumn("LineNo", typeof(int));
            int i = 1;
            while (!balance.EOF)
            {
                balance.SetColumn("LineNo", i++);
                balance.MoveNext();
            }
            return balance.DataTable;
        }
        public static DataView GetStockCardByWarehouse(int storeId, int itemId, int? unitID, int fiscalYear, int physicalStoreTypeID,int manufactuerID)
        {
            var ld = new ListDictionary();
            ld.Add("@ItemID", itemId);
            ld.Add("@UnitID", unitID);
            ld.Add("@StoreID", storeId);
            ld.Add("@FiscalYear", fiscalYear);
            ld.Add("@Warehouse", physicalStoreTypeID);
            ld.Add("@Manufacturer",manufactuerID);

            Balance bal = new Balance();
            bal.LoadFromSql("[Rpt_StockCard]", ld, CommandType.StoredProcedure);

            bal.Rewind();
            decimal Balance = 0;
            while (!bal.EOF)
            {
                Balance += Convert.ToDecimal(bal.GetColumn("Balance"));
                bal.SetColumn("Balance", Balance);
                bal.MoveNext();
            }
            return bal.DefaultView;
        }
 public static DataTable GetReservedItemsWithAmount(int modeID)
 {
     BLL.Balance bal = new Balance();
     var query = HCMIS.Repository.Queries.Balance.SelectGetReservedItemsWithAmount(modeID, BLL.OrderStatus.Constant.PICK_LIST_GENERATED, BLL.OrderStatus.Constant.PICK_LIST_CONFIRMED);
     bal.LoadFromRawSql(query);
     while (!bal.EOF)
     {
         bal.SetColumn("Difference", DateTimeHelper.GetDateSpan(Convert.ToDateTime(bal.GetColumn("SavedDate")),
                                                                 DateTimeHelper.ServerDateTime));
         bal.MoveNext();
     }
     return bal.DataTable;
 }
        public static DataView GetStockCardByDate(int storeId, int itemId, int? unitID, int physicalStoreTypeID, int manufactuerID, DateTime fromDate, DateTime toDate)
        {
            var ld = new ListDictionary();
            ld.Add("@ItemID", itemId);
            ld.Add("@UnitID", unitID);
            ld.Add("@StoreID", storeId);
            ld.Add("@fromdate", fromDate);
            ld.Add("@toDate", toDate);
            ld.Add("@Warehouse", physicalStoreTypeID);
            ld.Add("@Manufacturer", manufactuerID);
            Balance bal = new Balance();
            bal.LoadFromSql("[Rpt_StockCardByDate]", ld, CommandType.StoredProcedure);

            bal.Rewind();
            int Balance = 0;
            while (!bal.EOF)
            {
                Balance += Convert.ToInt32(bal.GetColumn("Balance"));
                bal.SetColumn("Balance", Balance);
                bal.MoveNext();
            }
            return bal.DefaultView;
        }
        /// <summary>
        /// Gets bin card by supplier
        /// </summary>
        /// <param name="itemId"></param>
        /// <param name="supplierId"></param>
        /// <returns></returns>
        public static DataView GetBinCard(int storeId, int itemId, int? unitID, int fiscalYear, int supplierId)
        {
            var ld = new ListDictionary();
            ld.Add("@ItemID", itemId);
            ld.Add("@UnitID", unitID);
            ld.Add("@StoreID", storeId);
            ld.Add("@FiscalYear", fiscalYear);
            ld.Add("@SupplierID", supplierId);

            Balance bal = new Balance();
            bal.LoadFromSql("Rpt_BinCardBySupplier", ld, CommandType.StoredProcedure);

            bal.Rewind();
            int Balance = 0;
            while (!bal.EOF)
            {
                Balance += Convert.ToInt32(bal.GetColumn("Balance"));
                bal.SetColumn("Balance", Balance);
                bal.MoveNext();
            }
            return bal.DefaultView;
        }