public static DataTable GetPreviousStockforCostAnalysisPrintout(int ReceiptID)
        {
            Receipt receipt = new Receipt();
            string  query   = HCMIS.Repository.Queries.Receipt.SelectGetPreviousStockforCostAnalysisPrintout(ReceiptID);

            receipt.LoadFromRawSql(query);
            if (BLL.Settings.UseCostTier)
            {
                query = HCMIS.Repository.Queries.Receipt.SelectGetPreviousStockforCostAnalysisPrintoutUseCostTier(ReceiptID);
                receipt.LoadFromRawSql(query);
                return(CostingService.SetPrice(receipt.DataTable));
            }
            return(receipt.DataTable);
        }
        public static DataTable GetReceiptStatusList()
        {
            string query =
                HCMIS.Repository.Queries.Receipt.SelectGetReceiptStatusList();
            Receipt receipt = new Receipt();

            receipt.LoadFromRawSql(query);
            System.Data.DataTable tbl = receipt.DataTable;
            query = HCMIS.Repository.Queries.Receipt.SelectGetReceiptStatusList2();
            receipt.FlushData();
            receipt.LoadFromRawSql(query);

            tbl.Merge(receipt.DataTable);
            return(tbl);
        }
        /// <summary>
        /// Loads the soundp GRV.
        /// </summary>
        public void LoadSoundpGRV()
        {
            Receipt receipt = new Receipt();
            var     query   = HCMIS.Repository.Queries.Receipt.SelectLoadSoundpGRV(ID);

            receipt.LoadFromRawSql(query);
            _pGRVSound = receipt.DefaultView;
        }
        public static DataRow GetReceiptStatusDetail(int receiptID, int receiptStatusID)
        {
            var    receipt = new Receipt();
            string query   = HCMIS.Repository.Queries.Receipt.SelectGetReceiptStatusDetails(receiptID, receiptStatusID);

            receipt.LoadFromRawSql(query);
            return(receipt.DataTable != null && receipt.DataTable.Rows.Count > 0 ? receipt.DataTable.Rows[0] : null);
        }
        public static DataView GetInventoryListByAccount(int movingAverageID, int statusID)
        {
            Receipt receiptInventory = new Receipt();
            string  query            = HCMIS.Repository.Queries.Receipt.SelectGetInventoryListByAccount(movingAverageID, statusID);

            receiptInventory.LoadFromRawSql(query);
            return(receiptInventory.DefaultView);
        }
        public DataTable GetGRVDetailsforCostAnalysis(int ID)
        {
            Receipt receipt = new Receipt();
            string  query   = HCMIS.Repository.Queries.Receipt.SelectGetGRVDetailsforCostAnalysis(ID, BLL.Settings.NoOfDigitsAfterTheDecimalPoint);

            receipt.LoadFromRawSql(query);
            return(receipt.DataTable);
        }
        public static DataTable GetDiscrepancyGRVDetailsforCosting(int ReceiptID)
        {
            Receipt receipt = new Receipt();
            string  query   = HCMIS.Repository.Queries.Receipt.SelectGetDiscrepancyGRVDetailsforCosting(ReceiptID, StorageType.Quaranteen, ShortageReasons.Constants.SHORT_LANDED, ShortageReasons.Constants.DAMAGED);

            receipt.LoadFromRawSql(query);
            return(receipt.DataTable);
        }
        /// <summary>
        /// Gets the inventory list by accountand warehouse.
        /// </summary>
        /// <param name="AccountID">The account ID.</param>
        /// <param name="WarehouseID">The warehouse ID.</param>
        /// <param name="TypeID">The type ID.</param>
        /// <returns></returns>
        public static DataView GetInventoryListByAccountandWarehouse(int AccountID, int WarehouseID, int TypeID)
        {
            Receipt receiptInventory = new Receipt();
            var     query            = HCMIS.Repository.Queries.Receipt.SelectGetInventoryListByAccountandWarehouse(AccountID, WarehouseID, TypeID, ReceiptConfirmationStatus.Constants.RECEIVE_QUANTITY_CONFIRMED, ReceiptConfirmationStatus.Constants.GRNF_PRINTED, ReceiptConfirmationStatus.Constants.PRICE_CALCULATED);

            receiptInventory.LoadFromRawSql(query);
            return(receiptInventory.DefaultView);
        }
        public static DataTable GetItemPriceHistoryCostTierByDate(DateTime Startdate, DateTime Enddate, int userID)
        {
            var query   = HCMIS.Repository.Queries.Receipt.SelectGetItemPriceHistoryByDate(Startdate, Enddate, userID);
            var receipt = new Receipt();

            receipt.LoadFromRawSql(query);
            receipt.DataTable.TableName = "PriceListHistory";
            return(receipt.DataTable);
        }
        /// <summary>
        /// Gets the raw inventory countby accountand warehouse item.
        /// </summary>
        /// <param name="AccountID">The account ID.</param>
        /// <param name="WarehouseID">The warehouse ID.</param>
        /// <param name="ItemID">The item ID.</param>
        /// <param name="UnitID">The unit ID.</param>
        /// <returns></returns>
        public static DataView GetRawInventoryCountbyAccountandWarehouseItem(int AccountID, int WarehouseID, int ItemID, int UnitID)
        {
            Receipt receiptInventory = new Receipt();
            //string query = String.Format("Select  rd.ItemID,rd.UnitID,rd.ManufacturerID,iu.text Unit, vw.FullItemName , sum(rd.NoOfPack) NoOfPack,rd.PricePerPack PricePerPack,Sum(rd.NoOfPack * rd.PricePerPack)as TotalReceived, m.Name as Manufacturer,pst.Name Warehouse,cl.Name Cluster,sg.Name Account,s.StoreName SubSubAccount,sgDiv.Name SubAccount,t.Name commodityType, vw.StockCode  from ReceivePallet rp join ReceiveDoc rd on rp.ReceiveID = rd.ID  join receipt r on r.ID = rd.ReceiptID Join Stores s on s.ID = rd.StoreID join Manufacturers m on m.ID = rd.ManufacturerID join vwGetAllItems vw  on vw.ID = rd.ItemID join PalletLocation pl on rp.PalletLocationID = pl.ID left join Supplier su on su.ID = rd.SupplierID join Receipt rt on rt.ID = rd.ReceiptID join itemUnit iu on rd.unitID = iu.ID Join Shelf sh on pl.ShelfID = sh.ID  join PhysicalStore ps on Ps.ID = sh.StoreID Join PhysicalStoreType pst on pst.ID = ps.PhysicalStoreTypeID join Cluster cl on cl.ID = pst.ClusterID join StoreGroupDivision sgDiv on sgDiv.ID=s.StoreGroupDivisionID join StoreGroup sg on sg.ID = sgDiv.StoreGroupID join [type] t on t.ID = vw.TypeId where s.ID = {0} and ps.PhysicalStoreTypeID = {1} group by  rd.ItemID,rd.UnitID,rd.ManufacturerId,sg.Name,sgDiv.Name, vw.FullItemName,m.Name,iu.Text,pst.Name,cl.Name,s.StoreName,t.Name, vw.StockCode,rd.PricePerPack", AccountID, WarehouseID);
            var query = HCMIS.Repository.Queries.Receipt.SelectGetRawInventoryCountbyAccountandWarehouseItem(AccountID, WarehouseID, ItemID, UnitID);

            receiptInventory.LoadFromRawSql(query);
            return(receiptInventory.DefaultView);
        }
        public static DataView GetListOfGRVByUserIDForCosting(int userID)
        {
            Receipt receipt = new Receipt();
            string  query;

            query = HCMIS.Repository.Queries.Receipt.SelectGetListOfGRVByUserIDForCosting(userID, BLL.ReceiptConfirmationStatus.Constants.GRNF_PRINTED);
            receipt.LoadFromRawSql(query);
            return(receipt.DefaultView);
        }
        public static DataView GetListOfReceipt(int receiptTypeID, int receiptStatusID, int userID)
        {
            Receipt receipt = new Receipt();
            string  query;

            query = HCMIS.Repository.Queries.Receipt.GetListOfReceipt(receiptTypeID, receiptStatusID, userID);
            receipt.LoadFromRawSql(query);
            return(receipt.DefaultView);
        }
        public DataTable GetDiscrepancyForGRNF()
        {
            string  query;
            Receipt Receipt = new Receipt();

            query = HCMIS.Repository.Queries.Receipt.SelectGetDiscrepancyForGRNF(ID);
            Receipt.LoadFromRawSql(query);
            return(Receipt.DataTable);
        }
        public static DataTable GetlistOfPrints(int ID)
        {
            string  query;
            Receipt Receipt = new Receipt();

            query = HCMIS.Repository.Queries.Receipt.SelectGetlistOfPrints(ID);
            Receipt.LoadFromRawSql(query);
            return(Receipt.DataTable);
        }
        public static DataView GetInventoryCountbyInventoryPeriodID(int inventoryPeriodId, int physicalStoreId, int activityId)
        {
            Receipt receiptInventory = new Receipt();

            var query = HCMIS.Repository.Queries.Receipt.SelectGetInventoryCountbyInventoryPeriodID(inventoryPeriodId, physicalStoreId, activityId);

            receiptInventory.LoadFromRawSql(query);
            return(receiptInventory.DefaultView);
        }
        public static DataTable GetPriceConfirmationListFromCostTier(int MovingAverageGroupID)
        {
            string  query;
            Receipt Receipt = new Receipt();

            query = HCMIS.Repository.Queries.Receipt.SelectGetPriceConfirmationListFromCostTier(MovingAverageGroupID, ChangeMode.PriceOverride.Id);
            Receipt.LoadFromRawSql(query);
            return(Receipt.DataTable);
        }
        /// <summary>
        /// Confirmbies the store.
        /// </summary>
        /// <param name="StoreID">The store ID.</param>
        /// <param name="WarehouseID">The warehouse ID.</param>
        public static void ConfirmbyStore(int StoreID, int WarehouseID)
        {
            Receipt receiptInventory = new Receipt();
            string  query            = "";

            query =
                HCMIS.Repository.Queries.Receipt.SelectConfirmbyStore(StoreID, WarehouseID);

            receiptInventory.LoadFromRawSql(query);
        }
        public static void Confirm(int StoreID, int WarehouseID)
        {
            Receipt receiptInventory = new Receipt();
            string  query            = "";

            query =
                HCMIS.Repository.Queries.Receipt.SelectConfirm(StoreID, WarehouseID, ReceiptConfirmationStatus.Constants.RECEIVE_ENTERED, Settings.HandleGRV, ReceiptConfirmationStatus.Constants.RECEIVE_QUANTITY_CONFIRMED, ReceiptConfirmationStatus.Constants.GRV_PRINTED);

            receiptInventory.LoadFromRawSql(query);
        }
        public string FacilityName(int receiptID)
        {
            string  query;
            Receipt Receipt = new Receipt();

            query = HCMIS.Repository.Queries.Receipt.SelectFacilityName(receiptID);
            Receipt.LoadFromRawSql(query);
            if (Receipt.RowCount == 0)
            {
                return("");
            }

            return(Receipt.DataRow["FacilityName"].ToString());
        }
        public string GetNewInvoiceNoForConvertedDeliveryNote()
        {
            var receiptInvoice = new ReceiptInvoice(ReceiptInvoiceID);

            if (!receiptInvoice.IsConvertedFromDeliveryNote)
            {
                return(null);
            }
            var    receipt = new Receipt();
            string query   = HCMIS.Repository.Queries.ReceiptInvoice.SelectGetReprintedInvoice(ReceiptInvoiceID);

            receipt.LoadFromRawSql(query);

            return(receipt.STVOrInvoiceNo);
        }
        /// <summary>
        /// Gets the warehouse.
        /// </summary>
        /// <returns></returns>
        public String GetWarehouse()
        {
            Receipt receipt = new Receipt();
            var     query   = HCMIS.Repository.Queries.Receipt.SelectGetWarehouse(ID);

            receipt.LoadFromRawSql(query);
            try
            {
                return(receipt.GetColumn("WarehouseName").ToString());
            }
            catch
            {
                return("");
            }
        }
 /// <summary>
 /// Gets the margin by account.
 /// </summary>
 /// <param name="AccountID">The account ID.</param>
 /// <param name="TypeID">The type ID.</param>
 /// <returns></returns>
 public static DataView GetMarginByAccount(int AccountID, int TypeID)
 {
     if (TypeID != 0)
     {
         Receipt receiptInventory = new Receipt();
         var     query            = HCMIS.Repository.Queries.Receipt.SelectGetMarginByAccount(AccountID, TypeID);
         receiptInventory.LoadFromRawSql(query);
         return(receiptInventory.DefaultView);
     }
     else
     {
         Receipt receiptInventory = new Receipt();
         var     query            = HCMIS.Repository.Queries.Receipt.SelectGetMarginByAccount(AccountID);
         receiptInventory.LoadFromRawSql(query);
         return(receiptInventory.DefaultView);
     }
 }
        public static DataTable GetPriceListFromCostTier(int MovingAverageGroupID, bool ShowAll = false)
        {
            string  query;
            Receipt Receipt = new Receipt();

            if (!ShowAll)
            {
                query =
                    HCMIS.Repository.Queries.Receipt.SelectGetPriceListFromCostTier(MovingAverageGroupID);
            }
            else
            {
                query =
                    HCMIS.Repository.Queries.Receipt.SelectGetPriceListFromCostTierShowAll(MovingAverageGroupID);
            }
            Receipt.LoadFromRawSql(query);
            Receipt.DataTable.TableName = "PriceList";
            return(Receipt.DataTable);
        }
        public DataTable GetGRVDetailsforCosting()
        {
            var    receipt = new Receipt();
            string query   = string.Empty;

            if (ReceiptTypeID == ReceiptType.CONSTANTS.DELIVERY_NOTE)
            {
                bool isElectronicDeliveryNote = new Receipt(ID)._receiptInvoice.PO.IsElectronic;
                query = isElectronicDeliveryNote
                    ? HCMIS.Repository.Queries.Receipt.SelectGetGRVDetailsforCostingDeliveryNoteElectronic(ID)
                    : HCMIS.Repository.Queries.Receipt.SelectGetGRVDetailsforCostingDeliveryNoteManual(ID);
            }
            else
            {
                query = HCMIS.Repository.Queries.Receipt.SelectGetGRVDetailsforCosting(ID);
            }

            receipt.LoadFromRawSql(query);
            return(receipt.DataTable);
        }
 /// <summary>
 /// Gets the margin by account.
 /// </summary>
 /// <param name="AccountID">The account ID.</param>
 /// <param name="TypeID">The type ID.</param>
 /// <returns></returns>
 public static DataView GetMarginByAccount(int AccountID, int TypeID)
 {
     if (TypeID != 0)
     {
         Receipt receiptInventory = new Receipt();
         var query = HCMIS.Repository.Queries.Receipt.SelectGetMarginByAccount(AccountID, TypeID);
         receiptInventory.LoadFromRawSql(query);
         return receiptInventory.DefaultView;
     }
     else
     {
         Receipt receiptInventory = new Receipt();
         var query = HCMIS.Repository.Queries.Receipt.SelectGetMarginByAccount(AccountID);
         receiptInventory.LoadFromRawSql(query);
         return receiptInventory.DefaultView;
     }
 }
        public static DataTable GetPreviousStockforMovingCosting(int ReceiptID)
        {
            Receipt receipt = new Receipt();
            string query = HCMIS.Repository.Queries.Receipt.SelectGetPreviousStockforMovingCosting(ReceiptID);
            receipt.LoadFromRawSql(query);

            if(BLL.Settings.UseCostTier)
            {
                query = HCMIS.Repository.Queries.Receipt.SelectGetPreviousStockforMovingCostingUseCostTier(ReceiptID);
                receipt.LoadFromRawSql(query);
                return CostingService.SetPrice(receipt.DataTable);

            }
            return receipt.DataTable;
        }
        /// <summary>
        /// Confirmbies the store.
        /// </summary>
        /// <param name="StoreID">The store ID.</param>
        /// <param name="WarehouseID">The warehouse ID.</param>
        public static void ConfirmbyStore(int StoreID, int WarehouseID)
        {
            Receipt receiptInventory = new Receipt();
            string query = "";
            query =
                    HCMIS.Repository.Queries.Receipt.SelectConfirmbyStore(StoreID, WarehouseID);

            receiptInventory.LoadFromRawSql(query);
        }
 public static DataTable GetDiscrepancyGRVDetailsforCosting(int ReceiptID)
 {
     Receipt receipt = new Receipt();
     string query = HCMIS.Repository.Queries.Receipt.SelectGetDiscrepancyGRVDetailsforCosting(ReceiptID, StorageType.Quaranteen, ShortageReasons.Constants.SHORT_LANDED, ShortageReasons.Constants.DAMAGED);
     receipt.LoadFromRawSql(query);
      return receipt.DataTable;
 }
        public static DataView GetInventoryListByAccount(int movingAverageID, int statusID)
        {
            Receipt receiptInventory = new Receipt();
            string query = HCMIS.Repository.Queries.Receipt.SelectGetInventoryListByAccount(movingAverageID, statusID);

            receiptInventory.LoadFromRawSql(query);
            return receiptInventory.DefaultView;
        }
 public static DataTable GetItemPriceHistoryCostTierByDate(DateTime Startdate,DateTime Enddate, int userID)
 {
     var query = HCMIS.Repository.Queries.Receipt.SelectGetItemPriceHistoryByDate(Startdate, Enddate, userID);
     var receipt = new Receipt();
     receipt.LoadFromRawSql(query);
     receipt.DataTable.TableName = "PriceListHistory";
     return receipt.DataTable;
 }
 public static DataView GetListOfGRVByUserIDForCosting(int userID)
 {
     Receipt receipt = new Receipt();
     string query;
     query = HCMIS.Repository.Queries.Receipt.SelectGetListOfGRVByUserIDForCosting(userID, BLL.ReceiptConfirmationStatus.Constants.GRNF_PRINTED);
     receipt.LoadFromRawSql(query);
     return receipt.DefaultView;
 }
        public string FacilityName(int receiptID)
        {
            string query;
            Receipt Receipt = new Receipt();
            query = HCMIS.Repository.Queries.Receipt.SelectFacilityName(receiptID);
            Receipt.LoadFromRawSql(query);
            if(Receipt.RowCount==0)
                return "";

            return   Receipt.DataRow["FacilityName"].ToString();
        }
 public DataTable GetDiscrepancyForGRNF()
 {
     string query;
     Receipt Receipt = new Receipt();
     query = HCMIS.Repository.Queries.Receipt.SelectGetDiscrepancyForGRNF(ID);
     Receipt.LoadFromRawSql(query);
     return Receipt.DataTable;
 }
 public DataTable GetGRVDetailsforCostAnalysis(int ID)
 {
     Receipt receipt = new Receipt();
     string query = HCMIS.Repository.Queries.Receipt.SelectGetGRVDetailsforCostAnalysis(ID, BLL.Settings.NoOfDigitsAfterTheDecimalPoint);
     receipt.LoadFromRawSql(query);
     return receipt.DataTable;
 }
        public DataTable GetGRVDetailsforCosting()
        {
            var receipt = new Receipt();
            string query = string.Empty;

            if (ReceiptTypeID == ReceiptType.CONSTANTS.DELIVERY_NOTE)
            {
                bool isElectronicDeliveryNote = new Receipt(ID)._receiptInvoice.PO.IsElectronic;
                query = isElectronicDeliveryNote
                    ? HCMIS.Repository.Queries.Receipt.SelectGetGRVDetailsforCostingDeliveryNoteElectronic(ID)
                    : HCMIS.Repository.Queries.Receipt.SelectGetGRVDetailsforCostingDeliveryNoteManual(ID);
            }
            else
            {
                query = HCMIS.Repository.Queries.Receipt.SelectGetGRVDetailsforCosting(ID);
            }

            receipt.LoadFromRawSql(query);
            return receipt.DataTable;
        }
        public string GetNewInvoiceNoForConvertedDeliveryNote()
        {
            var receiptInvoice = new ReceiptInvoice(ReceiptInvoiceID);
            if (!receiptInvoice.IsConvertedFromDeliveryNote)
            {
                return null;
            }
            var receipt = new Receipt();
            string query = HCMIS.Repository.Queries.ReceiptInvoice.SelectGetReprintedInvoice(ReceiptInvoiceID);
            receipt.LoadFromRawSql(query);

            return receipt.STVOrInvoiceNo;
        }
 /// <summary>
 /// Gets the warehouse.
 /// </summary>
 /// <returns></returns>
 public String GetWarehouse()
 {
     Receipt receipt = new Receipt();
     var query = HCMIS.Repository.Queries.Receipt.SelectGetWarehouse(ID);
     receipt.LoadFromRawSql(query);
     try
     {
         return receipt.GetColumn("WarehouseName").ToString();
     }
     catch
     {
         return "";
     }
 }
 public static DataView GetListOfReceipt(int receiptTypeID,int receiptStatusID,int userID)
 {
     Receipt receipt = new Receipt();
     string query;
     query = HCMIS.Repository.Queries.Receipt.GetListOfReceipt(receiptTypeID, receiptStatusID, userID);
     receipt.LoadFromRawSql(query);
     return receipt.DefaultView;
 }
 public static DataTable GetlistOfPrints(int ID)
 {
     string query;
     Receipt Receipt = new Receipt();
     query = HCMIS.Repository.Queries.Receipt.SelectGetlistOfPrints(ID);
     Receipt.LoadFromRawSql(query);
     return Receipt.DataTable;
 }
        public static DataTable GetReceiptStatusList()
        {
            string query =
                HCMIS.Repository.Queries.Receipt.SelectGetReceiptStatusList();
            Receipt receipt = new Receipt();
            receipt.LoadFromRawSql(query);
            System.Data.DataTable tbl = receipt.DataTable;
            query = HCMIS.Repository.Queries.Receipt.SelectGetReceiptStatusList2();
            receipt.FlushData();
            receipt.LoadFromRawSql(query);

            tbl.Merge(receipt.DataTable);
            return tbl;
        }
 public static DataRow GetReceiptStatusDetail(int receiptID, int receiptStatusID)
 {
     var receipt = new Receipt();
     string query = HCMIS.Repository.Queries.Receipt.SelectGetReceiptStatusDetails(receiptID, receiptStatusID);
     receipt.LoadFromRawSql(query);
     return receipt.DataTable != null && receipt.DataTable.Rows.Count > 0 ? receipt.DataTable.Rows[0] : null;
 }
 /// <summary>
 /// Gets the raw inventory countby accountand warehouse item.
 /// </summary>
 /// <param name="AccountID">The account ID.</param>
 /// <param name="WarehouseID">The warehouse ID.</param>
 /// <param name="ItemID">The item ID.</param>
 /// <param name="UnitID">The unit ID.</param>
 /// <returns></returns>
 public static DataView GetRawInventoryCountbyAccountandWarehouseItem(int AccountID, int WarehouseID, int ItemID, int UnitID)
 {
     Receipt receiptInventory = new Receipt();
     //string query = String.Format("Select  rd.ItemID,rd.UnitID,rd.ManufacturerID,iu.text Unit, vw.FullItemName , sum(rd.NoOfPack) NoOfPack,rd.PricePerPack PricePerPack,Sum(rd.NoOfPack * rd.PricePerPack)as TotalReceived, m.Name as Manufacturer,pst.Name Warehouse,cl.Name Cluster,sg.Name Account,s.StoreName SubSubAccount,sgDiv.Name SubAccount,t.Name commodityType, vw.StockCode  from ReceivePallet rp join ReceiveDoc rd on rp.ReceiveID = rd.ID  join receipt r on r.ID = rd.ReceiptID Join Stores s on s.ID = rd.StoreID join Manufacturers m on m.ID = rd.ManufacturerID join vwGetAllItems vw  on vw.ID = rd.ItemID join PalletLocation pl on rp.PalletLocationID = pl.ID left join Supplier su on su.ID = rd.SupplierID join Receipt rt on rt.ID = rd.ReceiptID join itemUnit iu on rd.unitID = iu.ID Join Shelf sh on pl.ShelfID = sh.ID  join PhysicalStore ps on Ps.ID = sh.StoreID Join PhysicalStoreType pst on pst.ID = ps.PhysicalStoreTypeID join Cluster cl on cl.ID = pst.ClusterID join StoreGroupDivision sgDiv on sgDiv.ID=s.StoreGroupDivisionID join StoreGroup sg on sg.ID = sgDiv.StoreGroupID join [type] t on t.ID = vw.TypeId where s.ID = {0} and ps.PhysicalStoreTypeID = {1} group by  rd.ItemID,rd.UnitID,rd.ManufacturerId,sg.Name,sgDiv.Name, vw.FullItemName,m.Name,iu.Text,pst.Name,cl.Name,s.StoreName,t.Name, vw.StockCode,rd.PricePerPack", AccountID, WarehouseID);
     var query = HCMIS.Repository.Queries.Receipt.SelectGetRawInventoryCountbyAccountandWarehouseItem(AccountID, WarehouseID, ItemID, UnitID);
     receiptInventory.LoadFromRawSql(query);
     return receiptInventory.DefaultView;
 }
        /// <summary>
        /// Gets the inventory list by accountand warehouse.
        /// </summary>
        /// <param name="AccountID">The account ID.</param>
        /// <param name="WarehouseID">The warehouse ID.</param>
        /// <param name="TypeID">The type ID.</param>
        /// <returns></returns>
        public static DataView GetInventoryListByAccountandWarehouse(int AccountID, int WarehouseID, int TypeID)
        {
            Receipt receiptInventory = new Receipt();
            var query = HCMIS.Repository.Queries.Receipt.SelectGetInventoryListByAccountandWarehouse(AccountID, WarehouseID, TypeID, ReceiptConfirmationStatus.Constants.RECEIVE_QUANTITY_CONFIRMED, ReceiptConfirmationStatus.Constants.GRNF_PRINTED, ReceiptConfirmationStatus.Constants.PRICE_CALCULATED);

            receiptInventory.LoadFromRawSql(query);
            return receiptInventory.DefaultView;
        }
 public static DataTable GetPriceListFromCostTier(int MovingAverageGroupID,bool ShowAll = false)
 {
     string query;
     Receipt Receipt = new Receipt();
     if (!ShowAll)
     {
         query =
             HCMIS.Repository.Queries.Receipt.SelectGetPriceListFromCostTier(MovingAverageGroupID);
     }
     else
     {
         query =
             HCMIS.Repository.Queries.Receipt.SelectGetPriceListFromCostTierShowAll(MovingAverageGroupID);
     }
     Receipt.LoadFromRawSql(query);
     Receipt.DataTable.TableName = "PriceList";
     return Receipt.DataTable;
 }
        public static DataView GetInventoryCountbyInventoryPeriodID(int inventoryPeriodId,int physicalStoreId, int activityId)
        {
            Receipt receiptInventory = new Receipt();

            var query = HCMIS.Repository.Queries.Receipt.SelectGetInventoryCountbyInventoryPeriodID(inventoryPeriodId, physicalStoreId, activityId);
            receiptInventory.LoadFromRawSql(query);
            return receiptInventory.DefaultView;
        }
 public static DataTable GetPriceConfirmationListFromCostTier(int MovingAverageGroupID)
 {
     string query;
     Receipt Receipt = new Receipt();
     query = HCMIS.Repository.Queries.Receipt.SelectGetPriceConfirmationListFromCostTier(MovingAverageGroupID, ChangeMode.PriceOverride.Id);
     Receipt.LoadFromRawSql(query);
     return Receipt.DataTable;
 }
        public static void Confirm(int StoreID, int WarehouseID)
        {
            Receipt receiptInventory = new Receipt();
            string query = "";
            query =
                    HCMIS.Repository.Queries.Receipt.SelectConfirm(StoreID, WarehouseID, ReceiptConfirmationStatus.Constants.RECEIVE_ENTERED, Settings.HandleGRV, ReceiptConfirmationStatus.Constants.RECEIVE_QUANTITY_CONFIRMED, ReceiptConfirmationStatus.Constants.GRV_PRINTED);

            receiptInventory.LoadFromRawSql(query);
        }
 /// <summary>
 /// Loads the soundp GRV.
 /// </summary>
 public void LoadSoundpGRV()
 {
     Receipt receipt = new Receipt();
     var query = HCMIS.Repository.Queries.Receipt.SelectLoadSoundpGRV(ID);
     receipt.LoadFromRawSql(query);
     _pGRVSound = receipt.DefaultView;
 }