Billing: Calculate prices

This commit is contained in:
2023-11-30 01:44:48 +01:00
parent 17d00a8524
commit 8b9d62ea50
7 changed files with 61 additions and 23 deletions

View File

@ -90,9 +90,10 @@ namespace Elwig.Models.Dtos {
Buckets = rows
.Where(b => b.Value > 0)
.OrderByDescending(b => b.BktNr)
// FIXME precision
.Select(b => (b.Discr == "_" ? "ungeb." : $"geb. {f.SortId}{b.Discr}", b.Value,
b.Price != null ? (decimal?)Utils.DecFromDb((long)b.Price, 0) : null,
b.Amount != null ? (decimal?)Utils.DecFromDb((long)b.Amount, 0) : null))
b.Price != null ? (decimal?)Utils.DecFromDb((long)b.Price, 4) : null,
b.Amount != null ? (decimal?)Utils.DecFromDb((long)b.Amount, 4) : null))
.ToArray();
}
}