DeliveryAdminWindow: Add DeliveryJournal
This commit is contained in:
25
Elwig/Documents/DeliveryJournal.cshtml.cs
Normal file
25
Elwig/Documents/DeliveryJournal.cshtml.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using Elwig.Helpers;
|
||||
using Elwig.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Elwig.Documents {
|
||||
public class DeliveryJournal : Document {
|
||||
|
||||
public string Filter;
|
||||
public IEnumerable<DeliveryPart> Deliveries;
|
||||
|
||||
public DeliveryJournal(string filter, IEnumerable<DeliveryPart> deliveries) : base($"Lieferjournal {filter}") {
|
||||
Filter = filter;
|
||||
Deliveries = deliveries;
|
||||
}
|
||||
|
||||
public DeliveryJournal(AppDbContext ctx, DateOnly date) :
|
||||
this(date.ToString("dd.MM.yyyy"), ctx.DeliveryParts
|
||||
.Where(p => p.Delivery.DateString == date.ToString("yyy-MM-dd"))
|
||||
.OrderBy(p => p.Delivery.LsNr)
|
||||
.ThenBy(p => p.DPNr)
|
||||
.ToList()) { }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user