Ejemplo n.º 1
0
 public IActionResult ValueStockLocation(StockReportsModel filter)
 {
     LoadViewData();
     filter.TypeView  = "_ValueStockLocation";
     filter.WithStock = true;
     return(View(filter));
 }
Ejemplo n.º 2
0
        public async Task <IActionResult> Product(StockReportsModel filter, string trash)
        {
            LoadViewData();
            IQueryable <Product> data = await GetProducts(filter);

            filter.Product = data;
            return(View(filter));
        }
Ejemplo n.º 3
0
        public async Task <IQueryable <Product> > GetProducts(StockReportsModel filter)
        {
            var data = await _productServices.QueryAsync();

            data = data.Include(a => a.VProduct);


            if (filter.ProductId.HasValue)
            {
                data = data.Where(a => a.ProductId == filter.ProductId.Value);
            }

            if (!string.IsNullOrEmpty(filter.Name))
            {
                data = data.Where(a => a.Name.Contains(filter.Name));
            }

            if (!string.IsNullOrEmpty(filter.ProductNumber))
            {
                data = data.Where(a => a.Name.Contains(filter.ProductNumber));
            }

            if (!string.IsNullOrEmpty(filter.Manufacturer))
            {
                data = data.Where(a => a.Name.Contains(filter.Manufacturer));
            }

            if (!string.IsNullOrEmpty(filter.Ean))
            {
                data = data.Where(a => a.Name.Contains(filter.Ean));
            }

            if (!string.IsNullOrEmpty(filter.HsCode))
            {
                data = data.Where(a => a.Name.Contains(filter.HsCode));
            }

            if (!string.IsNullOrEmpty(filter.Location))
            {
                data = data.Where(a => a.Name.Contains(filter.Location));
            }



            if (!string.IsNullOrEmpty(filter.SizeUnitMeasureCode))
            {
                data = data.Where(a => a.Name.Contains(filter.SizeUnitMeasureCode));
            }

            if (!string.IsNullOrEmpty(filter.ProductAttribute))
            {
                data = data.Where(a => a.Name.Contains(filter.ProductAttribute));
            }

            if (filter.ProductSourceId.HasValue)
            {
                data = data.Where(a => a.ProductSourceId == filter.ProductSourceId);
            }

            if (filter.LocationId.HasValue)
            {
                data = data.Where(a => a.ProductInventory.Any(i => i.LocationId == filter.LocationId));
            }

            if (filter.ClassId.HasValue)
            {
                data = data.Where(a => a.ClassId == filter.ClassId);
            }

            if (filter.CategoryId.HasValue)
            {
                data = data.Where(a => a.ClassId == filter.CategoryId);
            }

            if (filter.CategoryId.HasValue)
            {
                data = data.Where(a => a.ClassId == filter.CategoryId);
            }

            if (filter.SellStartDate.HasValue)
            {
                data = data.Where(a => a.SellStartDate >= filter.SellStartDate);
            }

            if (filter.SellEndDate.HasValue)
            {
                data = data.Where(a => a.SellEndDate <= filter.SellEndDate);
            }

            if (filter.SellEndDate.HasValue)
            {
                data = data.Where(a => a.SellEndDate <= filter.SellEndDate);
            }

            data = data.Where(a => a.MakeFlag == filter.MakeFlag);
            data = data.Where(a => a.VariableFlag == filter.VariableFlag);
            data = data.Where(a => a.FinishedGoodsFlag == filter.FinishedGoodsFlag);

            data = data.Where(a => a.Active == filter.Active);



            if (filter.WithStock)
            {
                data = data.Where(a => a.VProduct.Stock.Value > 0);
            }


            if (filter.TypeView.Equals("_ProductWithutSaldo", StringComparison.CurrentCultureIgnoreCase))
            {
                data = data.Where(a => a.VProduct.Stock.Value == 0);
            }

            if (filter.TypeView.Equals("_ProductMinimumStocklevel", StringComparison.CurrentCultureIgnoreCase))
            {
                data = data.Where(a =>
                                  a.SafetyStockLevel.Value > 0 &&
                                  ((a.SafetyStockLevel.Value / a.VProduct.Stock.Value) * 100 >= 80));
            }



            return(data);
        }
Ejemplo n.º 4
0
 public IActionResult ProductMinimumStocklevel(StockReportsModel filter)
 {
     LoadViewData();
     filter.TypeView = "_ProductMinimumStocklevel";
     return(View(filter));
 }
Ejemplo n.º 5
0
 public IActionResult ProductWithutSaldo(StockReportsModel filter)
 {
     LoadViewData();
     filter.TypeView = "_ProductWithutSaldo";
     return(View(filter));
 }
Ejemplo n.º 6
0
 public IActionResult Product(StockReportsModel filter)
 {
     LoadViewData();
     return(View(filter));
 }