working excel report

This commit is contained in:
strwbrry1 2024-12-24 18:49:58 +04:00
parent 496d4a0f77
commit 37facf0620
2 changed files with 16 additions and 13 deletions

View File

@ -54,10 +54,11 @@ namespace ProjectPublishing.Reports
.Union(
_orderRepository
.ReadOrders() // тут где-то
.Where(x => x.OrderDate >= startDate && x.OrderDate <= endDate && x.Materials.Any(y => y.MaterialsId == materialId))
.Where(x => x.OrderDate >= startDate && x.OrderDate <= endDate.AddDays(1) && x.Materials.Any(y => y.MaterialsId == materialId))
.SelectMany(order => order.Materials
.Where(m => m.MaterialsId == materialId)
.Select(m => new {
.Select(m => new
{
MaterialId = m.MaterialsId,
Date = order.OrderDate,
CountIn = (int?)null,

View File

@ -87,7 +87,9 @@ WHERE Id=@id";
{
using var connection = new NpgsqlConnection(_connectionString.ConnectionString);
var querySelect = @"
SELECT o.*, ma.MaterialId
SELECT o.*,
ma.MaterialId as MaterialsId,
ma.Amount as MaterialsAmount
FROM PrintingOrder o
LEFT JOIN OrderMaterials ma ON o.Id = ma.OrderId
"; // возможно сюда фикс