Billing: Fixes
This commit is contained in:
@ -1,7 +1,5 @@
|
||||
using Elwig.Models.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Elwig.Helpers.Billing {
|
||||
public class ContractSelection : IComparable<ContractSelection> {
|
||||
@ -16,18 +14,6 @@ namespace Elwig.Helpers.Billing {
|
||||
Attribute = attr;
|
||||
}
|
||||
|
||||
public static List<ContractSelection> GetContractsForYear(AppDbContext context, int year) {
|
||||
return context.DeliveryParts
|
||||
.Where(p => p.Year == year)
|
||||
.Select(d => new ContractSelection(d.Variant, d.Attribute))
|
||||
.Distinct()
|
||||
.ToList()
|
||||
.Union(context.WineVarieties.Select(v => new ContractSelection(v, null)))
|
||||
.DistinctBy(c => c.Listing)
|
||||
.Order()
|
||||
.ToList();
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
return Listing;
|
||||
}
|
||||
|
Reference in New Issue
Block a user