Documents: restructure Documents/ directory
This commit is contained in:
Elwig
App.xaml.cs
Documents
BusinessDocument.csBusinessDocument.cshtmlBusinessDocument.cssBusinessLetter.csCreditNote.csCreditNote.cshtmlCreditNote.cssDeliveryConfirmation.csDeliveryConfirmation.cshtmlDeliveryConfirmation.cssDeliveryJournal.csDeliveryJournal.cshtmlDeliveryJournal.cssDeliveryNote.csDeliveryNote.cshtmlDeliveryNote.cssDocument.Page.cssDocument.csDocument.cshtmlDocument.cssLetterhead.cs
Helpers
33
Elwig/Documents/DeliveryJournal.cs
Normal file
33
Elwig/Documents/DeliveryJournal.cs
Normal file
@ -0,0 +1,33 @@
|
||||
using Elwig.Helpers;
|
||||
using Elwig.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
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(string filter, IQueryable<DeliveryPart> deliveries) :
|
||||
this(filter, deliveries
|
||||
.Include(p => p.Delivery).ThenInclude(d => d.Member)
|
||||
.Include(p => p.Variant)
|
||||
.ToList()) { }
|
||||
|
||||
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.DateString)
|
||||
.ThenBy(p => p.Delivery.TimeString)
|
||||
.ThenBy(p => p.Delivery.LsNr)
|
||||
.ThenBy(p => p.DPNr)) { }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user