diff --git a/Elwig/Services/DeliveryService.cs b/Elwig/Services/DeliveryService.cs index 7750e89..5940afd 100644 --- a/Elwig/Services/DeliveryService.cs +++ b/Elwig/Services/DeliveryService.cs @@ -134,7 +134,7 @@ namespace Elwig.Services { var var = await ctx.WineVarieties.ToDictionaryAsync(v => v.SortId, v => v); var qual = await ctx.WineQualityLevels.Where(q => !q.IsPredicate).ToDictionaryAsync(q => q.QualId, q => q); var mgnr = await ctx.Members.ToDictionaryAsync(m => m.MgNr.ToString(), m => m); - var zwst = await ctx.Branches.ToDictionaryAsync(b => b.Name.ToLower().Split(" ")[0], b => b); + var zwst = await ctx.Branches.ToDictionaryAsync(b => b.Name.ToLower().Split(' ')[0], b => b); var attr = await ctx.WineAttributes.ToDictionaryAsync(a => a.Name.ToLower().Split(' ')[0], a => a); var cult = await ctx.WineCultivations.ToDictionaryAsync(c => c.Name.ToLower().Split(' ')[0], c => c); @@ -183,11 +183,11 @@ namespace Elwig.Services { } else if (e.ToLower() == "!gerebelt") { prd = prd.And(p => p.IsNetWeight == false); filter.RemoveAt(i--); - filterNames.Add("brutto Wiegung"); + filterNames.Add("nicht gerebelt gewogen"); } else if (e.ToLower() == "gerebelt") { prd = prd.And(p => p.IsNetWeight == true); filter.RemoveAt(i--); - filterNames.Add("netto Wiegung"); + filterNames.Add("gerebelt gewogen"); } else if (e.Length >= 5 && e.Length <= 9 && "lesewagen".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) { prd = prd.And(p => p.IsLesewagen == true); filter.RemoveAt(i--); @@ -763,6 +763,7 @@ namespace Elwig.Services { }) .OrderByDescending(g => g.Weight) .ThenBy(g => g.Attr) + .ThenBy(g => g.Cult) .ToListAsync(); var sortGroups = await deliveryParts .GroupBy(p => p.SortId) @@ -791,8 +792,9 @@ namespace Elwig.Services { Avg = g.Sum(p => p.Kmw * p.Weight) / g.Sum(p => p.Weight), Max = g.Max(p => p.Kmw) }) - .OrderByDescending(g => g.SortId) + .OrderByDescending(g => g.Weight) .ThenBy(g => g.Attr) + .ThenBy(g => g.Cult) .ThenBy(g => g.SortId) .ToListAsync();