Added Zu-/Abschläge to Delivery Note

This commit is contained in:
2023-08-14 23:51:34 +02:00
parent c871dea873
commit 84edec2b54
3 changed files with 65 additions and 11 deletions

View File

@ -84,6 +84,17 @@ namespace Elwig.Models {
public string SortIdString => string.Join(", ", SortIds);
public double Kmw => Parts.Aggregate(
(Weight: 0, Kmw: 0.0),
(sum, item) => (
sum.Weight + item.Weight,
(sum.Kmw * sum.Weight + item.Kmw * item.Weight) / (sum.Weight + item.Weight)
),
sum => sum.Kmw
);
public double Oe => Utils.KmwToOe(Kmw);
public int SearchScore(IEnumerable<string> keywords) {
var list = new string?[] {
LsNr, Year.ToString(), Date.ToString("dd.MM.yyyy"), Time?.ToString("HH:mm"),