ComponentShipments report fix
This commit is contained in:
parent
05d5ba207e
commit
31a6895951
@ -45,9 +45,9 @@ namespace ComputerShopBusinessLogic.BusinessLogics
|
||||
_saveToWord.CreateDoc(new WordInfoGuarantor
|
||||
{
|
||||
Filename = Model.FileName,
|
||||
Title = "Список сборок по выбранным заказам",
|
||||
Title = "Список партий товаров по выбранным компонентам",
|
||||
ShipmentComponents = GetReportComponentsWithShipments(Model.Ids!)
|
||||
}); ;
|
||||
});
|
||||
}
|
||||
|
||||
public void SaveReportToExcelFile(ReportBindingModel Model)
|
||||
|
@ -98,7 +98,7 @@ namespace ComputerShopDatabaseImplement.Implements
|
||||
.ThenInclude(x => x.Shipment)
|
||||
.Where(x =>
|
||||
ComponentIds.Contains(x.Id) // Компонент, указанный пользователем,
|
||||
&& x.ProductComponents.Any(y => y.Product.Shipment != null)) // который содержится в товаре, имеющем партию товаров
|
||||
)//&& x.ProductComponents.Any(y => y.Product.Shipment != null)) // который содержится в товаре, имеющем партию товаров
|
||||
.ToList()
|
||||
.Select(x => new ReportComponentWithShipmentViewModel
|
||||
{
|
||||
@ -106,6 +106,7 @@ namespace ComputerShopDatabaseImplement.Implements
|
||||
ComponentName = x.ComponentName,
|
||||
ComponentCost = x.Cost,
|
||||
Shipments = x.ProductComponents
|
||||
.Where(y => y.Product.Shipment != null)
|
||||
.Select(y => (y.Product.ProductName, y.Product.Price, y.Product.Shipment!.ProviderName, y.Product.Shipment.DateShipment))
|
||||
.ToList(),
|
||||
})
|
||||
|
@ -202,7 +202,7 @@ namespace ComputerShopGuarantorApp.Controllers
|
||||
throw new Exception("Вход только авторизованным");
|
||||
|
||||
ViewBag.Components = ApiUser.GetRequest<List<ComponentViewModel>>($"api/component/getcomponents?userId={ApiUser.User.Id}");
|
||||
ViewBag.Shipments = ApiUser.GetRequest<List<ShipmentViewModel>>($"api/shipment/getshipments?userId={ApiUser.User.Id}");
|
||||
ViewBag.Shipments = ApiUser.GetRequest<List<ShipmentViewModel>>($"api/shipment/getshipments?userId=-1");
|
||||
return View("Product");
|
||||
}
|
||||
|
||||
@ -231,7 +231,7 @@ namespace ComputerShopGuarantorApp.Controllers
|
||||
return Redirect("~/Home/Enter");
|
||||
|
||||
ViewBag.Components = ApiUser.GetRequest<List<ComponentViewModel>>($"api/component/getcomponents?userId={ApiUser.User.Id}");
|
||||
ViewBag.Shipments = ApiUser.GetRequest<List<ShipmentViewModel>>($"api/shipment/getshipments?userId={ApiUser.User.Id}");
|
||||
ViewBag.Shipments = ApiUser.GetRequest<List<ShipmentViewModel>>($"api/shipment/getshipments?userId=-1");
|
||||
return View("Product", ApiUser.GetRequest<ProductViewModel>($"api/product/getproduct?id={Id}"));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user