fix excel report with sum
This commit is contained in:
parent
bce2e9612a
commit
2edfb98b6a
@ -43,7 +43,7 @@ internal class TableReport
|
|||||||
{
|
{
|
||||||
var data = _contractRepository
|
var data = _contractRepository
|
||||||
.ReadContracts(customerId: customerId, dateFrom: startDate, dateTo: endDate)
|
.ReadContracts(customerId: customerId, dateFrom: startDate, dateTo: endDate)
|
||||||
.GroupBy(x => x.ConclusionDate)
|
.GroupBy(x => x.ExecutorFullName)
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
{
|
{
|
||||||
x.First().ExecutorFullName,
|
x.First().ExecutorFullName,
|
||||||
@ -54,7 +54,7 @@ internal class TableReport
|
|||||||
.Union(
|
.Union(
|
||||||
_contractRepository
|
_contractRepository
|
||||||
.ReadContracts(customerId: customerId, dateFrom: startDate, dateTo: endDate)
|
.ReadContracts(customerId: customerId, dateFrom: startDate, dateTo: endDate)
|
||||||
.GroupBy(x => x.Deadline)
|
.GroupBy(x => x.ExecutorFullName)
|
||||||
.Select(x => new
|
.Select(x => new
|
||||||
{
|
{
|
||||||
x.First().ExecutorFullName,
|
x.First().ExecutorFullName,
|
||||||
@ -69,12 +69,12 @@ internal class TableReport
|
|||||||
return new List<string[]>() { item }
|
return new List<string[]>() { item }
|
||||||
.Union(data.Select(x => new string[] {
|
.Union(data.Select(x => new string[] {
|
||||||
x.ExecutorFullName,
|
x.ExecutorFullName,
|
||||||
x.Date.ToString(),
|
x.Date.ToString("dd.MM.yyyy"),
|
||||||
x.CountIn?.ToString() ?? string.Empty,
|
x.CountIn?.ToString("N0") ?? string.Empty,
|
||||||
x.CountOut?.ToString() ?? string.Empty
|
x.CountOut?.ToString("N0") ?? string.Empty
|
||||||
}))
|
}))
|
||||||
.Union(
|
.Union(
|
||||||
[["Всего", "", data.Sum(x => x.CountIn ?? 0).ToString(), data.Sum(x => x.CountOut ?? 0).ToString()]])
|
[["Всего", "", data.Sum(x => x.CountIn ?? 0).ToString("N0"), data.Sum(x => x.CountOut ?? 0).ToString("N0")]])
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user