Elwig: Rename buchführend, funktionär, volllieferant, and gebunden

This commit is contained in:
2026-09-30 12:14:25 +02:00
parent 4988081bfd
commit 5f2788eb9e
40 changed files with 393 additions and 355 deletions
+2 -2
View File
@@ -77,13 +77,13 @@ namespace Elwig.Documents {
.AddCell(NewAsideCell("Betr.-Nr.:", 6, isName: true)).AddCell(NewAsideCell(Member.LfbisNr ?? "-", 6, right: true, center: Member.LfbisNr == null)) .AddCell(NewAsideCell("Betr.-Nr.:", 6, isName: true)).AddCell(NewAsideCell(Member.LfbisNr ?? "-", 6, right: true, center: Member.LfbisNr == null))
.AddCell(NewAsideCell("OOC-ID:", 6, isName: true)).AddCell(NewAsideCell(Member.OrganicOperatorId ?? "-", 8, right: true, center: Member.OrganicOperatorId == null)) .AddCell(NewAsideCell("OOC-ID:", 6, isName: true)).AddCell(NewAsideCell(Member.OrganicOperatorId ?? "-", 8, right: true, center: Member.OrganicOperatorId == null))
.AddCell(NewAsideCell("UID:", 6, isName: true)).AddCell(NewAsideCell(Member.UstIdNr ?? "-", 10, right: true, center: Member.UstIdNr == null)) .AddCell(NewAsideCell("UID:", 6, isName: true)).AddCell(NewAsideCell(Member.UstIdNr ?? "-", 10, right: true, center: Member.UstIdNr == null))
.AddCell(NewAsideCell(new KernedParagraph("", 10).Add(Italic(Member.IsBuchführend ? "(buchführend)" : "(pauschaliert)")), 10, center: true)); .AddCell(NewAsideCell(new KernedParagraph("", 10).Add(Italic(Member.IsAccounting ? "(buchführend)" : "(pauschaliert)")), 10, center: true));
} else { } else {
Aside Aside
.AddCell(NewAsideCell("Mitglieds-Nr.:", 12, isName: true)).AddCell(NewAsideCell($"{Member.MgNr}", 4, right: true)).AddCell(NewAsideCell("", 10)) .AddCell(NewAsideCell("Mitglieds-Nr.:", 12, isName: true)).AddCell(NewAsideCell($"{Member.MgNr}", 4, right: true)).AddCell(NewAsideCell("", 10))
.AddCell(NewAsideCell("Betriebs-Nr.:", 10, isName: true)).AddCell(NewAsideCell(Member.LfbisNr ?? "-", 6, right: true, center: Member.LfbisNr == null)).AddCell(NewAsideCell("", 10)) .AddCell(NewAsideCell("Betriebs-Nr.:", 10, isName: true)).AddCell(NewAsideCell(Member.LfbisNr ?? "-", 6, right: true, center: Member.LfbisNr == null)).AddCell(NewAsideCell("", 10))
.AddCell(NewAsideCell("UID:", 6, isName: true)).AddCell(NewAsideCell(Member.UstIdNr ?? "-", 10, right: true, center: Member.UstIdNr == null)) .AddCell(NewAsideCell("UID:", 6, isName: true)).AddCell(NewAsideCell(Member.UstIdNr ?? "-", 10, right: true, center: Member.UstIdNr == null))
.AddCell(NewAsideCell(new KernedParagraph("", 10).Add(Italic(Member.IsBuchführend ? "(buchführend)" : "(pauschaliert)")), 10, center: true)); .AddCell(NewAsideCell(new KernedParagraph("", 10).Add(Italic(Member.IsAccounting ? "(buchführend)" : "(pauschaliert)")), 10, center: true));
} }
} }
+4 -4
View File
@@ -158,8 +158,8 @@ namespace Elwig.Documents {
.AddCell(NewDataTh("Betriebs-Nr.:")).AddCell(NewTd(Member.LfbisNr)) .AddCell(NewDataTh("Betriebs-Nr.:")).AddCell(NewTd(Member.LfbisNr))
.AddCell(NewDataTh("UID:", colspan: 2)).AddCell(NewTd(Member.UstIdNr, colspan: 2)) .AddCell(NewDataTh("UID:", colspan: 2)).AddCell(NewTd(Member.UstIdNr, colspan: 2))
.AddCell(NewDataTh("Stammgemeinde:")).AddCell(NewTd(Member.DefaultKg?.Name)) .AddCell(NewDataTh("Stammgemeinde:")).AddCell(NewTd(Member.DefaultKg?.Name))
.AddCell(NewDataTh("Buchführend:", colspan: 2)).AddCell(NewTd(new KernedParagraph(Member.IsBuchführend ? "Ja " : "Nein ", 10) .AddCell(NewDataTh("Buchführend:", colspan: 2)).AddCell(NewTd(new KernedParagraph(Member.IsAccounting ? "Ja " : "Nein ", 10)
.Add(Normal($"({(Member.IsBuchführend ? season.VatNormal : season.VatFlatrate) * 100:N0}% USt.)", 8)), colspan: 2)) .Add(Normal($"({(Member.IsAccounting ? season.VatNormal : season.VatFlatrate) * 100:N0}% USt.)", 8)), colspan: 2))
.AddCell(NewDataTh("(Katastralgemeinde mit dem größten Anteil an Weinbauflächen)", 8, colspan: 2)) .AddCell(NewDataTh("(Katastralgemeinde mit dem größten Anteil an Weinbauflächen)", 8, colspan: 2))
.AddCell(NewDataTh("Bio:", colspan: 2)).AddCell(NewTd(new KernedParagraph(Member.IsOrganic ? "Ja" : "Nein", 10) .AddCell(NewDataTh("Bio:", colspan: 2)).AddCell(NewTd(new KernedParagraph(Member.IsOrganic ? "Ja" : "Nein", 10)
.Add(Normal(Member.OrganicAuthorityCode != null || Member.OrganicOperatorId != null ? $" ({Member.OrganicAuthorityCode}{(Member.OrganicAuthorityCode != null && Member.OrganicOperatorId != null ? ", " : "")}{Member.OrganicOperatorId})" : "", 8)), colspan: 2)) .Add(Normal(Member.OrganicAuthorityCode != null || Member.OrganicOperatorId != null ? $" ({Member.OrganicAuthorityCode}{(Member.OrganicAuthorityCode != null && Member.OrganicOperatorId != null ? ", " : "")}{Member.OrganicOperatorId})" : "", 8)), colspan: 2))
@@ -168,11 +168,11 @@ namespace Elwig.Documents {
.Add(Normal("(" + (Member.ExitDate != null ? $"{Member.EntryDate:dd.MM.yyyy}\u2013{Member.ExitDate:dd.MM.yyyy}" : $"seit {Member.EntryDate:dd.MM.yyyy}") + ")", 8)))) .Add(Normal("(" + (Member.ExitDate != null ? $"{Member.EntryDate:dd.MM.yyyy}\u2013{Member.ExitDate:dd.MM.yyyy}" : $"seit {Member.EntryDate:dd.MM.yyyy}") + ")", 8))))
.AddCell(NewDataTh("Geschäftsanteile:", colspan: 2)).AddCell(NewTd(shares, colspan: 2)) .AddCell(NewDataTh("Geschäftsanteile:", colspan: 2)).AddCell(NewTd(shares, colspan: 2))
.AddCell(NewDataTh("Stamm-Zweigstelle:")).AddCell(NewTd(Member.Branch?.Name)) .AddCell(NewDataTh("Stamm-Zweigstelle:")).AddCell(NewTd(Member.Branch?.Name))
.AddCell(NewDataTh("Volllieferant:", colspan: 2)).AddCell(NewTd(Member.IsVollLieferant ? "Ja" : "Nein", colspan: 2)) .AddCell(NewDataTh("Vollablieferer:", colspan: 2)).AddCell(NewTd(Member.IsFullDelivery ? "Ja" : "Nein", colspan: 2))
.AddCell(NewDataTh("Zusendungen per\u2026")).AddCell(NewTd(new KernedParagraph(10) .AddCell(NewDataTh("Zusendungen per\u2026")).AddCell(NewTd(new KernedParagraph(10)
.Add(Italic("Post:")).Add(Normal(Member.ContactViaPost ? " Ja \u2013 " : " Nein \u2013 ")) .Add(Italic("Post:")).Add(Normal(Member.ContactViaPost ? " Ja \u2013 " : " Nein \u2013 "))
.Add(Italic("E-Mail:")).Add(Normal(Member.ContactViaEmail ? " Ja" : " Nein")))) .Add(Italic("E-Mail:")).Add(Normal(Member.ContactViaEmail ? " Ja" : " Nein"))))
.AddCell(NewDataTh("Funktionär:", colspan: 2)).AddCell(NewTd(Member.IsFunktionär ? "Ja" : "Nein", colspan: 2)); .AddCell(NewDataTh("Funktionär:", colspan: 2)).AddCell(NewTd(Member.IsOfficer ? "Ja" : "Nein", colspan: 2));
return tbl; return tbl;
} }
+22 -22
View File
@@ -108,16 +108,16 @@ namespace Elwig.Documents {
var totalSum = _credits.Sum(p => p.Amount); var totalSum = _credits.Sum(p => p.Amount);
var weiRows = data.Rows.Where(r => r.QualityLevel == "Wein"); var weiRows = data.Rows.Where(r => r.QualityLevel == "Wein");
var minWei = weiRows.Min(r => r.Ungeb.MinPrice); var minWei = weiRows.Min(r => r.UnCtrd.MinPrice);
var maxWei = weiRows.Max(r => r.Ungeb.MaxPrice); var maxWei = weiRows.Max(r => r.UnCtrd.MaxPrice);
var quwRows = data.Rows.Where(r => r.QualityLevel != "Wein"); var quwRows = data.Rows.Where(r => r.QualityLevel != "Wein");
var minPrice = quwRows.Min(r => r.Ungeb.MinPrice); var minPrice = quwRows.Min(r => r.UnCtrd.MinPrice);
var maxPrice = quwRows.Max(r => r.Ungeb.MaxPrice); var maxPrice = quwRows.Max(r => r.UnCtrd.MaxPrice);
var gebRows = data.Rows var ctrdRows = data.Rows
.Where(r => r.Geb.MaxPrice != null && r.Ungeb.MinPrice != null) .Where(r => r.Ctrd.MaxPrice != null && r.UnCtrd.MinPrice != null)
.Select(r => r.Geb.MaxPrice - r.Ungeb.MinPrice); .Select(r => r.Ctrd.MaxPrice - r.UnCtrd.MinPrice);
var minGeb = gebRows.Min(); var minCtrd = ctrdRows.Min();
var maxGeb = gebRows.Max(); var maxCtrd = ctrdRows.Max();
tbl.AddCell(NewSectionHdr("Allgemein", colspan: 5)) tbl.AddCell(NewSectionHdr("Allgemein", colspan: 5))
.AddCell(NewSectionHdr("Berücksichtigt", colspan: 3, borderLeft: true)) .AddCell(NewSectionHdr("Berücksichtigt", colspan: 3, borderLeft: true))
@@ -197,7 +197,7 @@ namespace Elwig.Documents {
.AddCell(NewTd(CurrencySymbol)) .AddCell(NewTd(CurrencySymbol))
.AddCell(NewTd($"{Math.Abs(vat):N2}", right: true)) .AddCell(NewTd($"{Math.Abs(vat):N2}", right: true))
.AddCell(NewSectionTh("Gebunden-Zuschlag:", borderLeft: true)) .AddCell(NewSectionTh("Gebunden-Zuschlag:", borderLeft: true))
.AddCell(NewTd(minGeb == null && maxGeb == null ? "-" : minGeb != maxGeb ? $"{minGeb:N4}\u2013{maxGeb:N4} {CurrencySymbol}/kg" : minGeb == 0 ? "-" : $"{minGeb:N4} {CurrencySymbol}/kg", colspan: 2, center: true)) .AddCell(NewTd(minCtrd == null && maxCtrd == null ? "-" : minCtrd != maxCtrd ? $"{minCtrd:N4}\u2013{maxCtrd:N4} {CurrencySymbol}/kg" : minCtrd == 0 ? "-" : $"{minCtrd:N4} {CurrencySymbol}/kg", colspan: 2, center: true))
.AddCell(NewSectionTh("Bruttosumme:", colspan: 2)) .AddCell(NewSectionTh("Bruttosumme:", colspan: 2))
.AddCell(NewTd(borderTop: true)) .AddCell(NewTd(borderTop: true))
@@ -211,21 +211,21 @@ namespace Elwig.Documents {
.AddCell(NewTd(CurrencySymbol)) .AddCell(NewTd(CurrencySymbol))
.AddCell(NewTd($"{Math.Abs(totalMods):N2}", right: true)) .AddCell(NewTd($"{Math.Abs(totalMods):N2}", right: true))
.AddCell(NewSectionTh("Menge (ungebunden):", borderLeft: true, borderTop: true)) .AddCell(NewSectionTh("Menge (ungebunden):", borderLeft: true, borderTop: true))
.AddCell(NewTd($"{data.Rows.Sum(r => r.Ungeb.Weight):N0} kg", colspan: 2, right: true, borderTop: true)) .AddCell(NewTd($"{data.Rows.Sum(r => r.UnCtrd.Weight):N0} kg", colspan: 2, right: true, borderTop: true))
.AddCell(NewSectionTh("Bereits berücksichtigte Abzüge:", colspan: 2)) .AddCell(NewSectionTh("Bereits berücksichtigte Abzüge:", colspan: 2))
.AddCell(NewTd(Utils.GetSign(considered))) .AddCell(NewTd(Utils.GetSign(considered)))
.AddCell(NewTd(CurrencySymbol)) .AddCell(NewTd(CurrencySymbol))
.AddCell(NewTd($"{Math.Abs(considered):N2}", right: true)) .AddCell(NewTd($"{Math.Abs(considered):N2}", right: true))
.AddCell(NewSectionTh("Menge (gebunden):", borderLeft: true)) .AddCell(NewSectionTh("Menge (gebunden):", borderLeft: true))
.AddCell(NewTd($"{data.Rows.Sum(r => r.Geb.Weight + r.LowGeb.Weight):N0} kg", colspan: 2, right: true)) .AddCell(NewTd($"{data.Rows.Sum(r => r.Ctrd.Weight + r.LowCtrd.Weight):N0} kg", colspan: 2, right: true))
.AddCell(NewSectionTh("Auszahlungsbetrag:", colspan: 2)) .AddCell(NewSectionTh("Auszahlungsbetrag:", colspan: 2))
.AddCell(NewTd(borderTop: true)) .AddCell(NewTd(borderTop: true))
.AddCell(NewTd(CurrencySymbol, borderTop: true)) .AddCell(NewTd(CurrencySymbol, borderTop: true))
.AddCell(NewTd($"{totalSum:N2}", right: true, borderTop: true)) .AddCell(NewTd($"{totalSum:N2}", right: true, borderTop: true))
.AddCell(NewSectionTh("Gesamtmenge:", borderLeft: true)) .AddCell(NewSectionTh("Gesamtmenge:", borderLeft: true))
.AddCell(NewTd($"{data.Rows.Sum(r => r.Ungeb.Weight + r.LowGeb.Weight + r.Geb.Weight):N0} kg", colspan: 2, right: true, borderTop: true)); .AddCell(NewTd($"{data.Rows.Sum(r => r.UnCtrd.Weight + r.LowCtrd.Weight + r.Ctrd.Weight):N0} kg", colspan: 2, right: true, borderTop: true));
return tbl; return tbl;
} }
@@ -290,22 +290,22 @@ namespace Elwig.Documents {
.ToList(); .ToList();
var border = lastHdr != null; var border = lastHdr != null;
tbl.AddCell(NewTd(hdr, colspan: 2, bold: true, italic: true, borderTop: border)) tbl.AddCell(NewTd(hdr, colspan: 2, bold: true, italic: true, borderTop: border))
.AddCell(NewTd($"{rows.Sum(r => r.Ungeb.Weight):N0}", right: true, bold: true, borderTop: border)) .AddCell(NewTd($"{rows.Sum(r => r.UnCtrd.Weight):N0}", right: true, bold: true, borderTop: border))
.AddCell(NewTd(borderTop: border)) .AddCell(NewTd(borderTop: border))
.AddCell(NewTd($"{rows.Sum(r => r.LowGeb.Weight):N0}", right: true, bold: true, borderTop: border)) .AddCell(NewTd($"{rows.Sum(r => r.LowCtrd.Weight):N0}", right: true, bold: true, borderTop: border))
.AddCell(NewTd(borderTop: border)) .AddCell(NewTd(borderTop: border))
.AddCell(NewTd($"{rows.Sum(r => r.Geb.Weight):N0}", right: true, bold: true, borderTop: border)) .AddCell(NewTd($"{rows.Sum(r => r.Ctrd.Weight):N0}", right: true, bold: true, borderTop: border))
.AddCell(NewTd(borderTop: border)) .AddCell(NewTd(borderTop: border))
.AddCell(NewTd($"{rows.Sum(r => r.Amount):N2}", right: true, bold: true, borderTop: border)); .AddCell(NewTd($"{rows.Sum(r => r.Amount):N2}", right: true, bold: true, borderTop: border));
} }
tbl.AddCell(NewTd(row.QualityLevel)) tbl.AddCell(NewTd(row.QualityLevel))
.AddCell(NewTd($"{row.Oe:N0}", center: true)) .AddCell(NewTd($"{row.Oe:N0}", center: true))
.AddCell(NewTd(row.Ungeb.Weight != 0 ? $"{row.Ungeb.Weight:N0}" : "-", right: true)) .AddCell(NewTd(row.UnCtrd.Weight != 0 ? $"{row.UnCtrd.Weight:N0}" : "-", right: true))
.AddCell(NewTd(row.Ungeb.MaxPrice != null ? $"{row.Ungeb.MaxPrice:N4}" : "-", right: true)) .AddCell(NewTd(row.UnCtrd.MaxPrice != null ? $"{row.UnCtrd.MaxPrice:N4}" : "-", right: true))
.AddCell(NewTd(row.LowGeb.Weight != 0 ? $"{row.LowGeb.Weight:N0}" : "-", right: true)) .AddCell(NewTd(row.LowCtrd.Weight != 0 ? $"{row.LowCtrd.Weight:N0}" : "-", right: true))
.AddCell(NewTd(row.LowGeb.MaxPrice != null ? $"{row.LowGeb.MaxPrice:N4}" : "-", right: true)) .AddCell(NewTd(row.LowCtrd.MaxPrice != null ? $"{row.LowCtrd.MaxPrice:N4}" : "-", right: true))
.AddCell(NewTd(row.Geb.Weight != 0 ? $"{row.Geb.Weight:N0}" : "-", right: true)) .AddCell(NewTd(row.Ctrd.Weight != 0 ? $"{row.Ctrd.Weight:N0}" : "-", right: true))
.AddCell(NewTd(row.Geb.MaxPrice != null ? $"{row.Geb.MaxPrice:N4}" : "-", right: true)) .AddCell(NewTd(row.Ctrd.MaxPrice != null ? $"{row.Ctrd.MaxPrice:N4}" : "-", right: true))
.AddCell(NewTd($"{row.Amount:N2}", right: true)); .AddCell(NewTd($"{row.Amount:N2}", right: true));
lastHdr = hdr; lastHdr = hdr;
} }
+6 -6
View File
@@ -77,13 +77,13 @@ namespace Elwig.Helpers.Billing {
} }
public async Task CalculateBuckets( public async Task CalculateBuckets(
bool? honorGebundenField = null, bool? honorContractedField = null,
bool? allowAttributesIntoLower = null, bool? allowAttributesIntoLower = null,
bool? avoidUnderDeliveries = null, bool? avoidUnderDeliveries = null,
SqliteConnection? cnx = null SqliteConnection? cnx = null
) { ) {
using var ctx = new AppDbContext(); using var ctx = new AppDbContext();
var honorGebunden = honorGebundenField ?? Season.Billing_HonorGebunden; var honorContracted = honorContractedField ?? Season.Billing_HonorContracted;
var allowAttrsIntoLower = allowAttributesIntoLower ?? Season.Billing_AllowAttrsIntoLower; var allowAttrsIntoLower = allowAttributesIntoLower ?? Season.Billing_AllowAttrsIntoLower;
var avoidUnderDlvrs = avoidUnderDeliveries ?? Season.Billing_AvoidUnderDeliveries; var avoidUnderDlvrs = avoidUnderDeliveries ?? Season.Billing_AvoidUnderDeliveries;
var attrVals = ctx.WineAttributes.ToDictionary(a => a.AttrId, a => (a.IsStrict, a.FillLower)); var attrVals = ctx.WineAttributes.ToDictionary(a => a.AttrId, a => (a.IsStrict, a.FillLower));
@@ -96,10 +96,10 @@ namespace Elwig.Helpers.Billing {
var deliveries = new List<(int, int, int, string, int, double, string, string?, string[], bool?)>(); var deliveries = new List<(int, int, int, string, int, double, string, string?, string[], bool?)>();
using (var cmd = cnx.CreateCommand()) { using (var cmd = cnx.CreateCommand()) {
cmd.CommandText = $""" cmd.CommandText = $"""
SELECT mgnr, did, dpnr, sortid, weight, kmw, qualid, attrid, modifiers, gebunden SELECT mgnr, did, dpnr, sortid, weight, kmw, qualid, attrid, modifiers, contracted
FROM v_delivery FROM v_delivery
WHERE year = {Year} WHERE year = {Year}
ORDER BY mgnr, sortid, abgewertet ASC, {(honorGebunden ? "gebunden IS NOT NULL DESC, gebunden DESC," : "")} ORDER BY mgnr, sortid, abgewertet ASC, {(honorContracted ? "contracted IS NOT NULL DESC, contracted DESC," : "")}
attribute_prio DESC, COALESCE(attrid, '~'), kmw DESC, lsnr, dpnr attribute_prio DESC, COALESCE(attrid, '~'), kmw DESC, lsnr, dpnr
"""; """;
using var reader = await cmd.ExecuteReaderAsync(); using var reader = await cmd.ExecuteReaderAsync();
@@ -117,12 +117,12 @@ namespace Elwig.Helpers.Billing {
int lastMgNr = 0; int lastMgNr = 0;
Dictionary<string, AreaComBucket>? rightsAndObligations = null; Dictionary<string, AreaComBucket>? rightsAndObligations = null;
Dictionary<string, int> used = []; Dictionary<string, int> used = [];
foreach (var (mgnr, did, dpnr, sortid, weight, kmw, qualid, attrid, modifiers, gebunden) in deliveries) { foreach (var (mgnr, did, dpnr, sortid, weight, kmw, qualid, attrid, modifiers, contracted) in deliveries) {
if (lastMgNr != mgnr) { if (lastMgNr != mgnr) {
rightsAndObligations = await ctx.GetMemberAreaCommitmentBuckets(Year, mgnr); rightsAndObligations = await ctx.GetMemberAreaCommitmentBuckets(Year, mgnr);
used = []; used = [];
} }
if ((honorGebunden && gebunden == false) || if ((honorContracted && contracted == false) ||
rightsAndObligations == null || rightsAndObligations.Count == 0 || rightsAndObligations == null || rightsAndObligations.Count == 0 ||
qualid == "WEI" || qualid == "RSW" || qualid == "LDW") qualid == "WEI" || qualid == "RSW" || qualid == "LDW")
{ {
+10 -10
View File
@@ -14,7 +14,7 @@ namespace Elwig.Helpers.Billing {
public enum CalculationMode { Elwig, WgMaster } public enum CalculationMode { Elwig, WgMaster }
public enum CurveMode { Oe, Kmw } public enum CurveMode { Oe, Kmw }
public record struct Curve(CurveMode Mode, Dictionary<double, decimal> Normal, Dictionary<double, decimal>? Gebunden); public record struct Curve(CurveMode Mode, Dictionary<double, decimal> Normal, Dictionary<double, decimal>? Contracted);
public static JsonSchema? Schema { get; private set; } public static JsonSchema? Schema { get; private set; }
@@ -179,10 +179,10 @@ namespace Elwig.Helpers.Billing {
} else { } else {
throw new InvalidOperationException(); throw new InvalidOperationException();
} }
var geb = obj["geb"]; var ctrd = obj["ctrd"] ?? obj["geb"];
if (geb is JsonObject) { if (ctrd is JsonObject) {
c2 = GetCurveData(geb.AsObject(), cMode); c2 = GetCurveData(ctrd.AsObject(), cMode);
} else if (geb?.AsValue().TryGetValue(out decimal v) == true) { } else if (ctrd?.AsValue().TryGetValue(out decimal v) == true) {
var splitVal = GetCurveValueAt(c1, quw); var splitVal = GetCurveValueAt(c1, quw);
c2 = c1.ToDictionary(e => e.Key, e => e.Value + (e.Key >= quw ? v : 0)); c2 = c1.ToDictionary(e => e.Key, e => e.Value + (e.Key >= quw ? v : 0));
c2[quw] = splitVal + v; c2[quw] = splitVal + v;
@@ -274,7 +274,7 @@ namespace Elwig.Helpers.Billing {
protected static JsonNode GraphEntryToJson(GraphEntry entry) { protected static JsonNode GraphEntryToJson(GraphEntry entry) {
try { try {
if (entry.GebundenFlatBonus == null) { if (entry.ContractedFlatBonus == null) {
return JsonValue.Create((decimal)entry.DataGraph.DataY.Distinct().Single()); return JsonValue.Create((decimal)entry.DataGraph.DataY.Distinct().Single());
} }
} catch { } } catch { }
@@ -286,10 +286,10 @@ namespace Elwig.Helpers.Billing {
curve["data"] = GraphToJson(entry.DataGraph, entry.Mode.ToString().ToLower()); curve["data"] = GraphToJson(entry.DataGraph, entry.Mode.ToString().ToLower());
if (entry.GebundenFlatBonus != null) { if (entry.ContractedFlatBonus != null) {
curve["geb"] = (decimal)entry.GebundenFlatBonus; curve["ctrd"] = (decimal)entry.ContractedFlatBonus;
} else if (entry.GebundenGraph != null) { } else if (entry.ContractedGraph != null) {
curve["geb"] = GraphToJson(entry.GebundenGraph, entry.Mode.ToString().ToLower()); curve["ctrd"] = GraphToJson(entry.ContractedGraph, entry.Mode.ToString().ToLower());
} }
return curve; return curve;
+6 -6
View File
@@ -37,11 +37,11 @@ namespace Elwig.Helpers.Billing {
return new BillingVariant(year, avnr, season, attributes, modifiers, areaComTypes, paymentVar, data); return new BillingVariant(year, avnr, season, attributes, modifiers, areaComTypes, paymentVar, data);
} }
public async Task Calculate(bool strictPrices = true, bool? honorGebunden = null, bool? allowAttrsIntoLower = null, bool? avoidUnderDeliveries = null) { public async Task Calculate(bool strictPrices = true, bool? honorContracted = null, bool? allowAttrsIntoLower = null, bool? avoidUnderDeliveries = null) {
if (PaymentVariant == null || Data == null) throw new Exception("Call Load before Calculate"); if (PaymentVariant == null || Data == null) throw new Exception("Call Load before Calculate");
using var cnx = await AppDbContext.ConnectAsync(); using var cnx = await AppDbContext.ConnectAsync();
using var tx = await cnx.BeginTransactionAsync(); using var tx = await cnx.BeginTransactionAsync();
await CalculateBuckets(honorGebunden, allowAttrsIntoLower, avoidUnderDeliveries, cnx); await CalculateBuckets(honorContracted, allowAttrsIntoLower, avoidUnderDeliveries, cnx);
await DeleteInDb(cnx); await DeleteInDb(cnx);
await SetCalcTime(cnx); await SetCalcTime(cnx);
KeyNotFoundException? exception = null; KeyNotFoundException? exception = null;
@@ -73,7 +73,7 @@ namespace Elwig.Helpers.Billing {
v.avnr, v.avnr,
ROUND(p.amount / POW(10, s.precision - 2)) AS net_amount, ROUND(p.amount / POW(10, s.precision - 2)) AS net_amount,
IIF(lc.amount < 0, 0, ROUND(lp.amount / POW(10, s.precision - 2))) AS prev_net_amount, IIF(lc.amount < 0, 0, ROUND(lp.amount / POW(10, s.precision - 2))) AS prev_net_amount,
IIF(m.buchführend, s.vat_normal, s.vat_flatrate) AS vat, IIF(m.accounting, s.vat_normal, s.vat_flatrate) AS vat,
ROUND(IIF({Data.ConsiderTotalPenalty}, COALESCE(b.total_penalty, 0), 0) / POW(10, s.precision - 2)) + ROUND(IIF({Data.ConsiderTotalPenalty}, COALESCE(b.total_penalty, 0), 0) / POW(10, s.precision - 2)) +
ROUND(IIF({Data.ConsiderContractPenalties}, COALESCE(u.total_penalty, 0), 0) / POW(10, 4 - 2)) + ROUND(IIF({Data.ConsiderContractPenalties}, COALESCE(u.total_penalty, 0), 0) / POW(10, 4 - 2)) +
ROUND(IIF({Data.ConsiderAutoBusinessShares}, -COALESCE(a.total_amount, 0), 0)) + ROUND(IIF({Data.ConsiderAutoBusinessShares}, -COALESCE(a.total_amount, 0), 0)) +
@@ -195,13 +195,13 @@ namespace Elwig.Helpers.Billing {
foreach (var part in parts) { foreach (var part in parts) {
if (part.Value == 0) if (part.Value == 0)
continue; continue;
var ungeb = part.Discr == "_"; var unctrd = part.Discr == "_";
var payAttrId = (part.Discr is "" or "_") ? null : part.Discr; var payAttrId = (part.Discr is "" or "_") ? null : part.Discr;
var attrId = part.AttrAreaCom ? payAttrId : part.AttrId; var attrId = part.AttrAreaCom ? payAttrId : part.AttrId;
var geb = !ungeb && (payAttrId == attrId || !part.AttrAreaCom); var ctrd = !unctrd && (payAttrId == attrId || !part.AttrAreaCom);
decimal price = 0; decimal price = 0;
try { try {
price = Data.CalculatePrice(part.SortId, attrId, part.CultId, part.QualId, geb, part.Oe, part.Kmw); price = Data.CalculatePrice(part.SortId, attrId, part.CultId, part.QualId, ctrd, part.Oe, part.Kmw);
} catch (KeyNotFoundException e) { } catch (KeyNotFoundException e) {
invalid.Add(e.Message.Split('\'')[1]); invalid.Add(e.Message.Split('\'')[1]);
} }
+17 -17
View File
@@ -7,7 +7,7 @@ namespace Elwig.Helpers.Billing {
public class GraphEntry { public class GraphEntry {
public const int MinX = 50; public const int MinX = 50;
public const int MinXGeb = 73; public const int MinXCtrd = 73;
public const int MaxX = 120; public const int MaxX = 120;
public int Id { get; set; } public int Id { get; set; }
@@ -15,11 +15,11 @@ namespace Elwig.Helpers.Billing {
public bool Abgewertet { get; set; } public bool Abgewertet { get; set; }
public Graph DataGraph { get; set; } public Graph DataGraph { get; set; }
public Graph? GebundenGraph { get; set; } public Graph? ContractedGraph { get; set; }
public double? GebundenFlatBonus { public double? ContractedFlatBonus {
get { get {
try { try {
var val = GebundenGraph?.DataX.Zip(GebundenGraph.DataY) var val = ContractedGraph?.DataX.Zip(ContractedGraph.DataY)
.Select(e => Math.Round(e.Second - DataGraph.GetPriceAtOe(e.First), Precision)) .Select(e => Math.Round(e.Second - DataGraph.GetPriceAtOe(e.First), Precision))
.Distinct() .Distinct()
.Single(); .Single();
@@ -30,10 +30,10 @@ namespace Elwig.Helpers.Billing {
} }
set { set {
if (value is not double v) return; if (value is not double v) return;
var values = Enumerable.Range(MinXGeb, MaxX - MinXGeb + 1) var values = Enumerable.Range(MinXCtrd, MaxX - MinXCtrd + 1)
.Select(i => Math.Round(DataGraph.GetPriceAtOe(i) + v, Precision)) .Select(i => Math.Round(DataGraph.GetPriceAtOe(i) + v, Precision))
.ToArray(); .ToArray();
GebundenGraph = new Graph(values, Precision, MinXGeb, MaxX); ContractedGraph = new Graph(values, Precision, MinXCtrd, MaxX);
} }
} }
@@ -52,39 +52,39 @@ namespace Elwig.Helpers.Billing {
Vaributes = []; Vaributes = [];
} }
public GraphEntry(int id, int precision, BillingData.CurveMode mode, Dictionary<double, decimal> data, Dictionary<double, decimal>? gebunden) : public GraphEntry(int id, int precision, BillingData.CurveMode mode, Dictionary<double, decimal> data, Dictionary<double, decimal>? contracted) :
this(id, precision, mode) { this(id, precision, mode) {
DataGraph = new Graph(data, precision, MinX, MaxX); DataGraph = new Graph(data, precision, MinX, MaxX);
if (gebunden != null) GebundenGraph = new Graph(gebunden, precision, MinXGeb, MaxX); if (contracted != null) ContractedGraph = new Graph(contracted, precision, MinXCtrd, MaxX);
} }
public GraphEntry(int id, int precision, BillingData.Curve curve, List<Varibute> vaributes) : public GraphEntry(int id, int precision, BillingData.Curve curve, List<Varibute> vaributes) :
this(id, precision, curve.Mode) { this(id, precision, curve.Mode) {
DataGraph = new Graph(curve.Normal, precision, MinX, MaxX); DataGraph = new Graph(curve.Normal, precision, MinX, MaxX);
if (curve.Gebunden != null) if (curve.Contracted != null)
GebundenGraph = new Graph(curve.Gebunden, precision, MinXGeb, MaxX); ContractedGraph = new Graph(curve.Contracted, precision, MinXCtrd, MaxX);
Vaributes = vaributes; Vaributes = vaributes;
} }
private GraphEntry(int id, int precision, BillingData.CurveMode mode, Graph dataGraph, Graph? gebundenGraph, List<Varibute> vaributes) { private GraphEntry(int id, int precision, BillingData.CurveMode mode, Graph dataGraph, Graph? contractedGraph, List<Varibute> vaributes) {
Id = id; Id = id;
Precision = precision; Precision = precision;
Mode = mode; Mode = mode;
DataGraph = dataGraph; DataGraph = dataGraph;
GebundenGraph = gebundenGraph; ContractedGraph = contractedGraph;
Vaributes = vaributes; Vaributes = vaributes;
} }
public void AddGebundenGraph() { public void AddContractedGraph() {
GebundenGraph ??= new Graph(Precision, MinXGeb, MaxX); ContractedGraph ??= new Graph(Precision, MinXCtrd, MaxX);
} }
public void RemoveGebundenGraph() { public void RemoveContractedGraph() {
GebundenGraph = null; ContractedGraph = null;
} }
public GraphEntry Copy(int id) { public GraphEntry Copy(int id) {
return new GraphEntry(id, Precision, Mode, (Graph)DataGraph.Clone(), (Graph?)GebundenGraph?.Clone(), []); return new GraphEntry(id, Precision, Mode, (Graph)DataGraph.Clone(), (Graph?)ContractedGraph?.Clone(), []);
} }
} }
} }
+2 -2
View File
@@ -45,9 +45,9 @@ namespace Elwig.Helpers.Billing {
return dict; return dict;
} }
public decimal CalculatePrice(string sortid, string? attrid, string? cultid, string qualid, bool gebunden, double oe, double kmw) { public decimal CalculatePrice(string sortid, string? attrid, string? cultid, string qualid, bool contracted, double oe, double kmw) {
var curve = GetQualityCurve(qualid, sortid, attrid, cultid) ?? GetCurve(sortid, attrid, cultid); var curve = GetQualityCurve(qualid, sortid, attrid, cultid) ?? GetCurve(sortid, attrid, cultid);
return GetCurveValueAt((gebunden ? curve.Gebunden : null) ?? curve.Normal, curve.Mode == CurveMode.Oe ? oe : kmw); return GetCurveValueAt((contracted ? curve.Contracted : null) ?? curve.Normal, curve.Mode == CurveMode.Oe ? oe : kmw);
} }
private Curve LookupCurve(JsonValue val) { private Curve LookupCurve(JsonValue val) {
+8 -8
View File
@@ -641,10 +641,10 @@ namespace Elwig.Helpers.Export {
["ooc_id"] = m.OrganicOperatorId, ["ooc_id"] = m.OrganicOperatorId,
["org_auth_code"] = m.OrganicAuthorityCode, ["org_auth_code"] = m.OrganicAuthorityCode,
["juridical_pers"] = m.IsJuridicalPerson, ["juridical_pers"] = m.IsJuridicalPerson,
["volllieferant"] = m.IsVollLieferant, ["full_delivery"] = m.IsFullDelivery,
["buchführend"] = m.IsBuchführend, ["accounting"] = m.IsAccounting,
["organic"] = m.IsOrganic, ["organic"] = m.IsOrganic,
["funktionär"] = m.IsFunktionär, ["officer"] = m.IsOfficer,
["active"] = m.IsActive, ["active"] = m.IsActive,
["deceased"] = m.IsDeceased, ["deceased"] = m.IsDeceased,
["iban"] = m.Iban, ["iban"] = m.Iban,
@@ -715,10 +715,10 @@ namespace Elwig.Helpers.Export {
OrganicOperatorId = json["ooc_id"]?.AsValue().GetValue<string>(), OrganicOperatorId = json["ooc_id"]?.AsValue().GetValue<string>(),
OrganicAuthorityCode = json["org_auth_code"]?.AsValue().GetValue<string>(), OrganicAuthorityCode = json["org_auth_code"]?.AsValue().GetValue<string>(),
IsJuridicalPerson = json["juridical_pers"]?.AsValue().GetValue<bool>() ?? false, IsJuridicalPerson = json["juridical_pers"]?.AsValue().GetValue<bool>() ?? false,
IsVollLieferant = json["volllieferant"]?.AsValue().GetValue<bool>() ?? false, IsFullDelivery = json["full_delivery"]?.AsValue().GetValue<bool>() ?? json["volllieferant"]?.AsValue().GetValue<bool>() ?? false,
IsBuchführend = json["buchführend"]?.AsValue().GetValue<bool>() ?? false, IsAccounting = json["accounting"]?.AsValue().GetValue<bool>() ?? json["buchführend"]?.AsValue().GetValue<bool>() ?? false,
IsOrganic = json["organic"]?.AsValue().GetValue<bool>() ?? false, IsOrganic = json["organic"]?.AsValue().GetValue<bool>() ?? false,
IsFunktionär = json["funktionär"]?.AsValue().GetValue<bool>() ?? false, IsOfficer = json["officer"]?.AsValue().GetValue<bool>() ?? json["funktionär"]?.AsValue().GetValue<bool>() ?? false,
IsActive = json["active"]?.AsValue().GetValue<bool>() ?? false, IsActive = json["active"]?.AsValue().GetValue<bool>() ?? false,
IsDeceased = json["deceased"]?.AsValue().GetValue<bool>() ?? false, IsDeceased = json["deceased"]?.AsValue().GetValue<bool>() ?? false,
Iban = json["iban"]?.AsValue().GetValue<string>(), Iban = json["iban"]?.AsValue().GetValue<string>(),
@@ -961,7 +961,7 @@ namespace Elwig.Helpers.Export {
}; };
if (p.IsSplCheck) obj["spl_check"] = p.IsSplCheck; if (p.IsSplCheck) obj["spl_check"] = p.IsSplCheck;
if (p.IsHandPicked != null) obj["hand_picked"] = p.IsHandPicked; if (p.IsHandPicked != null) obj["hand_picked"] = p.IsHandPicked;
if (p.IsGebunden != null) obj["gebunden"] = p.IsGebunden; if (p.IsContracted != null) obj["contracted"] = p.IsContracted;
if (p.Unloading != null) obj["unloading"] = p.Unloading; if (p.Unloading != null) obj["unloading"] = p.Unloading;
if (p.Temperature != null) obj["temperature"] = p.Temperature; if (p.Temperature != null) obj["temperature"] = p.Temperature;
if (p.Acid != null) obj["acid"] = p.Acid; if (p.Acid != null) obj["acid"] = p.Acid;
@@ -1035,7 +1035,7 @@ namespace Elwig.Helpers.Export {
Comment = p["comment"]?.AsValue().GetValue<string>(), Comment = p["comment"]?.AsValue().GetValue<string>(),
IsSplCheck = p["spl_check"]?.AsValue().GetValue<bool>() ?? false, IsSplCheck = p["spl_check"]?.AsValue().GetValue<bool>() ?? false,
IsHandPicked = p["hand_picked"]?.AsValue().GetValue<bool>(), IsHandPicked = p["hand_picked"]?.AsValue().GetValue<bool>(),
IsGebunden = p["gebunden"]?.AsValue().GetValue<bool>(), IsContracted = p["contracted"]?.AsValue().GetValue<bool>() ?? p["gebunden"]?.AsValue().GetValue<bool>(),
Unloading = p["unloading"]?.AsValue().GetValue<string>() ?? ((p["lesewagen"]?.AsValue().GetValue<bool>() ?? false) ? DeliveryPart.Pumped : null), Unloading = p["unloading"]?.AsValue().GetValue<string>() ?? ((p["lesewagen"]?.AsValue().GetValue<bool>() ?? false) ? DeliveryPart.Pumped : null),
Temperature = p["temperature"]?.AsValue().GetValue<double>(), Temperature = p["temperature"]?.AsValue().GetValue<double>(),
Acid = p["acid"]?.AsValue().GetValue<double>(), Acid = p["acid"]?.AsValue().GetValue<double>(),
+3 -3
View File
@@ -25,7 +25,7 @@ namespace Elwig.Models.Dtos {
("BillingPlz", "PLZ", null, 10), ("BillingPlz", "PLZ", null, 10),
("BillingLocality", "Ort", null, 60), ("BillingLocality", "Ort", null, 60),
("LfbisNr", "Betr.-Nr.", null, 20), ("LfbisNr", "Betr.-Nr.", null, 20),
("IsBuchführend", "buchf.", null, 15), ("IsAccounting", "buchf.", null, 15),
("IsOrganic", "Bio", null, 15), ("IsOrganic", "Bio", null, 15),
("IsActive", "aktiv", null, 15), ("IsActive", "aktiv", null, 15),
("EntryDate", "Eintritt", null, 20), ("EntryDate", "Eintritt", null, 20),
@@ -83,7 +83,7 @@ namespace Elwig.Models.Dtos {
public string? Bic; public string? Bic;
public int? AreaCommitment; public int? AreaCommitment;
public (string VtrgId, int Area)[] AreaCommitmentsFiltered; public (string VtrgId, int Area)[] AreaCommitmentsFiltered;
public bool IsBuchführend; public bool IsAccounting;
public bool IsOrganic; public bool IsOrganic;
public bool IsActive; public bool IsActive;
public DateOnly? EntryDate; public DateOnly? EntryDate;
@@ -118,7 +118,7 @@ namespace Elwig.Models.Dtos {
UstIdNr = m.UstIdNr; UstIdNr = m.UstIdNr;
Iban = m.Iban != null ? Utils.FormatIban(m.Iban) : null; Iban = m.Iban != null ? Utils.FormatIban(m.Iban) : null;
Bic = m.Bic; Bic = m.Bic;
IsBuchführend = m.IsBuchführend; IsAccounting = m.IsAccounting;
IsOrganic = m.IsOrganic; IsOrganic = m.IsOrganic;
IsActive = m.IsActive; IsActive = m.IsActive;
EntryDate = m.EntryDate; EntryDate = m.EntryDate;
+36 -36
View File
@@ -18,9 +18,9 @@ namespace Elwig.Models.Dtos {
("Cultivation", "Bewirt.", null, 20), ("Cultivation", "Bewirt.", null, 20),
("QualityLevel", "Qualitätsstufe", null, 30), ("QualityLevel", "Qualitätsstufe", null, 30),
("Oe", "Gradation", "°Oe", 20), ("Oe", "Gradation", "°Oe", 20),
("Ungeb", "ungebunden", "kg|€/kg|€/kg", 60), ("UnCtrd", "ungebunden", "kg|€/kg|€/kg", 60),
("LowGeb", "attributlos gebunden", "kg|€/kg|€/kg", 60), ("LowCtrd", "attributlos gebunden", "kg|€/kg|€/kg", 60),
("Geb", "gebunden", "kg|€/kg|€/kg", 60), ("Ctrd", "gebunden", "kg|€/kg|€/kg", 60),
("Amount", "Gesamt", "€", 25), ("Amount", "Gesamt", "€", 25),
]; ];
@@ -31,9 +31,9 @@ namespace Elwig.Models.Dtos {
string? Cultivation, string? Cultivation,
string QualityLevel, string QualityLevel,
double Oe, double Oe,
(int Weight, decimal? MinPrice, decimal? MaxPrice) Ungeb, (int Weight, decimal? MinPrice, decimal? MaxPrice) UnCtrd,
(int Weight, decimal? MinPrice, decimal? MaxPrice) LowGeb, (int Weight, decimal? MinPrice, decimal? MaxPrice) LowCtrd,
(int Weight, decimal? MinPrice, decimal? MaxPrice) Geb, (int Weight, decimal? MinPrice, decimal? MaxPrice) Ctrd,
decimal Amount decimal Amount
); );
@@ -44,9 +44,9 @@ namespace Elwig.Models.Dtos {
public static async Task<PaymentVariantSummaryData> ForPaymentVariant(PaymentVar v, DbSet<PaymentVariantSummaryRow> table) { public static async Task<PaymentVariantSummaryData> ForPaymentVariant(PaymentVar v, DbSet<PaymentVariantSummaryRow> table) {
return new(v, (await FromDbSet(table, v.Year, v.AvNr)) return new(v, (await FromDbSet(table, v.Year, v.AvNr))
.Select(r => new PaymentRow(r.Type, r.Variety, r.Attribute, r.Cultivation, r.QualityLevel, r.Oe, .Select(r => new PaymentRow(r.Type, r.Variety, r.Attribute, r.Cultivation, r.QualityLevel, r.Oe,
(r.WeightUngeb, r.MinPriceUngeb != null ? Utils.DecFromDb(r.MinPriceUngeb.Value, v.Season.Precision) : null, r.MaxPriceUngeb != null ? Utils.DecFromDb(r.MaxPriceUngeb.Value, v.Season.Precision) : null), (r.WeightUnCtrd, r.MinPriceUnCtrd != null ? Utils.DecFromDb(r.MinPriceUnCtrd.Value, v.Season.Precision) : null, r.MaxPriceUnCtrd != null ? Utils.DecFromDb(r.MaxPriceUnCtrd.Value, v.Season.Precision) : null),
(r.WeightLowGeb, r.MinPriceLowGeb != null ? Utils.DecFromDb(r.MinPriceLowGeb.Value, v.Season.Precision) : null, r.MaxPriceLowGeb != null ? Utils.DecFromDb(r.MaxPriceLowGeb.Value, v.Season.Precision) : null), (r.WeightLowCtrd, r.MinPriceLowCtrd != null ? Utils.DecFromDb(r.MinPriceLowCtrd.Value, v.Season.Precision) : null, r.MaxPriceLowCtrd != null ? Utils.DecFromDb(r.MaxPriceLowCtrd.Value, v.Season.Precision) : null),
(r.WeightGeb, r.MinPriceGeb != null ? Utils.DecFromDb(r.MinPriceGeb.Value, v.Season.Precision) : null, r.MaxPriceGeb != null ? Utils.DecFromDb(r.MaxPriceGeb.Value, v.Season.Precision) : null), (r.WeightCtrd, r.MinPriceCtrd != null ? Utils.DecFromDb(r.MinPriceCtrd.Value, v.Season.Precision) : null, r.MaxPriceCtrd != null ? Utils.DecFromDb(r.MaxPriceCtrd.Value, v.Season.Precision) : null),
Utils.DecFromDb(r.Amount, v.Season.Precision))) Utils.DecFromDb(r.Amount, v.Season.Precision)))
.ToArray()); .ToArray());
} }
@@ -59,15 +59,15 @@ namespace Elwig.Models.Dtos {
c.name AS cultivation, c.name AS cultivation,
q.name AS quality_level, q.name AS quality_level,
ROUND(kmw * (4.54 + 0.022 * kmw)) AS oe, ROUND(kmw * (4.54 + 0.022 * kmw)) AS oe,
SUM(IIF(w.discr = '_', w.value, 0)) AS weight_ungeb, SUM(IIF(w.discr = '_', w.value, 0)) AS weight_unctrd,
MIN(IIF(w.discr = '_', b.price, NULL)) AS min_price_ungeb, MIN(IIF(w.discr = '_', b.price, NULL)) AS min_price_unctrd,
MAX(IIF(w.discr = '_', b.price, NULL)) AS max_price_ungeb, MAX(IIF(w.discr = '_', b.price, NULL)) AS max_price_unctrd,
SUM(IIF(w.discr NOT IN (COALESCE(p.attrid, ''), '_'), w.value, 0)) AS weight_lowgeb, SUM(IIF(w.discr NOT IN (COALESCE(p.attrid, ''), '_'), w.value, 0)) AS weight_lowctrd,
MIN(IIF(w.discr NOT IN (COALESCE(p.attrid, ''), '_'), b.price, NULL)) AS min_price_lowgeb, MIN(IIF(w.discr NOT IN (COALESCE(p.attrid, ''), '_'), b.price, NULL)) AS min_price_lowctrd,
MAX(IIF(w.discr NOT IN (COALESCE(p.attrid, ''), '_'), b.price, NULL)) AS max_price_lowgeb, MAX(IIF(w.discr NOT IN (COALESCE(p.attrid, ''), '_'), b.price, NULL)) AS max_price_lowctrd,
SUM(IIF(w.discr = COALESCE(p.attrid, ''), w.value, 0)) AS weight_geb, SUM(IIF(w.discr = COALESCE(p.attrid, ''), w.value, 0)) AS weight_ctrd,
MIN(IIF(w.discr = COALESCE(p.attrid, ''), b.price, NULL)) AS min_price_geb, MIN(IIF(w.discr = COALESCE(p.attrid, ''), b.price, NULL)) AS min_price_ctrd,
MAX(IIF(w.discr = COALESCE(p.attrid, ''), b.price, NULL)) AS max_price_geb, MAX(IIF(w.discr = COALESCE(p.attrid, ''), b.price, NULL)) AS max_price_ctrd,
SUM(b.amount) AS amount SUM(b.amount) AS amount
FROM payment_delivery_part_bucket b FROM payment_delivery_part_bucket b
LEFT JOIN delivery_part_bucket w ON (w.year, w.did, w.dpnr, w.bktnr) = (b.year, b.did, b.dpnr, b.bktnr) LEFT JOIN delivery_part_bucket w ON (w.year, w.did, w.dpnr, w.bktnr) = (b.year, b.did, b.dpnr, b.bktnr)
@@ -97,24 +97,24 @@ namespace Elwig.Models.Dtos {
public required string QualityLevel { get; set; } public required string QualityLevel { get; set; }
[Column("oe")] [Column("oe")]
public double Oe { get; set; } public double Oe { get; set; }
[Column("weight_ungeb")] [Column("weight_unctrd")]
public int WeightUngeb { get; set; } public int WeightUnCtrd { get; set; }
[Column("min_price_ungeb")] [Column("min_price_unctrd")]
public long? MinPriceUngeb { get; set; } public long? MinPriceUnCtrd { get; set; }
[Column("max_price_ungeb")] [Column("max_price_unctrd")]
public long? MaxPriceUngeb { get; set; } public long? MaxPriceUnCtrd { get; set; }
[Column("weight_lowgeb")] [Column("weight_lowctrd")]
public int WeightLowGeb { get; set; } public int WeightLowCtrd { get; set; }
[Column("min_price_lowgeb")] [Column("min_price_lowctrd")]
public long? MinPriceLowGeb { get; set; } public long? MinPriceLowCtrd { get; set; }
[Column("max_price_lowgeb")] [Column("max_price_lowctrd")]
public long? MaxPriceLowGeb { get; set; } public long? MaxPriceLowCtrd { get; set; }
[Column("weight_geb")] [Column("weight_ctrd")]
public int WeightGeb { get; set; } public int WeightCtrd { get; set; }
[Column("min_price_geb")] [Column("min_price_ctrd")]
public long? MinPriceGeb { get; set; } public long? MinPriceCtrd { get; set; }
[Column("max_price_geb")] [Column("max_price_ctrd")]
public long? MaxPriceGeb { get; set; } public long? MaxPriceCtrd { get; set; }
[Column("amount")] [Column("amount")]
public long Amount { get; set; } public long Amount { get; set; }
} }
+6 -6
View File
@@ -13,7 +13,7 @@ namespace Elwig.Models.Dtos {
("AttrId", "Attr.", null, 10), ("AttrId", "Attr.", null, 10),
("CultId", "Bewirt.", null, 15), ("CultId", "Bewirt.", null, 15),
("QualId", "Qual.", null, 15), ("QualId", "Qual.", null, 15),
("Geb", "gebunden", null, 20), ("Contracted", "gebunden", null, 20),
("Weight", "Menge", "kg", 20), ("Weight", "Menge", "kg", 20),
]; ];
@@ -28,12 +28,12 @@ namespace Elwig.Models.Dtos {
private static async Task<IEnumerable<WeightBreakdownRow>> FromDbSet(DbSet<WeightBreakdownRow> table, int year, string? zwstid) { private static async Task<IEnumerable<WeightBreakdownRow>> FromDbSet(DbSet<WeightBreakdownRow> table, int year, string? zwstid) {
zwstid = zwstid == null ? "NULL" : $"'{zwstid}'"; zwstid = zwstid == null ? "NULL" : $"'{zwstid}'";
return await table.FromSqlRaw($""" return await table.FromSqlRaw($"""
SELECT type, sortid, attrid, cultid, v.qualid, geb, SUM(weight) AS weight SELECT type, sortid, attrid, cultid, v.qualid, contracted, SUM(weight) AS weight
FROM v_stat_total v FROM v_stat_total v
LEFT JOIN wine_quality_level q ON q.qualid = v.qualid LEFT JOIN wine_quality_level q ON q.qualid = v.qualid
WHERE year = {year} AND ({zwstid} IS NULL OR zwstid = {zwstid}) WHERE year = {year} AND ({zwstid} IS NULL OR zwstid = {zwstid})
GROUP BY type, sortid, attrid, cultid, v.qualid, geb GROUP BY type, sortid, attrid, cultid, v.qualid, contracted
ORDER BY type DESC, sortid, attrid, cultid, q.min_kmw, geb ORDER BY type DESC, sortid, attrid, cultid, q.min_kmw, contracted
""").ToListAsync(); """).ToListAsync();
} }
} }
@@ -50,8 +50,8 @@ namespace Elwig.Models.Dtos {
public string? CultId { get; set; } public string? CultId { get; set; }
[Column("qualid")] [Column("qualid")]
public required string QualId { get; set; } public required string QualId { get; set; }
[Column("geb")] [Column("contracted")]
public required string Geb { get; set; } public required string Contracted { get; set; }
[Column("weight")] [Column("weight")]
public int Weight { get; set; } public int Weight { get; set; }
} }
+2 -2
View File
@@ -91,8 +91,8 @@ namespace Elwig.Models.Entities {
[Column("hand_picked")] [Column("hand_picked")]
public bool? IsHandPicked { get; set; } public bool? IsHandPicked { get; set; }
[Column("gebunden")] [Column("contracted")]
public bool? IsGebunden { get; set; } public bool? IsContracted { get; set; }
[Column("unloading")] [Column("unloading")]
public string? Unloading { get; set; } public string? Unloading { get; set; }
+6 -6
View File
@@ -105,17 +105,17 @@ namespace Elwig.Models.Entities {
[Column("juridical_pers")] [Column("juridical_pers")]
public bool IsJuridicalPerson { get; set; } public bool IsJuridicalPerson { get; set; }
[Column("volllieferant")] [Column("full_delivery")]
public bool IsVollLieferant { get; set; } public bool IsFullDelivery { get; set; }
[Column("buchführend")] [Column("accounting")]
public bool IsBuchführend { get; set; } public bool IsAccounting { get; set; }
[Column("organic")] [Column("organic")]
public bool IsOrganic { get; set; } public bool IsOrganic { get; set; }
[Column("funktionär")] [Column("officer")]
public bool IsFunktionär { get; set; } public bool IsOfficer { get; set; }
[Column("active")] [Column("active")]
public bool IsActive { get; set; } public bool IsActive { get; set; }
+1 -1
View File
@@ -107,7 +107,7 @@ namespace Elwig.Models.Entities {
[Column("calc_mode")] [Column("calc_mode")]
public int CalcMode { get; set; } public int CalcMode { get; set; }
[NotMapped] [NotMapped]
public bool Billing_HonorGebunden { public bool Billing_HonorContracted {
get => (CalcMode & 0x1) != 0; get => (CalcMode & 0x1) != 0;
set => CalcMode = value ? CalcMode | 0x1 : CalcMode & ~0x1; set => CalcMode = value ? CalcMode | 0x1 : CalcMode & ~0x1;
} }
@@ -92,6 +92,12 @@
{"$ref": "#/definitions/curve_data"} {"$ref": "#/definitions/curve_data"}
] ]
}, },
"ctrd": {
"anyOf": [
{"type": "number"},
{"$ref": "#/definitions/curve_data"}
]
},
"geb": { "geb": {
"anyOf": [ "anyOf": [
{"type": "number"}, {"type": "number"},
+24
View File
@@ -9,6 +9,30 @@ ALTER TABLE member_history RENAME COLUMN signed TO signed_member;
ALTER TABLE member_history ADD COLUMN signed_company INTEGER NOT NULL CHECK (signed_company IN (TRUE, FALSE)) DEFAULT FALSE; ALTER TABLE member_history ADD COLUMN signed_company INTEGER NOT NULL CHECK (signed_company IN (TRUE, FALSE)) DEFAULT FALSE;
PRAGMA writable_schema = ON;
UPDATE sqlite_schema SET sql = REPLACE(REPLACE(REPLACE(sql, 'funktionär', 'officer '), 'buchführend', 'accounting '), 'volllieferant', 'full_delivery')
WHERE type = 'table' AND name = 'member';
UPDATE sqlite_schema SET sql = REPLACE(sql, 'gebunden', 'contracted')
WHERE type = 'table' AND name = 'delivery_part';
UPDATE sqlite_schema SET sql = REPLACE(sql, 'gebunden', 'contracted')
WHERE type = 'view' AND name = 'v_delivery';
UPDATE sqlite_schema SET sql = REPLACE(sql, 'volllieferant', 'full_delivery')
WHERE type = 'view' AND name = 'v_bki_member';
UPDATE sqlite_schema SET sql = REPLACE(sql, ' geb', ' contracted')
WHERE type = 'view' AND name = 'v_stat_total';
UPDATE sqlite_schema SET sql = REPLACE(sql, 'gebunden', 'contracted')
WHERE type = 'view' AND (name = 'v_payment_bucket_strict' OR name = 'v_payment_bucket' OR name = 'v_under_delivery_bucket');
PRAGMA schema_version = 4101;
PRAGMA writable_schema = OFF;
UPDATE client_parameter SET value = '0' WHERE param = 'ENABLE_TIME_TRIGGERS'; UPDATE client_parameter SET value = '0' WHERE param = 'ENABLE_TIME_TRIGGERS';
UPDATE member SET org_auth_code = UPPER(SUBSTR(a.name, -11, 10)) UPDATE member SET org_auth_code = UPPER(SUBSTR(a.name, -11, 10))
+6 -6
View File
@@ -75,7 +75,7 @@ namespace Elwig.Services {
vm.TemperatureString = (p.Temperature != null) ? $"{p.Temperature:N1}" : ""; vm.TemperatureString = (p.Temperature != null) ? $"{p.Temperature:N1}" : "";
vm.AcidString = (p.Acid != null) ? $"{p.Acid:N1}" : ""; vm.AcidString = (p.Acid != null) ? $"{p.Acid:N1}" : "";
vm.IsHandPicked = p.IsHandPicked; vm.IsHandPicked = p.IsHandPicked;
vm.IsGebunden = p.IsGebunden; vm.IsContracted = p.IsContracted;
vm.Unloading = p.Unloading; vm.Unloading = p.Unloading;
vm.ScaleTerminalId = p.ScaleTerminalId; vm.ScaleTerminalId = p.ScaleTerminalId;
@@ -181,19 +181,19 @@ namespace Elwig.Services {
filter.RemoveAt(i--); filter.RemoveAt(i--);
filterNames.Add("Weißweinsorten"); filterNames.Add("Weißweinsorten");
} else if (e.Length >= 3 && e.Length <= 8 && "gebunden".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) { } else if (e.Length >= 3 && e.Length <= 8 && "gebunden".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
prd = prd.And(p => p.IsGebunden == true); prd = prd.And(p => p.IsContracted == true);
filter.RemoveAt(i--); filter.RemoveAt(i--);
filterNames.Add("gebunden"); filterNames.Add("gebunden");
} else if (e.Length >= 4 && e.Length <= 9 && "!gebunden".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) { } else if (e.Length >= 4 && e.Length <= 9 && "!gebunden".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
prd = prd.And(p => p.IsGebunden != true); prd = prd.And(p => p.IsContracted != true);
filter.RemoveAt(i--); filter.RemoveAt(i--);
filterNames.Add("nicht gebunden"); filterNames.Add("nicht gebunden");
} else if (e.Length >= 5 && e.Length <= 10 && "ungebunden".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) { } else if (e.Length >= 5 && e.Length <= 10 && "ungebunden".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
prd = prd.And(p => p.IsGebunden == false); prd = prd.And(p => p.IsContracted == false);
filter.RemoveAt(i--); filter.RemoveAt(i--);
filterNames.Add("ungebunden"); filterNames.Add("ungebunden");
} else if (e.Length >= 6 && e.Length <= 11 && "!ungebunden".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) { } else if (e.Length >= 6 && e.Length <= 11 && "!ungebunden".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
prd = prd.And(p => p.IsGebunden != false); prd = prd.And(p => p.IsContracted != false);
filter.RemoveAt(i--); filter.RemoveAt(i--);
filterNames.Add("nicht ungebunden"); filterNames.Add("nicht ungebunden");
} else if (e.Length >= 5 && e.Length <= 8 && "handlese".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) { } else if (e.Length >= 5 && e.Length <= 8 && "handlese".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
@@ -556,7 +556,7 @@ namespace Elwig.Services {
IsNetWeight = vm.IsNetWeight, IsNetWeight = vm.IsNetWeight,
IsHandPicked = vm.IsHandPicked, IsHandPicked = vm.IsHandPicked,
IsGebunden = vm.IsGebunden, IsContracted = vm.IsContracted,
Unloading = vm.Unloading, Unloading = vm.Unloading,
Temperature = vm.Temperature, Temperature = vm.Temperature,
Acid = vm.Acid, Acid = vm.Acid,
+24 -16
View File
@@ -116,7 +116,7 @@ namespace Elwig.Services {
vm.LfbisNr = m.LfbisNr; vm.LfbisNr = m.LfbisNr;
vm.OrganicOperatorId = m.OrganicOperatorId; vm.OrganicOperatorId = m.OrganicOperatorId;
vm.OrganicAuthorityCode = m.OrganicAuthorityCode; vm.OrganicAuthorityCode = m.OrganicAuthorityCode;
vm.IsBuchführend = m.IsBuchführend; vm.IsAccounting = m.IsAccounting;
vm.IsOrganic = m.IsOrganic; vm.IsOrganic = m.IsOrganic;
var billingAddr = m.BillingAddress; var billingAddr = m.BillingAddress;
@@ -150,8 +150,8 @@ namespace Elwig.Services {
vm.DefaultKg = (AT_Kg?)ControlUtils.GetItemFromSourceWithPk(vm.DefaultKgSource, m.DefaultKgNr); vm.DefaultKg = (AT_Kg?)ControlUtils.GetItemFromSourceWithPk(vm.DefaultKgSource, m.DefaultKgNr);
vm.Comment = m.Comment; vm.Comment = m.Comment;
vm.IsActive = m.IsActive; vm.IsActive = m.IsActive;
vm.IsVollLieferant = m.IsVollLieferant; vm.IsFullDelivery = m.IsFullDelivery;
vm.IsFunktionär = m.IsFunktionär; vm.IsOfficer = m.IsOfficer;
vm.ContactViaPost = m.ContactViaPost; vm.ContactViaPost = m.ContactViaPost;
vm.ContactViaEmail = m.ContactViaEmail; vm.ContactViaEmail = m.ContactViaEmail;
@@ -319,11 +319,11 @@ namespace Elwig.Services {
filter.RemoveAt(i--); filter.RemoveAt(i--);
filterNames.Add("inaktive Mitglieder"); filterNames.Add("inaktive Mitglieder");
} else if (e.Length >= 5 && e.Length <= 10 && "funktionär".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) { } else if (e.Length >= 5 && e.Length <= 10 && "funktionär".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
memberQuery = memberQuery.Where(m => m.IsFunktionär); memberQuery = memberQuery.Where(m => m.IsOfficer);
filter.RemoveAt(i--); filter.RemoveAt(i--);
filterNames.Add("Funktionäre"); filterNames.Add("Funktionäre");
} else if (e.Length >= 6 && e.Length <= 11 && e[0] == '!' && "funktionär".StartsWith(e[1..], StringComparison.CurrentCultureIgnoreCase)) { } else if (e.Length >= 6 && e.Length <= 11 && e[0] == '!' && "funktionär".StartsWith(e[1..], StringComparison.CurrentCultureIgnoreCase)) {
memberQuery = memberQuery.Where(m => !m.IsFunktionär); memberQuery = memberQuery.Where(m => !m.IsOfficer);
filter.RemoveAt(i--); filter.RemoveAt(i--);
filterNames.Add("Nicht-Funktionäre"); filterNames.Add("Nicht-Funktionäre");
} else if (e.Equals("bio", StringComparison.CurrentCultureIgnoreCase)) { } else if (e.Equals("bio", StringComparison.CurrentCultureIgnoreCase)) {
@@ -334,28 +334,36 @@ namespace Elwig.Services {
memberQuery = memberQuery.Where(m => !m.IsOrganic); memberQuery = memberQuery.Where(m => !m.IsOrganic);
filter.RemoveAt(i--); filter.RemoveAt(i--);
filterNames.Add("Nicht-Bio-Betriebe"); filterNames.Add("Nicht-Bio-Betriebe");
} else if (e.Length >= 4 && e.Length <= 14 && "vollablieferer".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
memberQuery = memberQuery.Where(m => m.IsFullDelivery);
filter.RemoveAt(i--);
filterNames.Add("Vollablieferer");
} else if (e.Length >= 4 && e.Length <= 13 && "volllieferant".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) { } else if (e.Length >= 4 && e.Length <= 13 && "volllieferant".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
memberQuery = memberQuery.Where(m => m.IsVollLieferant); memberQuery = memberQuery.Where(m => m.IsFullDelivery);
filter.RemoveAt(i--); filter.RemoveAt(i--);
filterNames.Add("Volllieferanten"); filterNames.Add("Vollablieferer");
} else if (e.Length >= 5 && e.Length <= 15 && e[0] == '!' && "vollablieferer".StartsWith(e[1..], StringComparison.CurrentCultureIgnoreCase)) {
memberQuery = memberQuery.Where(m => !m.IsFullDelivery);
filter.RemoveAt(i--);
filterNames.Add("Nicht-Vollablieferer");
} else if (e.Length >= 5 && e.Length <= 14 && e[0] == '!' && "volllieferant".StartsWith(e[1..], StringComparison.CurrentCultureIgnoreCase)) { } else if (e.Length >= 5 && e.Length <= 14 && e[0] == '!' && "volllieferant".StartsWith(e[1..], StringComparison.CurrentCultureIgnoreCase)) {
memberQuery = memberQuery.Where(m => !m.IsVollLieferant); memberQuery = memberQuery.Where(m => !m.IsFullDelivery);
filter.RemoveAt(i--); filter.RemoveAt(i--);
filterNames.Add("Nicht-Vollieferanten"); filterNames.Add("Nicht-Vollablieferer");
} else if (e.Length >= 5 && e.Length <= 11 && "buchführend".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) { } else if (e.Length >= 5 && e.Length <= 11 && "buchführend".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
memberQuery = memberQuery.Where(m => m.IsBuchführend); memberQuery = memberQuery.Where(m => m.IsAccounting);
filter.RemoveAt(i--); filter.RemoveAt(i--);
filterNames.Add("buchführend"); filterNames.Add("buchführend");
} else if (e.Length >= 6 && e.Length <= 12 && e[0] == '!' && "buchführend".StartsWith(e[1..], StringComparison.CurrentCultureIgnoreCase)) { } else if (e.Length >= 6 && e.Length <= 12 && e[0] == '!' && "buchführend".StartsWith(e[1..], StringComparison.CurrentCultureIgnoreCase)) {
memberQuery = memberQuery.Where(m => !m.IsBuchführend); memberQuery = memberQuery.Where(m => !m.IsAccounting);
filter.RemoveAt(i--); filter.RemoveAt(i--);
filterNames.Add("pauschaliert"); filterNames.Add("pauschaliert");
} else if (e.Length >= 8 && e.Length <= 12 && "pauschaliert".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) { } else if (e.Length >= 8 && e.Length <= 12 && "pauschaliert".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
memberQuery = memberQuery.Where(m => !m.IsBuchführend); memberQuery = memberQuery.Where(m => !m.IsAccounting);
filter.RemoveAt(i--); filter.RemoveAt(i--);
filterNames.Add("pauschaliert"); filterNames.Add("pauschaliert");
} else if (e.Length >= 9 && e.Length <= 13 && e[0] == '!' && "pauschaliert".StartsWith(e[1..], StringComparison.CurrentCultureIgnoreCase)) { } else if (e.Length >= 9 && e.Length <= 13 && e[0] == '!' && "pauschaliert".StartsWith(e[1..], StringComparison.CurrentCultureIgnoreCase)) {
memberQuery = memberQuery.Where(m => m.IsBuchführend); memberQuery = memberQuery.Where(m => m.IsAccounting);
filter.RemoveAt(i--); filter.RemoveAt(i--);
filterNames.Add("buchführend"); filterNames.Add("buchführend");
} else if (e.Equals("email", StringComparison.CurrentCultureIgnoreCase)) { } else if (e.Equals("email", StringComparison.CurrentCultureIgnoreCase)) {
@@ -629,7 +637,7 @@ namespace Elwig.Services {
LfbisNr = string.IsNullOrWhiteSpace(vm.LfbisNr) ? null : vm.LfbisNr, LfbisNr = string.IsNullOrWhiteSpace(vm.LfbisNr) ? null : vm.LfbisNr,
OrganicOperatorId = string.IsNullOrWhiteSpace(vm.OrganicOperatorId) ? null : vm.OrganicOperatorId, OrganicOperatorId = string.IsNullOrWhiteSpace(vm.OrganicOperatorId) ? null : vm.OrganicOperatorId,
OrganicAuthorityCode = string.IsNullOrWhiteSpace(vm.OrganicAuthorityCode) ? null : vm.OrganicAuthorityCode, OrganicAuthorityCode = string.IsNullOrWhiteSpace(vm.OrganicAuthorityCode) ? null : vm.OrganicAuthorityCode,
IsBuchführend = vm.IsBuchführend, IsAccounting = vm.IsAccounting,
IsOrganic = vm.IsOrganic, IsOrganic = vm.IsOrganic,
EntryDateString = string.IsNullOrWhiteSpace(vm.EntryDate) ? null : string.Join("-", vm.EntryDate.Split(".").Reverse()), EntryDateString = string.IsNullOrWhiteSpace(vm.EntryDate) ? null : string.Join("-", vm.EntryDate.Split(".").Reverse()),
@@ -640,8 +648,8 @@ namespace Elwig.Services {
SharesDormant = App.Client.HasRedWhite ? vm.BusinessShares3 ?? 0 : vm.BusinessShares2 ?? 0, SharesDormant = App.Client.HasRedWhite ? vm.BusinessShares3 ?? 0 : vm.BusinessShares2 ?? 0,
AccountingNr = string.IsNullOrWhiteSpace(vm.AccountingNr) ? null : vm.AccountingNr, AccountingNr = string.IsNullOrWhiteSpace(vm.AccountingNr) ? null : vm.AccountingNr,
IsActive = vm.IsActive, IsActive = vm.IsActive,
IsVollLieferant = vm.IsVollLieferant, IsFullDelivery = vm.IsFullDelivery,
IsFunktionär = vm.IsFunktionär, IsOfficer = vm.IsOfficer,
ZwstId = vm.Branch?.ZwstId, ZwstId = vm.Branch?.ZwstId,
DefaultKgNr = vm.DefaultKg?.KgNr, DefaultKgNr = vm.DefaultKg?.KgNr,
Comment = string.IsNullOrWhiteSpace(vm.Comment) ? null : vm.Comment, Comment = string.IsNullOrWhiteSpace(vm.Comment) ? null : vm.Comment,
+2 -2
View File
@@ -159,10 +159,10 @@ namespace Elwig.Services {
foreach (int mgnr in currentPayments.Keys) { foreach (int mgnr in currentPayments.Keys) {
var c = currentPayments[mgnr]; var c = currentPayments[mgnr];
var l = lastPayments.GetValueOrDefault(mgnr); var l = lastPayments.GetValueOrDefault(mgnr);
vatSum += (c.Amount - (l?.Amount ?? 0)) * (decimal)(c.Member.IsBuchführend ? v.Season.VatNormal : v.Season.VatFlatrate); vatSum += (c.Amount - (l?.Amount ?? 0)) * (decimal)(c.Member.IsAccounting ? v.Season.VatNormal : v.Season.VatFlatrate);
} }
} else { } else {
vatSum = currentPayments.Sum(e => e.Value.Amount * (decimal)(e.Value.Member.IsBuchführend ? v.Season.VatNormal : v.Season.VatFlatrate)); vatSum = currentPayments.Sum(e => e.Value.Amount * (decimal)(e.Value.Member.IsAccounting ? v.Season.VatNormal : v.Season.VatFlatrate));
} }
vatText = $"~{vatSum:N2} {sym}"; vatText = $"~{vatSum:N2} {sym}";
deductionText = $"- {sym}"; deductionText = $"- {sym}";
+1 -1
View File
@@ -157,7 +157,7 @@ namespace Elwig.ViewModels {
[ObservableProperty] [ObservableProperty]
public partial IEnumerable<object> WineRdSource { get; set; } = []; public partial IEnumerable<object> WineRdSource { get; set; } = [];
[ObservableProperty] [ObservableProperty]
public partial bool? IsGebunden { get; set; } public partial bool? IsContracted { get; set; }
public ObservableCollection<Modifier> Modifiers { get; set; } = []; public ObservableCollection<Modifier> Modifiers { get; set; } = [];
[ObservableProperty] [ObservableProperty]
+3 -3
View File
@@ -125,7 +125,7 @@ namespace Elwig.ViewModels {
[ObservableProperty] [ObservableProperty]
public partial string? OrganicAuthorityCode { get; set; } public partial string? OrganicAuthorityCode { get; set; }
[ObservableProperty] [ObservableProperty]
public partial bool IsBuchführend { get; set; } public partial bool IsAccounting { get; set; }
[ObservableProperty] [ObservableProperty]
public partial bool IsOrganic { get; set; } public partial bool IsOrganic { get; set; }
@@ -165,9 +165,9 @@ namespace Elwig.ViewModels {
[ObservableProperty] [ObservableProperty]
public partial bool IsActive { get; set; } public partial bool IsActive { get; set; }
[ObservableProperty] [ObservableProperty]
public partial bool IsVollLieferant { get; set; } public partial bool IsFullDelivery { get; set; }
[ObservableProperty] [ObservableProperty]
public partial bool IsFunktionär { get; set; } public partial bool IsOfficer { get; set; }
[ObservableProperty] [ObservableProperty]
public partial Branch? Branch { get; set; } public partial Branch? Branch { get; set; }
[ObservableProperty] [ObservableProperty]
+1 -1
View File
@@ -574,7 +574,7 @@
<CheckBox x:Name="ParameterAvoidUnderDeliveriesInput" Content="Unterlieferungen durch Abzug bei &quot;besseren&quot; Flächenbindungen vermeiden" <CheckBox x:Name="ParameterAvoidUnderDeliveriesInput" Content="Unterlieferungen durch Abzug bei &quot;besseren&quot; Flächenbindungen vermeiden"
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10,30,10,10" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10,30,10,10"
Checked="CheckBox_Changed" Unchecked="CheckBox_Changed"/> Checked="CheckBox_Changed" Unchecked="CheckBox_Changed"/>
<CheckBox x:Name="ParameterHonorGebundenInput" Margin="10,50,10,10" VerticalAlignment="Top" <CheckBox x:Name="ParameterHonorContractedInput" Margin="10,50,10,10" VerticalAlignment="Top"
Checked="CheckBox_Changed" Unchecked="CheckBox_Changed"> Checked="CheckBox_Changed" Unchecked="CheckBox_Changed">
<TextBlock>Bei Lieferungen das Feld <Italic>Gebunden</Italic> berücksichtigen</TextBlock> <TextBlock>Bei Lieferungen das Feld <Italic>Gebunden</Italic> berücksichtigen</TextBlock>
</CheckBox> </CheckBox>
+2 -2
View File
@@ -352,7 +352,7 @@ namespace Elwig.Windows {
ParameterBusinessShareHistoryInput.IsChecked = p.EnableMemberHistory; ParameterBusinessShareHistoryInput.IsChecked = p.EnableMemberHistory;
ParameterAllowAttrIntoLowerInput.IsChecked = s?.Billing_AllowAttrsIntoLower ?? false; ParameterAllowAttrIntoLowerInput.IsChecked = s?.Billing_AllowAttrsIntoLower ?? false;
ParameterAvoidUnderDeliveriesInput.IsChecked = s?.Billing_AvoidUnderDeliveries ?? false; ParameterAvoidUnderDeliveriesInput.IsChecked = s?.Billing_AvoidUnderDeliveries ?? false;
ParameterHonorGebundenInput.IsChecked = s?.Billing_HonorGebunden ?? false; ParameterHonorContractedInput.IsChecked = s?.Billing_HonorContracted ?? false;
ParameterExportEbicsVersion.SelectedIndex = p.ExportEbicsVersion - 3; ParameterExportEbicsVersion.SelectedIndex = p.ExportEbicsVersion - 3;
ParameterExportEbicsAddress.SelectedIndex = p.ExportEbicsAddress; ParameterExportEbicsAddress.SelectedIndex = p.ExportEbicsAddress;
@@ -406,7 +406,7 @@ namespace Elwig.Windows {
s.Billing_AllowAttrsIntoLower = ParameterAllowAttrIntoLowerInput.IsChecked ?? false; s.Billing_AllowAttrsIntoLower = ParameterAllowAttrIntoLowerInput.IsChecked ?? false;
s.Billing_AvoidUnderDeliveries = ParameterAvoidUnderDeliveriesInput.IsChecked ?? false; s.Billing_AvoidUnderDeliveries = ParameterAvoidUnderDeliveriesInput.IsChecked ?? false;
s.Billing_HonorGebunden = ParameterHonorGebundenInput.IsChecked ?? false; s.Billing_HonorContracted = ParameterHonorContractedInput.IsChecked ?? false;
ctx.Update(s); ctx.Update(s);
await ctx.SaveChangesAsync(); await ctx.SaveChangesAsync();
} catch { } } catch { }
+7 -7
View File
@@ -138,9 +138,9 @@
<Label Content="Oechsle:" Margin="10,10,0,0" Grid.Column="0"/> <Label Content="Oechsle:" Margin="10,10,0,0" Grid.Column="0"/>
<ctrl:UnitTextBox x:Name="OechsleInput" Unit="°Oe" TextChanged="OechsleInput_TextChanged" IsEnabled="False" <ctrl:UnitTextBox x:Name="OechsleInput" Unit="°Oe" TextChanged="OechsleInput_TextChanged" IsEnabled="False"
Grid.Column="1" Width="52" Margin="0,10,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"/> Grid.Column="1" Width="52" Margin="0,10,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
<CheckBox x:Name="GebInput" Content="Geb." IsEnabled="False" <CheckBox x:Name="ContractedInput" Content="Geb." IsEnabled="False"
Grid.Column="1" Margin="0,15,10,0" HorizontalAlignment="Right" VerticalAlignment="Top" Grid.Column="1" Margin="0,15,10,0" HorizontalAlignment="Right" VerticalAlignment="Top"
Checked="GebInput_Changed" Unchecked="GebInput_Changed"/> Checked="ContractedInput_Changed" Unchecked="ContractedInput_Changed"/>
<Label Content="Preis:" Margin="10,40,0,0" Grid.Column="0"/> <Label Content="Preis:" Margin="10,40,0,0" Grid.Column="0"/>
<ctrl:UnitTextBox x:Name="PriceInput" Unit="€/kg" TextChanged="PriceInput_TextChanged" IsEnabled="False" <ctrl:UnitTextBox x:Name="PriceInput" Unit="€/kg" TextChanged="PriceInput_TextChanged" IsEnabled="False"
@@ -148,16 +148,16 @@
</Grid> </Grid>
</GroupBox> </GroupBox>
<GroupBox Header="Gebunden Aufschlag" Grid.Row="1" Margin="0,5,5,5"> <GroupBox Header="Gebunden-Aufschlag" Grid.Row="1" Margin="0,5,5,5">
<Grid> <Grid>
<StackPanel Margin="10,10,0,0"> <StackPanel Margin="10,10,0,0">
<RadioButton x:Name="GebundenTypeFixed" GroupName="GebundenType" Checked="GebundenType_Checked" IsEnabled="False">Fix</RadioButton> <RadioButton x:Name="ContractedTypeFixed" GroupName="ContractedType" Checked="ContractedType_Checked" IsEnabled="False">Fix</RadioButton>
<RadioButton x:Name="GebundenTypeGraph" GroupName="GebundenType" Checked="GebundenType_Checked" IsEnabled="False">Frei</RadioButton> <RadioButton x:Name="ContractedTypeGraph" GroupName="ContractedType" Checked="ContractedType_Checked" IsEnabled="False">Frei</RadioButton>
<RadioButton x:Name="GebundenTypeNone" GroupName="GebundenType" Checked="GebundenType_Checked" IsEnabled="False">Nein</RadioButton> <RadioButton x:Name="ContractedTypeNone" GroupName="ContractedType" Checked="ContractedType_Checked" IsEnabled="False">Nein</RadioButton>
</StackPanel> </StackPanel>
<ctrl:UnitTextBox x:Name="GebundenFlatBonus" Unit="€/kg" TextChanged="GebundenFlatBonus_TextChanged" IsEnabled="False" <ctrl:UnitTextBox x:Name="ContractedFlatBonus" Unit="€/kg" TextChanged="ContractedFlatBonus_TextChanged" IsEnabled="False"
Width="90" Margin="5,5,5,5" HorizontalAlignment="Right" VerticalAlignment="Top" Grid.Column="1"/> Width="90" Margin="5,5,5,5" HorizontalAlignment="Right" VerticalAlignment="Top" Grid.Column="1"/>
</Grid> </Grid>
</GroupBox> </GroupBox>
+91 -91
View File
@@ -15,8 +15,8 @@ using Elwig.Services;
namespace Elwig.Windows { namespace Elwig.Windows {
public partial class ChartWindow : ContextWindow { public partial class ChartWindow : ContextWindow {
public static readonly Color ColorUngebunden = Colors.Blue; public static readonly Color ColorUnContracted = Colors.Blue;
public static readonly Color ColorGebunden = Colors.Gold; public static readonly Color ColorContracted = Colors.Gold;
public readonly int Year; public readonly int Year;
public readonly int AvNr; public readonly int AvNr;
@@ -27,20 +27,20 @@ namespace Elwig.Windows {
private bool Updating = false; private bool Updating = false;
private Scatter? DataPlot; private Scatter? DataPlot;
private Scatter? GebundenPlot; private Scatter? ContractedPlot;
private Marker? HighlightedPointPlot; private Marker? HighlightedPointPlot;
private Marker? PrimaryMarkedPointPlot; private Marker? PrimaryMarkedPointPlot;
private Marker? SecondaryMarkedPointPlot; private Marker? SecondaryMarkedPointPlot;
private Text? TooltipPlot; private Text? TooltipPlot;
private static readonly LegendItem private static readonly LegendItem
UngebundenLegend = new() { UnContractedLegend = new() {
LabelText = "Ungebunden", LineWidth = 1, LineColor = ColorUngebunden, LabelText = "Ungebunden", LineWidth = 1, LineColor = ColorUnContracted,
MarkerStyle = new(MarkerShape.FilledCircle, 5, ColorUngebunden) MarkerStyle = new(MarkerShape.FilledCircle, 5, ColorUnContracted)
}, },
GebundenLegend = new() { ContractedLegend = new() {
LabelText = "Gebunden", LineWidth = 1, LineColor = ColorGebunden, LabelText = "Gebunden", LineWidth = 1, LineColor = ColorContracted,
MarkerStyle = new(MarkerShape.FilledCircle, 5, ColorGebunden) MarkerStyle = new(MarkerShape.FilledCircle, 5, ColorContracted)
}, },
LdwLegend = new() { LdwLegend = new() {
LabelText = "68 °Oe (LDW)", LineWidth = 2, LineColor = Colors.Red, MarkerStyle = MarkerStyle.None LabelText = "68 °Oe (LDW)", LineWidth = 2, LineColor = Colors.Red, MarkerStyle = MarkerStyle.None
@@ -75,7 +75,7 @@ namespace Elwig.Windows {
Season = ctx.Seasons.Find(year) ?? throw new ArgumentException("Season not found"); Season = ctx.Seasons.Find(year) ?? throw new ArgumentException("Season not found");
CurrencySymbol = Season.Currency.Symbol ?? Season.Currency.Code; CurrencySymbol = Season.Currency.Symbol ?? Season.Currency.Code;
PriceInput.Unit = $"{CurrencySymbol}/kg"; PriceInput.Unit = $"{CurrencySymbol}/kg";
GebundenFlatBonus.Unit = $"{CurrencySymbol}/kg"; ContractedFlatBonus.Unit = $"{CurrencySymbol}/kg";
PaymentVar = ctx.PaymentVariants.Find(year, avnr) ?? throw new ArgumentException("PaymentVar not found"); PaymentVar = ctx.PaymentVariants.Find(year, avnr) ?? throw new ArgumentException("PaymentVar not found");
Title = $"{PaymentVar.Name} - Lese {year} - Elwig"; Title = $"{PaymentVar.Name} - Lese {year} - Elwig";
LockContext = true; LockContext = true;
@@ -100,7 +100,7 @@ namespace Elwig.Windows {
Season = await ctx.FetchSeasons(Year).SingleOrDefaultAsync() ?? throw new ArgumentException("Season not found"); Season = await ctx.FetchSeasons(Year).SingleOrDefaultAsync() ?? throw new ArgumentException("Season not found");
CurrencySymbol = Season.Currency.Symbol ?? Season.Currency.Code; CurrencySymbol = Season.Currency.Symbol ?? Season.Currency.Code;
PriceInput.Unit = $"{CurrencySymbol}/kg"; PriceInput.Unit = $"{CurrencySymbol}/kg";
GebundenFlatBonus.Unit = $"{CurrencySymbol}/kg"; ContractedFlatBonus.Unit = $"{CurrencySymbol}/kg";
try { try {
var data = EditBillingData.FromJson(PaymentVar.Data, await Utils.GetVaributes(ctx, Year)); var data = EditBillingData.FromJson(PaymentVar.Data, await Utils.GetVaributes(ctx, Year));
@@ -148,10 +148,10 @@ namespace Elwig.Windows {
CopyButton.IsEnabled = true; CopyButton.IsEnabled = true;
DeleteButton.IsEnabled = true; DeleteButton.IsEnabled = true;
EnableTextBox(OechsleInput); EnableTextBox(OechsleInput);
GebInput.IsEnabled = SelectedGraphEntry?.GebundenGraph != null; ContractedInput.IsEnabled = SelectedGraphEntry?.ContractedGraph != null;
GebundenTypeFixed.IsEnabled = true; ContractedTypeFixed.IsEnabled = true;
GebundenTypeGraph.IsEnabled = true; ContractedTypeGraph.IsEnabled = true;
GebundenTypeNone.IsEnabled = true; ContractedTypeNone.IsEnabled = true;
VaributeInput.IsEnabled = true; VaributeInput.IsEnabled = true;
AbgewertetInput.IsEnabled = true; AbgewertetInput.IsEnabled = true;
EnableOptionButtons(); EnableOptionButtons();
@@ -160,7 +160,7 @@ namespace Elwig.Windows {
CopyButton.IsEnabled = false; CopyButton.IsEnabled = false;
DeleteButton.IsEnabled = false; DeleteButton.IsEnabled = false;
DisableTextBox(OechsleInput); DisableTextBox(OechsleInput);
GebInput.IsEnabled = false; ContractedInput.IsEnabled = false;
DisableOptionButtons(); DisableOptionButtons();
} }
if (!PaymentVar.TestVariant) { if (!PaymentVar.TestVariant) {
@@ -168,9 +168,9 @@ namespace Elwig.Windows {
CopyButton.IsEnabled = false; CopyButton.IsEnabled = false;
DeleteButton.IsEnabled = false; DeleteButton.IsEnabled = false;
DisableTextBox(PriceInput); DisableTextBox(PriceInput);
GebundenTypeFixed.IsEnabled = false; ContractedTypeFixed.IsEnabled = false;
GebundenTypeGraph.IsEnabled = false; ContractedTypeGraph.IsEnabled = false;
GebundenTypeNone.IsEnabled = false; ContractedTypeNone.IsEnabled = false;
VaributeInput.IsEnabled = false; VaributeInput.IsEnabled = false;
AbgewertetInput.IsEnabled = false; AbgewertetInput.IsEnabled = false;
} }
@@ -181,15 +181,15 @@ namespace Elwig.Windows {
FillingInputs = true; FillingInputs = true;
AbgewertetInput.IsChecked = SelectedGraphEntry?.Abgewertet; AbgewertetInput.IsChecked = SelectedGraphEntry?.Abgewertet;
if (SelectedGraphEntry?.GebundenFlatBonus is double bonus) { if (SelectedGraphEntry?.ContractedFlatBonus is double bonus) {
GebundenTypeFixed.IsChecked = true; ContractedTypeFixed.IsChecked = true;
GebundenFlatBonus.Text = $"{bonus}"; ContractedFlatBonus.Text = $"{bonus}";
} else if (SelectedGraphEntry?.GebundenGraph != null) { } else if (SelectedGraphEntry?.ContractedGraph != null) {
GebundenTypeGraph.IsChecked = true; ContractedTypeGraph.IsChecked = true;
GebundenFlatBonus.Text = ""; ContractedFlatBonus.Text = "";
} else { } else {
GebundenTypeNone.IsChecked = true; ContractedTypeNone.IsChecked = true;
GebundenFlatBonus.Text = ""; ContractedFlatBonus.Text = "";
} }
ControlUtils.SelectItems(VaributeInput, SelectedGraphEntry?.Vaributes ?? []); ControlUtils.SelectItems(VaributeInput, SelectedGraphEntry?.Vaributes ?? []);
@@ -208,21 +208,21 @@ namespace Elwig.Windows {
private void InitPlot() { private void InitPlot() {
RefreshGradationLines(); RefreshGradationLines();
if (SelectedGraphEntry?.GebundenGraph != null) { if (SelectedGraphEntry?.ContractedGraph != null) {
GebundenPlot = OechslePricePlot.Plot.Add.Scatter(SelectedGraphEntry.GebundenGraph.DataX, SelectedGraphEntry.GebundenGraph.DataY); ContractedPlot = OechslePricePlot.Plot.Add.Scatter(SelectedGraphEntry.ContractedGraph.DataX, SelectedGraphEntry.ContractedGraph.DataY);
GebundenPlot.LineStyle.Color = ColorGebunden; ContractedPlot.LineStyle.Color = ColorContracted;
GebundenPlot.Color = ColorGebunden; ContractedPlot.Color = ColorContracted;
GebundenPlot.MarkerStyle = new MarkerStyle(MarkerShape.FilledCircle, 9, ColorGebunden); ContractedPlot.MarkerStyle = new MarkerStyle(MarkerShape.FilledCircle, 9, ColorContracted);
} }
if (SelectedGraphEntry != null) { if (SelectedGraphEntry != null) {
DataPlot = OechslePricePlot.Plot.Add.Scatter(SelectedGraphEntry.DataGraph.DataX, SelectedGraphEntry.DataGraph.DataY); DataPlot = OechslePricePlot.Plot.Add.Scatter(SelectedGraphEntry.DataGraph.DataX, SelectedGraphEntry.DataGraph.DataY);
DataPlot.LineStyle.Color = ColorUngebunden; DataPlot.LineStyle.Color = ColorUnContracted;
DataPlot.Color = ColorUngebunden; DataPlot.Color = ColorUnContracted;
DataPlot.MarkerStyle = new MarkerStyle(MarkerShape.FilledCircle, 9, ColorUngebunden); DataPlot.MarkerStyle = new MarkerStyle(MarkerShape.FilledCircle, 9, ColorUnContracted);
} }
OechslePricePlot.Plot.Axes.SetLimits(Math.Min(GraphEntry.MinX, GraphEntry.MinXGeb) - 1, GraphEntry.MaxX + 1, -0.1, 1.5); OechslePricePlot.Plot.Axes.SetLimits(Math.Min(GraphEntry.MinX, GraphEntry.MinXCtrd) - 1, GraphEntry.MaxX + 1, -0.1, 1.5);
HighlightedPointPlot = OechslePricePlot.Plot.Add.Marker(0, 0, MarkerShape.OpenCircle, 10, Colors.Red); HighlightedPointPlot = OechslePricePlot.Plot.Add.Marker(0, 0, MarkerShape.OpenCircle, 10, Colors.Red);
HighlightedPointPlot.IsVisible = false; HighlightedPointPlot.IsVisible = false;
@@ -250,9 +250,9 @@ namespace Elwig.Windows {
OechslePricePlot.Plot.Remove(DataPlot); OechslePricePlot.Plot.Remove(DataPlot);
DataPlot = null; DataPlot = null;
} }
if (GebundenPlot != null) { if (ContractedPlot != null) {
OechslePricePlot.Plot.Remove(GebundenPlot); OechslePricePlot.Plot.Remove(ContractedPlot);
GebundenPlot = null; ContractedPlot = null;
} }
OechslePricePlot.Plot.Clear(); OechslePricePlot.Plot.Clear();
OechslePricePlot.Reset(); OechslePricePlot.Reset();
@@ -365,8 +365,8 @@ namespace Elwig.Windows {
OechslePricePlot.Plot.Legend.ManualItems.Add(LdwLegend); OechslePricePlot.Plot.Legend.ManualItems.Add(LdwLegend);
OechslePricePlot.Plot.Legend.ManualItems.Add(QuwLegend); OechslePricePlot.Plot.Legend.ManualItems.Add(QuwLegend);
OechslePricePlot.Plot.Legend.ManualItems.Add(KabLegend); OechslePricePlot.Plot.Legend.ManualItems.Add(KabLegend);
OechslePricePlot.Plot.Legend.ManualItems.Add(UngebundenLegend); OechslePricePlot.Plot.Legend.ManualItems.Add(UnContractedLegend);
if (SelectedGraphEntry?.GebundenGraph != null) OechslePricePlot.Plot.Legend.ManualItems.Add(GebundenLegend); if (SelectedGraphEntry?.ContractedGraph != null) OechslePricePlot.Plot.Legend.ManualItems.Add(ContractedLegend);
} }
private void HideLegend() { private void HideLegend() {
@@ -408,10 +408,10 @@ namespace Elwig.Windows {
UpdateSelectedPoint(); UpdateSelectedPoint();
} }
private void GebInput_Changed(object sender, RoutedEventArgs evt) { private void ContractedInput_Changed(object sender, RoutedEventArgs evt) {
if (Updating) if (Updating)
return; return;
var sel = GebInput.IsChecked == true ? SelectedGraphEntry?.GebundenGraph : SelectedGraphEntry?.DataGraph; var sel = ContractedInput.IsChecked == true ? SelectedGraphEntry?.ContractedGraph : SelectedGraphEntry?.DataGraph;
if (sel != ActiveGraph) ChangeActiveGraph(sel); if (sel != ActiveGraph) ChangeActiveGraph(sel);
UpdateSelectedPoint(); UpdateSelectedPoint();
} }
@@ -424,7 +424,7 @@ namespace Elwig.Windows {
PrimaryMarkedPointPlot?.Location = new Coordinates(PrimaryMarkedPointPlot.Location.X, price); PrimaryMarkedPointPlot?.Location = new Coordinates(PrimaryMarkedPointPlot.Location.X, price);
SetHasChanged(); SetHasChanged();
OechslePricePlot.Refresh(); OechslePricePlot.Refresh();
CheckGebundenTypeFixed(); CheckContractedTypeFixed();
} }
} }
} }
@@ -436,7 +436,7 @@ namespace Elwig.Windows {
ActiveGraph.FlattenGraphLeft(PrimaryMarkedPoint); ActiveGraph.FlattenGraphLeft(PrimaryMarkedPoint);
SetHasChanged(); SetHasChanged();
OechslePricePlot.Refresh(); OechslePricePlot.Refresh();
CheckGebundenTypeFixed(); CheckContractedTypeFixed();
} }
private void RightFlatButton_Click(object sender, RoutedEventArgs evt) { private void RightFlatButton_Click(object sender, RoutedEventArgs evt) {
@@ -446,7 +446,7 @@ namespace Elwig.Windows {
ActiveGraph.FlattenGraphRight(PrimaryMarkedPoint); ActiveGraph.FlattenGraphRight(PrimaryMarkedPoint);
SetHasChanged(); SetHasChanged();
OechslePricePlot.Refresh(); OechslePricePlot.Refresh();
CheckGebundenTypeFixed(); CheckContractedTypeFixed();
} }
private void InterpolateButton_Click(object sender, RoutedEventArgs evt) { private void InterpolateButton_Click(object sender, RoutedEventArgs evt) {
@@ -456,7 +456,7 @@ namespace Elwig.Windows {
ActiveGraph.InterpolateGraph(PrimaryMarkedPoint, SecondaryMarkedPoint); ActiveGraph.InterpolateGraph(PrimaryMarkedPoint, SecondaryMarkedPoint);
SetHasChanged(); SetHasChanged();
OechslePricePlot.Refresh(); OechslePricePlot.Refresh();
CheckGebundenTypeFixed(); CheckContractedTypeFixed();
} }
private void LinearIncreaseButton_Click(object sender, RoutedEventArgs e) { private void LinearIncreaseButton_Click(object sender, RoutedEventArgs e) {
@@ -470,7 +470,7 @@ namespace Elwig.Windows {
ActiveGraph.LinearIncreaseGraphToEnd(PrimaryMarkedPoint, priceIncrease.Value); ActiveGraph.LinearIncreaseGraphToEnd(PrimaryMarkedPoint, priceIncrease.Value);
SetHasChanged(); SetHasChanged();
OechslePricePlot.Refresh(); OechslePricePlot.Refresh();
CheckGebundenTypeFixed(); CheckContractedTypeFixed();
} }
private void OechslePricePlot_MouseDown(object sender, MouseEventArgs e) { private void OechslePricePlot_MouseDown(object sender, MouseEventArgs e) {
@@ -500,7 +500,7 @@ namespace Elwig.Windows {
if (Highlighted.Graph != null) { if (Highlighted.Graph != null) {
Updating = true; Updating = true;
OechsleInput.Text = Highlighted.Graph.GetOechsleAt(Highlighted.Index).ToString(); OechsleInput.Text = Highlighted.Graph.GetOechsleAt(Highlighted.Index).ToString();
GebInput.IsChecked = Highlighted.Graph == SelectedGraphEntry?.GebundenGraph; ContractedInput.IsChecked = Highlighted.Graph == SelectedGraphEntry?.ContractedGraph;
PriceInput.Text = Math.Round(Highlighted.Graph.GetPriceAt(Highlighted.Index), Season.Precision).ToString(); PriceInput.Text = Math.Round(Highlighted.Graph.GetPriceAt(Highlighted.Index), Season.Precision).ToString();
Updating = false; Updating = false;
} }
@@ -509,14 +509,14 @@ namespace Elwig.Windows {
} else { } else {
PrimaryMarkedPoint = -1; PrimaryMarkedPoint = -1;
SecondaryMarkedPoint = -1; SecondaryMarkedPoint = -1;
if (SelectedGraphEntry?.GebundenGraph != null) { if (SelectedGraphEntry?.ContractedGraph != null) {
ChangeActiveGraph(null); ChangeActiveGraph(null);
} }
ChangeMarker(PrimaryMarkedPointPlot, false); ChangeMarker(PrimaryMarkedPointPlot, false);
ChangeMarker(SecondaryMarkedPointPlot, false); ChangeMarker(SecondaryMarkedPointPlot, false);
OechsleInput.Text = ""; OechsleInput.Text = "";
GebInput.IsChecked = false; ContractedInput.IsChecked = false;
PriceInput.Text = ""; PriceInput.Text = "";
DisableTextBox(PriceInput); DisableTextBox(PriceInput);
@@ -549,7 +549,7 @@ namespace Elwig.Windows {
} }
var mouseOnData = MouseOnPlot(DataPlot, GetMouseCoordinates(e.GetPosition(OechslePricePlot))); var mouseOnData = MouseOnPlot(DataPlot, GetMouseCoordinates(e.GetPosition(OechslePricePlot)));
var mouseOnGebunden = MouseOnPlot(GebundenPlot, GetMouseCoordinates(e.GetPosition(OechslePricePlot))); var mouseOnContracted = MouseOnPlot(ContractedPlot, GetMouseCoordinates(e.GetPosition(OechslePricePlot)));
Highlighted = LastHighlighted; Highlighted = LastHighlighted;
@@ -560,13 +560,13 @@ namespace Elwig.Windows {
HoverActive = true; HoverActive = true;
if (SelectedGraphEntry?.DataGraph is Graph g) if (SelectedGraphEntry?.DataGraph is Graph g)
HandleTooltip(mouseOnData.Value.X, mouseOnData.Value.Y, mouseOnData.Value.Index, g, e.GetPosition(OechslePricePlot), e is MouseWheelEventArgs); HandleTooltip(mouseOnData.Value.X, mouseOnData.Value.Y, mouseOnData.Value.Index, g, e.GetPosition(OechslePricePlot), e is MouseWheelEventArgs);
} else if (mouseOnGebunden != null) { } else if (mouseOnContracted != null) {
ChangeMarker(HighlightedPointPlot, true, mouseOnGebunden.Value.X, mouseOnGebunden.Value.Y); ChangeMarker(HighlightedPointPlot, true, mouseOnContracted.Value.X, mouseOnContracted.Value.Y);
HighlightedPointPlot?.IsVisible = true; HighlightedPointPlot?.IsVisible = true;
HoverChanged = true ^ HoverActive; HoverChanged = true ^ HoverActive;
HoverActive = true; HoverActive = true;
if (SelectedGraphEntry?.GebundenGraph is Graph g) if (SelectedGraphEntry?.ContractedGraph is Graph g)
HandleTooltip(mouseOnGebunden.Value.X, mouseOnGebunden.Value.Y, mouseOnGebunden.Value.Index, g, e.GetPosition(OechslePricePlot), e is MouseWheelEventArgs); HandleTooltip(mouseOnContracted.Value.X, mouseOnContracted.Value.Y, mouseOnContracted.Value.Index, g, e.GetPosition(OechslePricePlot), e is MouseWheelEventArgs);
} else { } else {
ChangeMarker(HighlightedPointPlot, false); ChangeMarker(HighlightedPointPlot, false);
HoverChanged = false ^ HoverActive; HoverChanged = false ^ HoverActive;
@@ -699,25 +699,25 @@ namespace Elwig.Windows {
private void ChangeActiveGraph(Graph? g) { private void ChangeActiveGraph(Graph? g) {
if (g != null && g == SelectedGraphEntry?.DataGraph) { if (g != null && g == SelectedGraphEntry?.DataGraph) {
EnableTextBox(OechsleInput); EnableTextBox(OechsleInput);
if (SelectedGraphEntry?.GebundenGraph != null) ChangeLineWidth(DataPlot, 4); if (SelectedGraphEntry?.ContractedGraph != null) ChangeLineWidth(DataPlot, 4);
ChangeLineWidth(GebundenPlot, 1); ChangeLineWidth(ContractedPlot, 1);
GebInput.IsEnabled = SelectedGraphEntry?.GebundenGraph != null; ContractedInput.IsEnabled = SelectedGraphEntry?.ContractedGraph != null;
GebInput.IsChecked = false; ContractedInput.IsChecked = false;
} else if (g != null && g == SelectedGraphEntry?.GebundenGraph) { } else if (g != null && g == SelectedGraphEntry?.ContractedGraph) {
EnableTextBox(OechsleInput); EnableTextBox(OechsleInput);
ChangeLineWidth(GebundenPlot, 4); ChangeLineWidth(ContractedPlot, 4);
ChangeLineWidth(DataPlot, 1); ChangeLineWidth(DataPlot, 1);
GebInput.IsEnabled = SelectedGraphEntry?.GebundenGraph != null; ContractedInput.IsEnabled = SelectedGraphEntry?.ContractedGraph != null;
GebInput.IsChecked = true; ContractedInput.IsChecked = true;
} else { } else {
DisableTextBox(OechsleInput); DisableTextBox(OechsleInput);
DisableTextBox(PriceInput); DisableTextBox(PriceInput);
OechsleInput.Text = ""; OechsleInput.Text = "";
GebInput.IsEnabled = false; ContractedInput.IsEnabled = false;
GebInput.IsChecked = false; ContractedInput.IsChecked = false;
PriceInput.Text = ""; PriceInput.Text = "";
ChangeLineWidth(DataPlot, 1); ChangeLineWidth(DataPlot, 1);
ChangeLineWidth(GebundenPlot, 1); ChangeLineWidth(ContractedPlot, 1);
} }
ActiveGraph = g; ActiveGraph = g;
} }
@@ -730,11 +730,11 @@ namespace Elwig.Windows {
RefreshInputs(); RefreshInputs();
} }
private void GebundenFlatBonus_TextChanged(object sender, TextChangedEventArgs e) { private void ContractedFlatBonus_TextChanged(object sender, TextChangedEventArgs e) {
if (FillingInputs) return; if (FillingInputs) return;
var r = Validator.CheckDecimal(GebundenFlatBonus, true, 2, Season.Precision); var r = Validator.CheckDecimal(ContractedFlatBonus, true, 2, Season.Precision);
if (r.IsValid && SelectedGraphEntry != null) { if (r.IsValid && SelectedGraphEntry != null) {
SelectedGraphEntry.GebundenFlatBonus = double.Parse(GebundenFlatBonus.Text); SelectedGraphEntry.ContractedFlatBonus = double.Parse(ContractedFlatBonus.Text);
ResetPlot(); ResetPlot();
InitPlot(); InitPlot();
} }
@@ -795,37 +795,37 @@ namespace Elwig.Windows {
GraphList.Items.Refresh(); GraphList.Items.Refresh();
} }
private void GebundenType_Checked(object sender, RoutedEventArgs e) { private void ContractedType_Checked(object sender, RoutedEventArgs e) {
if (FillingInputs) return; if (FillingInputs) return;
if (SelectedGraphEntry == null) { if (SelectedGraphEntry == null) {
DisableTextBox(GebundenFlatBonus); DisableTextBox(ContractedFlatBonus);
return; return;
} }
if (GebundenTypeNone.IsChecked == true) { if (ContractedTypeNone.IsChecked == true) {
SelectedGraphEntry.RemoveGebundenGraph(); SelectedGraphEntry.RemoveContractedGraph();
DisableTextBox(GebundenFlatBonus); DisableTextBox(ContractedFlatBonus);
} else if (GebundenTypeFixed.IsChecked == true) { } else if (ContractedTypeFixed.IsChecked == true) {
SelectedGraphEntry.GebundenFlatBonus = double.TryParse(GebundenFlatBonus.Text, out var val) ? val : 0.1; SelectedGraphEntry.ContractedFlatBonus = double.TryParse(ContractedFlatBonus.Text, out var val) ? val : 0.1;
SelectedGraphEntry.AddGebundenGraph(); SelectedGraphEntry.AddContractedGraph();
EnableTextBox(GebundenFlatBonus); EnableTextBox(ContractedFlatBonus);
} else if (GebundenTypeGraph.IsChecked == true) { } else if (ContractedTypeGraph.IsChecked == true) {
SelectedGraphEntry.AddGebundenGraph(); SelectedGraphEntry.AddContractedGraph();
DisableTextBox(GebundenFlatBonus); DisableTextBox(ContractedFlatBonus);
} }
SetHasChanged(); SetHasChanged();
RefreshInputs(); RefreshInputs();
} }
private void CheckGebundenTypeFixed() { private void CheckContractedTypeFixed() {
FillingInputs = true; FillingInputs = true;
if (SelectedGraphEntry?.GebundenFlatBonus is double bonus) { if (SelectedGraphEntry?.ContractedFlatBonus is double bonus) {
GebundenTypeFixed.IsChecked = true; ContractedTypeFixed.IsChecked = true;
GebundenFlatBonus.Text = $"{bonus}"; ContractedFlatBonus.Text = $"{bonus}";
EnableTextBox(GebundenFlatBonus); EnableTextBox(ContractedFlatBonus);
} else if (SelectedGraphEntry?.GebundenGraph != null) { } else if (SelectedGraphEntry?.ContractedGraph != null) {
GebundenTypeGraph.IsChecked = true; ContractedTypeGraph.IsChecked = true;
GebundenFlatBonus.Text = ""; ContractedFlatBonus.Text = "";
DisableTextBox(GebundenFlatBonus); DisableTextBox(ContractedFlatBonus);
} }
FillingInputs = false; FillingInputs = false;
} }
+1 -1
View File
@@ -682,7 +682,7 @@
Margin="0,70,10,10" Grid.Column="1" Margin="0,70,10,10" Grid.Column="1"
DisplayMemberPath="Name"/> DisplayMemberPath="Name"/>
<CheckBox x:Name="GebundenInput" IsChecked="{Binding IsGebunden, Mode=TwoWay}" <CheckBox x:Name="ContractedInput" IsChecked="{Binding IsContracted, Mode=TwoWay}"
Content="Gebunden" Margin="10,105,0,0" Grid.Column="0" Grid.ColumnSpan="2" IsThreeState="True" Content="Gebunden" Margin="10,105,0,0" Grid.Column="0" Grid.ColumnSpan="2" IsThreeState="True"
VerticalAlignment="Top" HorizontalAlignment="Left" VerticalAlignment="Top" HorizontalAlignment="Left"
Checked="CheckBox_Changed" Unchecked="CheckBox_Changed" Indeterminate="CheckBox_Changed"/> Checked="CheckBox_Changed" Unchecked="CheckBox_Changed" Indeterminate="CheckBox_Changed"/>
+5 -5
View File
@@ -356,11 +356,11 @@ namespace Elwig.Windows {
} }
if (App.Client.IsMatzen || App.Client.IsWinzerkeller || App.Client.IsBaden || App.Client.IsWeinland) { if (App.Client.IsMatzen || App.Client.IsWinzerkeller || App.Client.IsBaden || App.Client.IsWeinland) {
GebundenInput.IsEnabled = false; ContractedInput.IsEnabled = false;
SetDefaultValue(GebundenInput, null); SetDefaultValue(ContractedInput, null);
} else { } else {
GebundenInput.IsEnabled = true; ContractedInput.IsEnabled = true;
UnsetDefaultValue(GebundenInput); UnsetDefaultValue(ContractedInput);
} }
} }
@@ -376,7 +376,7 @@ namespace Elwig.Windows {
ViewModel.IsNetWeight = App.Config.WeighingMode == WeighingMode.Net; ViewModel.IsNetWeight = App.Config.WeighingMode == WeighingMode.Net;
ViewModel.IsHandPicked = App.Config.WeighingMode != WeighingMode.Net ? true : null; ViewModel.IsHandPicked = App.Config.WeighingMode != WeighingMode.Net ? true : null;
ViewModel.Unloading = null; ViewModel.Unloading = null;
ViewModel.IsGebunden = null; ViewModel.IsContracted = null;
InitialDefaultInputs(); InitialDefaultInputs();
//WineQualityLevelInput.IsEnabled = false; // disable wine quality level input in Übernahme //WineQualityLevelInput.IsEnabled = false; // disable wine quality level input in Übernahme
+4 -4
View File
@@ -167,14 +167,14 @@
Margin="180,225,10,10" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="180,225,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
Checked="MemberInput_Checked"/> Checked="MemberInput_Checked"/>
<Label Content="Funktionär:" x:Name="MemberFunktionärLabel" Margin="10,250,0,10"/> <Label Content="Funktionär:" x:Name="MemberOfficerLabel" Margin="10,250,0,10"/>
<RadioButton x:Name="MemberFunktionärYesInput" Content="Ja" GroupName="MemberFunktionär" <RadioButton x:Name="MemberOfficerYesInput" Content="Ja" GroupName="MemberOfficer"
Margin="80,255,10,10" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="80,255,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
Checked="MemberInput_Checked"/> Checked="MemberInput_Checked"/>
<RadioButton x:Name="MemberFunktionärNoInput" Content="Nein" GroupName="MemberFunktionär" <RadioButton x:Name="MemberOfficerNoInput" Content="Nein" GroupName="MemberOfficer"
Margin="125,255,10,10" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="125,255,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
Checked="MemberInput_Checked"/> Checked="MemberInput_Checked"/>
<RadioButton x:Name="MemberFunktionärIndifferentInput" Content="Egal" GroupName="MemberFunktionär" <RadioButton x:Name="MemberOfficerIndifferentInput" Content="Egal" GroupName="MemberOfficer"
Margin="180,255,10,10" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="180,255,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
Checked="MemberInput_Checked"/> Checked="MemberInput_Checked"/>
+9 -9
View File
@@ -122,7 +122,7 @@ namespace Elwig.Windows {
RecipientsActiveMembersInput.IsChecked = true; RecipientsActiveMembersInput.IsChecked = true;
MemberOrganicIndifferentInput.IsChecked = true; MemberOrganicIndifferentInput.IsChecked = true;
MemberFunktionärIndifferentInput.IsChecked = true; MemberOfficerIndifferentInput.IsChecked = true;
DeliveryConfirmationFooterInput.Text = App.Client.TextDeliveryConfirmation; DeliveryConfirmationFooterInput.Text = App.Client.TextDeliveryConfirmation;
CreditNoteFooterInput.Text = App.Client.TextCreditNote; CreditNoteFooterInput.Text = App.Client.TextCreditNote;
@@ -408,10 +408,10 @@ namespace Elwig.Windows {
MemberOrganicYesInput.Visibility = vis; MemberOrganicYesInput.Visibility = vis;
MemberOrganicNoInput.Visibility = vis; MemberOrganicNoInput.Visibility = vis;
MemberOrganicIndifferentInput.Visibility = vis; MemberOrganicIndifferentInput.Visibility = vis;
MemberFunktionärLabel.Visibility = vis; MemberOfficerLabel.Visibility = vis;
MemberFunktionärYesInput.Visibility = vis; MemberOfficerYesInput.Visibility = vis;
MemberFunktionärNoInput.Visibility = vis; MemberOfficerNoInput.Visibility = vis;
MemberFunktionärIndifferentInput.Visibility = vis; MemberOfficerIndifferentInput.Visibility = vis;
MemberAreaComInput.Visibility = RecipientsAreaComMembersInput.IsChecked == true ? Visibility.Visible : Visibility.Hidden; MemberAreaComInput.Visibility = RecipientsAreaComMembersInput.IsChecked == true ? Visibility.Visible : Visibility.Hidden;
MemberAreaComLabel.Visibility = RecipientsAreaComMembersInput.IsChecked == true ? Visibility.Visible : Visibility.Hidden; MemberAreaComLabel.Visibility = RecipientsAreaComMembersInput.IsChecked == true ? Visibility.Visible : Visibility.Hidden;
MemberDeliveryAncmtInput.Visibility = RecipientsDeliveryAncmtMembersInput.IsChecked == true ? Visibility.Visible : Visibility.Hidden; MemberDeliveryAncmtInput.Visibility = RecipientsDeliveryAncmtMembersInput.IsChecked == true ? Visibility.Visible : Visibility.Hidden;
@@ -459,10 +459,10 @@ namespace Elwig.Windows {
} else if (MemberOrganicNoInput.IsChecked == true) { } else if (MemberOrganicNoInput.IsChecked == true) {
query = query.Where(m => !m.IsOrganic); query = query.Where(m => !m.IsOrganic);
} }
if (MemberFunktionärYesInput.IsChecked == true) { if (MemberOfficerYesInput.IsChecked == true) {
query = query.Where(m => m.IsFunktionär); query = query.Where(m => m.IsOfficer);
} else if (MemberFunktionärNoInput.IsChecked == true) { } else if (MemberOfficerNoInput.IsChecked == true) {
query = query.Where(m => !m.IsFunktionär); query = query.Where(m => !m.IsOfficer);
} }
if (RecipientsAreaComMembersInput.IsChecked == true) { if (RecipientsAreaComMembersInput.IsChecked == true) {
+3 -3
View File
@@ -301,12 +301,12 @@
<TextBlock Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2">Ungebunden:</TextBlock> <TextBlock Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2">Ungebunden:</TextBlock>
<TextBlock Grid.Row="1" Grid.Column="1" TextAlignment="Right" x:Name="SeasonStatMembersTotal">-</TextBlock> <TextBlock Grid.Row="1" Grid.Column="1" TextAlignment="Right" x:Name="SeasonStatMembersTotal">-</TextBlock>
<TextBlock Grid.Row="2" Grid.Column="1" TextAlignment="Right" x:Name="SeasonStatMembersGeb">-</TextBlock> <TextBlock Grid.Row="2" Grid.Column="1" TextAlignment="Right" x:Name="SeasonStatMembersCtrd">-</TextBlock>
<TextBlock Grid.Row="3" Grid.Column="1" TextAlignment="Right">-</TextBlock> <TextBlock Grid.Row="3" Grid.Column="1" TextAlignment="Right">-</TextBlock>
<TextBlock Grid.Row="1" Grid.Column="2" TextAlignment="Right" x:Name="SeasonStatWeightTotal">-</TextBlock> <TextBlock Grid.Row="1" Grid.Column="2" TextAlignment="Right" x:Name="SeasonStatWeightTotal">-</TextBlock>
<TextBlock Grid.Row="2" Grid.Column="2" TextAlignment="Right" x:Name="SeasonStatWeightGeb">-</TextBlock> <TextBlock Grid.Row="2" Grid.Column="2" TextAlignment="Right" x:Name="SeasonStatWeightCtrd">-</TextBlock>
<TextBlock Grid.Row="3" Grid.Column="2" TextAlignment="Right" x:Name="SeasonStatWeightUngeb">-</TextBlock> <TextBlock Grid.Row="3" Grid.Column="2" TextAlignment="Right" x:Name="SeasonStatWeightUnCtrd">-</TextBlock>
<TextBlock Grid.Row="1" Grid.Column="3" TextAlignment="Right">-</TextBlock> <TextBlock Grid.Row="1" Grid.Column="3" TextAlignment="Right">-</TextBlock>
<TextBlock Grid.Row="2" Grid.Column="3" TextAlignment="Right" x:Name="SeasonStatArea">-</TextBlock> <TextBlock Grid.Row="2" Grid.Column="3" TextAlignment="Right" x:Name="SeasonStatArea">-</TextBlock>
+8 -8
View File
@@ -406,26 +406,26 @@ namespace Elwig.Windows {
BreakdownMemberVarietyButton.IsEnabled = valid; BreakdownMemberVarietyButton.IsEnabled = valid;
SeasonStatMembersTotal.Text = "-"; SeasonStatMembersTotal.Text = "-";
SeasonStatMembersGeb.Text = "-"; SeasonStatMembersCtrd.Text = "-";
SeasonStatWeightTotal.Text = "-"; SeasonStatWeightTotal.Text = "-";
SeasonStatWeightGeb.Text = "-"; SeasonStatWeightCtrd.Text = "-";
SeasonStatWeightUngeb.Text = "-"; SeasonStatWeightUnCtrd.Text = "-";
SeasonStatArea.Text = "-"; SeasonStatArea.Text = "-";
if (valid) { if (valid) {
await Task.Run(async () => { await Task.Run(async () => {
var membersTotal = await ctx.Deliveries.Where(d => d.Year == year).Select(d => d.Member).Distinct().CountAsync(); var membersTotal = await ctx.Deliveries.Where(d => d.Year == year).Select(d => d.Member).Distinct().CountAsync();
var areaComs = Utils.ActiveAreaCommitments(ctx.AreaCommitments, year!.Value); var areaComs = Utils.ActiveAreaCommitments(ctx.AreaCommitments, year!.Value);
var membersGeb = await areaComs.Select(c => c.Member).Distinct().CountAsync(); var membersCtrd = await areaComs.Select(c => c.Member).Distinct().CountAsync();
var weightTotal = await ctx.DeliveryParts.Where(p => p.Year == year).SumAsync(p => p.Weight); var weightTotal = await ctx.DeliveryParts.Where(p => p.Year == year).SumAsync(p => p.Weight);
var gebWeight = await ctx.DeliveryPartBuckets.Where(b => b.Year == year && b.Discr != "_").SumAsync(b => b.Value); var ctrdWeight = await ctx.DeliveryPartBuckets.Where(b => b.Year == year && b.Discr != "_").SumAsync(b => b.Value);
var area = await areaComs.SumAsync(c => c.Area); var area = await areaComs.SumAsync(c => c.Area);
await App.MainDispatcher.BeginInvoke(() => { await App.MainDispatcher.BeginInvoke(() => {
if (year != SeasonInput.Value) return; if (year != SeasonInput.Value) return;
SeasonStatMembersTotal.Text = $"{membersTotal:N0}"; SeasonStatMembersTotal.Text = $"{membersTotal:N0}";
SeasonStatMembersGeb.Text = $"{membersGeb:N0}"; SeasonStatMembersCtrd.Text = $"{membersCtrd:N0}";
SeasonStatWeightTotal.Text = $"{weightTotal:N0} kg"; SeasonStatWeightTotal.Text = $"{weightTotal:N0} kg";
SeasonStatWeightGeb.Text = $"{gebWeight:N0} kg"; SeasonStatWeightCtrd.Text = $"{ctrdWeight:N0} kg";
SeasonStatWeightUngeb.Text = $"{weightTotal - gebWeight:N0} kg"; SeasonStatWeightUnCtrd.Text = $"{weightTotal - ctrdWeight:N0} kg";
SeasonStatArea.Text = $"{area:N0} m²"; SeasonStatArea.Text = $"{area:N0} m²";
}); });
}); });
+4 -4
View File
@@ -204,7 +204,7 @@
<Bold>Aktiv</Bold>: aktiv, !Aktiv (nicht-aktiv)<LineBreak/> <Bold>Aktiv</Bold>: aktiv, !Aktiv (nicht-aktiv)<LineBreak/>
<Bold>Bio-Betrieb</Bold>: BIO, !bio (ausgenommen Bio)<LineBreak/> <Bold>Bio-Betrieb</Bold>: BIO, !bio (ausgenommen Bio)<LineBreak/>
<Bold>Buchführend</Bold>: buchf[ührend], Pauschal[iert], !buchf[ührend]<LineBreak/> <Bold>Buchführend</Bold>: buchf[ührend], Pauschal[iert], !buchf[ührend]<LineBreak/>
<Bold>Volllieferant</Bold>: voll[lieferant], !Voll[lieferant] (nicht-Volllieferant)<LineBreak/> <Bold>Vollablieferer</Bold>: voll[ablieferer], voll[lieferant], !Voll[lieferant] (nicht-Vollablieferer)<LineBreak/>
<Bold>Funktionär</Bold>: Funkt[ionär], !funkt[ionär] (nicht-Funktionär)<LineBreak/> <Bold>Funktionär</Bold>: Funkt[ionär], !funkt[ionär] (nicht-Funktionär)<LineBreak/>
<Bold>Telefon-Nr.</Bold>: z.B. +436641234, ....<LineBreak/> <Bold>Telefon-Nr.</Bold>: z.B. +436641234, ....<LineBreak/>
<Bold>Kontaktdaten</Bold>: email (mind. 1 E-Mail-Adr.), telnr (mind. 1 Tel.-Nr.), !email (keine E-Mail-Adr.), !telnr (keine Tel.-Nr.)<LineBreak/> <Bold>Kontaktdaten</Bold>: email (mind. 1 E-Mail-Adr.), telnr (mind. 1 Tel.-Nr.), !email (keine E-Mail-Adr.), !telnr (keine Tel.-Nr.)<LineBreak/>
@@ -569,7 +569,7 @@
Checked="OrganicInput_Changed" Unchecked="OrganicInput_Changed" Checked="OrganicInput_Changed" Unchecked="OrganicInput_Changed"
Grid.Column="2" HorizontalAlignment="Left" Margin="5,15,0,0" VerticalAlignment="Top"/> Grid.Column="2" HorizontalAlignment="Left" Margin="5,15,0,0" VerticalAlignment="Top"/>
<CheckBox x:Name="BuchführendInput" Content="Buchführend" IsChecked="{Binding IsBuchführend, Mode=TwoWay}" IsEnabled="False" <CheckBox x:Name="AccountingInput" Content="Buchführend" IsChecked="{Binding IsAccounting, Mode=TwoWay}" IsEnabled="False"
Checked="CheckBox_Changed" Unchecked="CheckBox_Changed" Checked="CheckBox_Changed" Unchecked="CheckBox_Changed"
Grid.Column="2" HorizontalAlignment="Left" Margin="5,45,0,0" VerticalAlignment="Top"/> Grid.Column="2" HorizontalAlignment="Left" Margin="5,45,0,0" VerticalAlignment="Top"/>
@@ -660,11 +660,11 @@
Checked="ActiveInput_Changed" Unchecked="ActiveInput_Changed" Checked="ActiveInput_Changed" Unchecked="ActiveInput_Changed"
Grid.Column="2" HorizontalAlignment="Left" Margin="0,15,0,0" VerticalAlignment="Top"/> Grid.Column="2" HorizontalAlignment="Left" Margin="0,15,0,0" VerticalAlignment="Top"/>
<CheckBox x:Name="VollLieferantInput" Content="Volllieferant" IsChecked="{Binding IsVollLieferant, Mode=TwoWay}" IsEnabled="False" <CheckBox x:Name="FullDeliveryInput" Content="Vollablieferer" IsChecked="{Binding IsFullDelivery, Mode=TwoWay}" IsEnabled="False"
Checked="CheckBox_Changed" Unchecked="CheckBox_Changed" Checked="CheckBox_Changed" Unchecked="CheckBox_Changed"
Grid.Column="2" HorizontalAlignment="Left" Margin="0,45,0,0" VerticalAlignment="Top"/> Grid.Column="2" HorizontalAlignment="Left" Margin="0,45,0,0" VerticalAlignment="Top"/>
<CheckBox x:Name="FunkionärInput" Content="Funktionär" IsChecked="{Binding IsFunktionär, Mode=TwoWay}" IsEnabled="False" <CheckBox x:Name="OfficerInput" Content="Funktionär" IsChecked="{Binding IsOfficer, Mode=TwoWay}" IsEnabled="False"
Checked="CheckBox_Changed" Unchecked="CheckBox_Changed" Checked="CheckBox_Changed" Unchecked="CheckBox_Changed"
Grid.Column="2" HorizontalAlignment="Left" Margin="0,75,0,0" VerticalAlignment="Top"/> Grid.Column="2" HorizontalAlignment="Left" Margin="0,75,0,0" VerticalAlignment="Top"/>
+3 -3
View File
@@ -60,7 +60,7 @@ namespace Tests.E2ETests {
Window.FindElement(By.WpfId("UstIdNrInput")).SendKeys("ATU01234565"); Window.FindElement(By.WpfId("UstIdNrInput")).SendKeys("ATU01234565");
Window.FindElement(By.WpfId("LfbisNrInput")).SendKeys("0123455"); Window.FindElement(By.WpfId("LfbisNrInput")).SendKeys("0123455");
Window.FindElement(By.WpfId("BuchführendInput")).Click(); Window.FindElement(By.WpfId("AccountingInput")).Click();
Window.FindElement(By.WpfId("OrganicInput")).Click(); Window.FindElement(By.WpfId("OrganicInput")).Click();
Window.FindElement(By.WpfId("BillingNameInput")).SendKeys("Neuling KG"); Window.FindElement(By.WpfId("BillingNameInput")).SendKeys("Neuling KG");
@@ -72,8 +72,8 @@ namespace Tests.E2ETests {
Window.FindElement(By.WpfId("BranchInput")).SelectItem("Matzen"); Window.FindElement(By.WpfId("BranchInput")).SelectItem("Matzen");
Window.FindElement(By.WpfId("DefaultKgInput")).SelectItem(3); Window.FindElement(By.WpfId("DefaultKgInput")).SelectItem(3);
Window.FindElement(By.WpfId("VollLieferantInput")).Click(); Window.FindElement(By.WpfId("FullDeliveryInput")).Click();
Window.FindElement(By.WpfId("FunkionärInput")).Click(); Window.FindElement(By.WpfId("OfficerInput")).Click();
Window.FindElement(By.WpfId("CommentInput")).SendKeys("Die lieben Mustermänner und Musterfrauen!"); Window.FindElement(By.WpfId("CommentInput")).SendKeys("Die lieben Mustermänner und Musterfrauen!");
Window.FindElement(By.WpfId("ContactEmailInput")).Click(); Window.FindElement(By.WpfId("ContactEmailInput")).Click();
+1 -1
View File
@@ -60,7 +60,7 @@ INSERT INTO delivery (mgnr, year, did, date, time, zwstid, lnr) VALUES
(101, 2021, 1, '2021-10-01', NULL, 'X', 1), (101, 2021, 1, '2021-10-01', NULL, 'X', 1),
(101, 2021, 2, '2021-10-01', NULL, 'X', 2), (101, 2021, 2, '2021-10-01', NULL, 'X', 2),
(101, 2021, 3, '2021-10-01', NULL, 'X', 3); (101, 2021, 3, '2021-10-01', NULL, 'X', 3);
INSERT INTO delivery_part (year, did, dpnr, sortid, attrid, cultid, weight, kmw, qualid, hkid, kgnr, gebunden, net_weight, manual_weighing, spl_check, scale_terminal, weighing_data, weighing_reason) VALUES INSERT INTO delivery_part (year, did, dpnr, sortid, attrid, cultid, weight, kmw, qualid, hkid, kgnr, contracted, net_weight, manual_weighing, spl_check, scale_terminal, weighing_data, weighing_reason) VALUES
(2021, 1, 1, 'GV', 'K', NULL, 4000, 17, 'KAB', 'WLNO', 06109, TRUE, TRUE, FALSE, FALSE, NULL, NULL, NULL), (2021, 1, 1, 'GV', 'K', NULL, 4000, 17, 'KAB', 'WLNO', 06109, TRUE, TRUE, FALSE, FALSE, NULL, NULL, NULL),
(2021, 1, 2, 'GV', NULL, NULL, 4000, 16, 'QUW', 'WLNO', 06109, FALSE, TRUE, FALSE, FALSE, NULL, NULL, NULL), (2021, 1, 2, 'GV', NULL, NULL, 4000, 16, 'QUW', 'WLNO', 06109, FALSE, TRUE, FALSE, FALSE, NULL, NULL, NULL),
(2021, 2, 1, 'GV', NULL, 'B', 4000, 15, 'QUW', 'WLNO', 06109, TRUE, TRUE, FALSE, FALSE, NULL, NULL, NULL), (2021, 2, 1, 'GV', NULL, 'B', 4000, 15, 'QUW', 'WLNO', 06109, TRUE, TRUE, FALSE, FALSE, NULL, NULL, NULL),
+1 -1
View File
@@ -66,7 +66,7 @@ INSERT INTO wb_kg (kgnr, glnr) VALUES
(15216, 2), (15216, 2),
(15224, 2); (15224, 2);
INSERT INTO member (mgnr, given_name, name, zwstid, volllieferant, buchführend, country, postal_dest, address, default_kgnr, iban, lfbis_nr, ustid_nr, org_auth_code) VALUES INSERT INTO member (mgnr, given_name, name, zwstid, full_delivery, accounting, country, postal_dest, address, default_kgnr, iban, lfbis_nr, ustid_nr, org_auth_code) VALUES
(101, 'Max', 'Mustermann', 'X', FALSE, FALSE, 40, 222303524, 'Winzerstraße 1', 06109, 'AT811234567890123457', '0123463', NULL , NULL ), (101, 'Max', 'Mustermann', 'X', FALSE, FALSE, 40, 222303524, 'Winzerstraße 1', 06109, 'AT811234567890123457', '0123463', NULL , NULL ),
(102, 'Wernhardt', 'Weinbauer', 'X', FALSE, FALSE, 40, 222303524, 'Winzerstraße 2', 06109, 'AT541234567890123458', '0123471', 'ATU12345684', NULL ), (102, 'Wernhardt', 'Weinbauer', 'X', FALSE, FALSE, 40, 222303524, 'Winzerstraße 2', 06109, 'AT541234567890123458', '0123471', 'ATU12345684', NULL ),
(103, 'Matthäus', 'Musterbauer', 'X', FALSE, FALSE, 40, 212005138, 'Brünner Straße 10', 15224, 'AT271234567890123459', '0123480', NULL , 'AT-BIO-302'), (103, 'Matthäus', 'Musterbauer', 'X', FALSE, FALSE, 40, 212005138, 'Brünner Straße 10', 15224, 'AT271234567890123459', '0123480', NULL , 'AT-BIO-302'),
+1 -1
View File
@@ -6,7 +6,7 @@ INSERT INTO wine_cultivation (cultid, name, description, organic) VALUES
INSERT INTO wine_attribute (attrid, name, active, max_kg_per_ha, strict, fill_lower) VALUES INSERT INTO wine_attribute (attrid, name, active, max_kg_per_ha, strict, fill_lower) VALUES
('K', 'Kabinett', TRUE, NULL, FALSE, 0); ('K', 'Kabinett', TRUE, NULL, FALSE, 0);
INSERT INTO member (mgnr, given_name, name, zwstid, volllieferant, buchführend, country, postal_dest, address, default_kgnr, iban, lfbis_nr, ustid_nr) VALUES INSERT INTO member (mgnr, given_name, name, zwstid, full_delivery, accounting, country, postal_dest, address, default_kgnr, iban, lfbis_nr, ustid_nr) VALUES
(201, 'Theodor', 'Testbauer', 'X', FALSE, FALSE, 40, 222303524, 'Teststraße 1', 06109, 'AT811234567890123457', '0123463', NULL ), (201, 'Theodor', 'Testbauer', 'X', FALSE, FALSE, 40, 222303524, 'Teststraße 1', 06109, 'AT811234567890123457', '0123463', NULL ),
(202, 'Thomas', 'Testmann', 'X', FALSE, FALSE, 40, 222303524, 'Teststraße 2', 06109, 'AT541234567890123458', '0123471', 'ATU12345684'), (202, 'Thomas', 'Testmann', 'X', FALSE, FALSE, 40, 222303524, 'Teststraße 2', 06109, 'AT541234567890123458', '0123471', 'ATU12345684'),
(203, 'Tina', 'Testwinzer', 'X', FALSE, FALSE, 40, 212005138, 'Teststraße 3', 15224, 'AT271234567890123459', '0123480', NULL ), (203, 'Tina', 'Testwinzer', 'X', FALSE, FALSE, 40, 212005138, 'Teststraße 3', 15224, 'AT271234567890123459', '0123480', NULL ),
+20 -20
View File
@@ -27,17 +27,17 @@ namespace Tests.UnitTests.HelperTests {
}; };
} }
private static void TestCalcOe(PaymentBillingData data, string bucket, double oe, decimal expected, string? qualid = null, bool geb = false) { private static void TestCalcOe(PaymentBillingData data, string bucket, double oe, decimal expected, string? qualid = null, bool ctrd = false) {
var (sortid, attrid, cultid) = GetSortIdAttrId(bucket); var (sortid, attrid, cultid) = GetSortIdAttrId(bucket);
var kmw = Utils.OeToKmw(oe); var kmw = Utils.OeToKmw(oe);
var v = data.CalculatePrice(sortid, attrid, cultid, qualid ?? GetQualId(kmw), geb, oe, kmw); var v = data.CalculatePrice(sortid, attrid, cultid, qualid ?? GetQualId(kmw), ctrd, oe, kmw);
Assert.That(Math.Round(v, 6), Is.EqualTo(expected)); Assert.That(Math.Round(v, 6), Is.EqualTo(expected));
} }
private static void TestCalcKmw(PaymentBillingData data, string bucket, double kmw, decimal expected, string? qualid = null, bool geb = false) { private static void TestCalcKmw(PaymentBillingData data, string bucket, double kmw, decimal expected, string? qualid = null, bool ctrd = false) {
var (sortid, attrid, cultid) = GetSortIdAttrId(bucket); var (sortid, attrid, cultid) = GetSortIdAttrId(bucket);
var oe = Utils.KmwToOe(kmw); var oe = Utils.KmwToOe(kmw);
var v = data.CalculatePrice(sortid, attrid, cultid, qualid ?? GetQualId(kmw), geb, oe, kmw); var v = data.CalculatePrice(sortid, attrid, cultid, qualid ?? GetQualId(kmw), ctrd, oe, kmw);
Assert.That(Math.Round(v, 6), Is.EqualTo(expected)); Assert.That(Math.Round(v, 6), Is.EqualTo(expected));
} }
@@ -84,11 +84,11 @@ namespace Tests.UnitTests.HelperTests {
TestCalcOe(data, "GV", 80, 0.85m); TestCalcOe(data, "GV", 80, 0.85m);
TestCalcOe(data, "GV", 83, 1.00m); TestCalcOe(data, "GV", 83, 1.00m);
TestCalcOe(data, "GV", 90, 1.00m); TestCalcOe(data, "GV", 90, 1.00m);
TestCalcOe(data, "GV", 73, 0.60m, geb: true); TestCalcOe(data, "GV", 73, 0.60m, ctrd: true);
TestCalcOe(data, "GV", 74, 0.65m, geb: true); TestCalcOe(data, "GV", 74, 0.65m, ctrd: true);
TestCalcOe(data, "GV", 80, 0.95m, geb: true); TestCalcOe(data, "GV", 80, 0.95m, ctrd: true);
TestCalcOe(data, "GV", 83, 1.10m, geb: true); TestCalcOe(data, "GV", 83, 1.10m, ctrd: true);
TestCalcOe(data, "GV", 90, 1.10m, geb: true); TestCalcOe(data, "GV", 90, 1.10m, ctrd: true);
} }
} }
@@ -298,7 +298,7 @@ namespace Tests.UnitTests.HelperTests {
"73oe": 0.5, "73oe": 0.5,
"17kmw": 0.6 "17kmw": 0.6
}, },
"geb": 0.1 "ctrd": 0.1
}, { }, {
"id": 2, "id": 2,
"mode": "kmw", "mode": "kmw",
@@ -306,7 +306,7 @@ namespace Tests.UnitTests.HelperTests {
"15kmw": 0.6, "15kmw": 0.6,
"17kmw": 0.7 "17kmw": 0.7
}, },
"geb": { "ctrd": {
"73oe": 0.65, "73oe": 0.65,
"17kmw": 0.80 "17kmw": 0.80
} }
@@ -318,21 +318,21 @@ namespace Tests.UnitTests.HelperTests {
TestCalcKmw(data, "GVS", 15.0, 0.50m); TestCalcKmw(data, "GVS", 15.0, 0.50m);
TestCalcKmw(data, "GVS", 16.0, 0.55m); TestCalcKmw(data, "GVS", 16.0, 0.55m);
TestCalcKmw(data, "GVS", 17.0, 0.60m); TestCalcKmw(data, "GVS", 17.0, 0.60m);
TestCalcKmw(data, "GVS", 15.0, 0.60m, geb: true); TestCalcKmw(data, "GVS", 15.0, 0.60m, ctrd: true);
TestCalcKmw(data, "GVS", 16.0, 0.65m, geb: true); TestCalcKmw(data, "GVS", 16.0, 0.65m, ctrd: true);
TestCalcKmw(data, "GVS", 17.0, 0.70m, geb: true); TestCalcKmw(data, "GVS", 17.0, 0.70m, ctrd: true);
TestCalcKmw(data, "GVK", 15.0, 0.60m); TestCalcKmw(data, "GVK", 15.0, 0.60m);
TestCalcKmw(data, "GVK", 16.0, 0.65m); TestCalcKmw(data, "GVK", 16.0, 0.65m);
TestCalcKmw(data, "GVK", 17.0, 0.70m); TestCalcKmw(data, "GVK", 17.0, 0.70m);
TestCalcKmw(data, "GVK", 15.0, 0.65m, geb: true); TestCalcKmw(data, "GVK", 15.0, 0.65m, ctrd: true);
TestCalcKmw(data, "GVK", 16.0, 0.725m, geb: true); TestCalcKmw(data, "GVK", 16.0, 0.725m, ctrd: true);
TestCalcKmw(data, "GVK", 17.0, 0.80m, geb: true); TestCalcKmw(data, "GVK", 17.0, 0.80m, ctrd: true);
TestCalcKmw(data, "WRS", 15.0, 0.70m); TestCalcKmw(data, "WRS", 15.0, 0.70m);
TestCalcKmw(data, "WRS", 16.0, 0.75m); TestCalcKmw(data, "WRS", 16.0, 0.75m);
TestCalcKmw(data, "WRS", 17.0, 0.80m); TestCalcKmw(data, "WRS", 17.0, 0.80m);
TestCalcKmw(data, "WRS", 15.0, 0.80m, geb: true); TestCalcKmw(data, "WRS", 15.0, 0.80m, ctrd: true);
TestCalcKmw(data, "WRS", 16.0, 0.875m, geb: true); TestCalcKmw(data, "WRS", 16.0, 0.875m, ctrd: true);
TestCalcKmw(data, "WRS", 17.0, 0.95m, geb: true); TestCalcKmw(data, "WRS", 17.0, 0.95m, ctrd: true);
} }
} }
+26 -26
View File
@@ -11,12 +11,12 @@ namespace Tests.UnitTests.HelperTests {
private const int MgNr1 = 101, MgNr2 = 102, MgNr3 = 103, MgNr4 = 104; private const int MgNr1 = 101, MgNr2 = 102, MgNr3 = 103, MgNr4 = 104;
private const decimal private const decimal
GV_ungeb = 0.50m, GV_unctrd = 0.50m,
GV_geb = 0.60m, GV_ctrd = 0.60m,
GVB_ungeb = 0.54m, GVB_unctrd = 0.54m,
GVB_geb = 0.64m, GVB_ctrd = 0.64m,
GVK_ungeb = 0.61m, GVK_unctrd = 0.61m,
GVK_geb = 0.71m, GVK_ctrd = 0.71m,
WEI = 0.10m; WEI = 0.10m;
private SqliteConnection? Connection; private SqliteConnection? Connection;
@@ -56,12 +56,12 @@ namespace Tests.UnitTests.HelperTests {
"id": 1, "id": 1,
"mode": "oe", "mode": "oe",
"data": {"15kmw": 0.54}, "data": {"15kmw": 0.54},
"geb": 0.1 "ctrd": 0.1
}, { }, {
"id": 2, "id": 2,
"mode": "oe", "mode": "oe",
"data": {"15kmw": 0.61}, "data": {"15kmw": 0.61},
"geb": 0.1 "ctrd": 0.1
}] }]
} }
"""; """;
@@ -148,17 +148,17 @@ namespace Tests.UnitTests.HelperTests {
using (Assert.EnterMultipleScope()) { using (Assert.EnterMultipleScope()) {
Assert.That(prices, Has.Count.EqualTo(6)); Assert.That(prices, Has.Count.EqualTo(6));
// Kabinett // Kabinett
Assert.That(prices[("20201001X001/1", "GV_")], Is.EqualTo((4_000, GV_ungeb))); Assert.That(prices[("20201001X001/1", "GV_")], Is.EqualTo((4_000, GV_unctrd)));
// ohne Attribut // ohne Attribut
Assert.That(prices[("20201001X001/2", "GV_")], Is.EqualTo((4_000, GV_ungeb))); Assert.That(prices[("20201001X001/2", "GV_")], Is.EqualTo((4_000, GV_unctrd)));
// Bio // Bio
Assert.That(prices[("20201001X002/1", "GV_")], Is.EqualTo((4_000, GVB_ungeb))); Assert.That(prices[("20201001X002/1", "GV_")], Is.EqualTo((4_000, GVB_unctrd)));
// Bio // Bio
Assert.That(prices[("20201001X002/2", "GV_")], Is.EqualTo((4_000, GVB_ungeb))); Assert.That(prices[("20201001X002/2", "GV_")], Is.EqualTo((4_000, GVB_unctrd)));
// ohne Attribut // ohne Attribut
Assert.That(prices[("20201001X003/1", "GV_")], Is.EqualTo(( 500, WEI))); Assert.That(prices[("20201001X003/1", "GV_")], Is.EqualTo(( 500, WEI)));
// ohne Attribut // ohne Attribut
Assert.That(prices[("20201001X003/2", "GV_")], Is.EqualTo(( 500, GV_ungeb))); Assert.That(prices[("20201001X003/2", "GV_")], Is.EqualTo(( 500, GV_unctrd)));
} }
} }
@@ -193,23 +193,23 @@ namespace Tests.UnitTests.HelperTests {
using (Assert.EnterMultipleScope()) { using (Assert.EnterMultipleScope()) {
Assert.That(prices, Has.Count.EqualTo(7)); Assert.That(prices, Has.Count.EqualTo(7));
// Kabinett // Kabinett
Assert.That(prices[("20211001X001/1", "GV")] , Is.EqualTo((4_000, GV_geb))); Assert.That(prices[("20211001X001/1", "GV")] , Is.EqualTo((4_000, GV_ctrd)));
// ohne Attribut // ohne Attribut
Assert.That(prices[("20211001X001/2", "GV")], Is.EqualTo((4_000, GV_geb))); Assert.That(prices[("20211001X001/2", "GV")], Is.EqualTo((4_000, GV_ctrd)));
// Bio // Bio
Assert.That(prices[("20211001X002/1", "GV_")], Is.EqualTo((4_000, GVB_ungeb))); Assert.That(prices[("20211001X002/1", "GV_")], Is.EqualTo((4_000, GVB_unctrd)));
// Bio // Bio
Assert.That(prices[("20211001X002/2", "GV_")], Is.EqualTo((2_000, GVB_ungeb))); Assert.That(prices[("20211001X002/2", "GV_")], Is.EqualTo((2_000, GVB_unctrd)));
Assert.That(prices[("20211001X002/2", "GV")], Is.EqualTo((2_000, GVB_geb))); Assert.That(prices[("20211001X002/2", "GV")], Is.EqualTo((2_000, GVB_ctrd)));
// ohne Attribut // ohne Attribut
Assert.That(prices[("20211001X003/1", "GV_")], Is.EqualTo(( 500, WEI))); Assert.That(prices[("20211001X003/1", "GV_")], Is.EqualTo(( 500, WEI)));
// ohne Attribut // ohne Attribut
Assert.That(prices[("20211001X003/2", "GV_")], Is.EqualTo(( 500, GV_ungeb))); Assert.That(prices[("20211001X003/2", "GV_")], Is.EqualTo(( 500, GV_unctrd)));
} }
} }
[Test] [Test]
public async Task Test_03_SimpleNotStrictAreaComs_HonorGebunden() { public async Task Test_03_SimpleNotStrictAreaComs_HonorContracted() {
int mgnr = MgNr1, year = Year2; int mgnr = MgNr1, year = Year2;
var areaCom = await GetMemberAreaCommitmentBuckets(year, mgnr); var areaCom = await GetMemberAreaCommitmentBuckets(year, mgnr);
@@ -239,17 +239,17 @@ namespace Tests.UnitTests.HelperTests {
using (Assert.EnterMultipleScope()) { using (Assert.EnterMultipleScope()) {
Assert.That(prices, Has.Count.EqualTo(6)); Assert.That(prices, Has.Count.EqualTo(6));
// Kabinett // Kabinett
Assert.That(prices[("20211001X001/1", "GV")], Is.EqualTo((4_000, GV_geb))); Assert.That(prices[("20211001X001/1", "GV")], Is.EqualTo((4_000, GV_ctrd)));
// ohne Attribut // ohne Attribut
Assert.That(prices[("20211001X001/2", "GV_")], Is.EqualTo((4_000, GV_ungeb))); Assert.That(prices[("20211001X001/2", "GV_")], Is.EqualTo((4_000, GV_unctrd)));
// Bio // Bio
Assert.That(prices[("20211001X002/1", "GV")], Is.EqualTo((4_000, GVB_geb))); Assert.That(prices[("20211001X002/1", "GV")], Is.EqualTo((4_000, GVB_ctrd)));
// Bio // Bio
Assert.That(prices[("20211001X002/2", "GV_")], Is.EqualTo((4_000, GVB_ungeb))); Assert.That(prices[("20211001X002/2", "GV_")], Is.EqualTo((4_000, GVB_unctrd)));
// ohne Attribut // ohne Attribut
Assert.That(prices[("20211001X003/1", "GV_")], Is.EqualTo(( 500, WEI))); Assert.That(prices[("20211001X003/1", "GV_")], Is.EqualTo(( 500, WEI)));
// ohne Attribut // ohne Attribut
Assert.That(prices[("20211001X003/2", "GV_")], Is.EqualTo(( 500, GV_ungeb))); Assert.That(prices[("20211001X003/2", "GV_")], Is.EqualTo(( 500, GV_unctrd)));
} }
} }
@@ -262,7 +262,7 @@ namespace Tests.UnitTests.HelperTests {
[Test] [Test]
[Ignore("Not implemented yet")] [Ignore("Not implemented yet")]
public Task Test_05_ComplexNotStrictAreaComs_HonorGebunden() { public Task Test_05_ComplexNotStrictAreaComs_HonorContracted() {
// TODO // TODO
return Task.CompletedTask; return Task.CompletedTask;
} }
@@ -93,7 +93,7 @@ namespace Tests.UnitTests.ServiceTests {
vm.UstIdNr = "ATU12345693"; vm.UstIdNr = "ATU12345693";
vm.LfbisNr = "0123498"; vm.LfbisNr = "0123498";
vm.IsBuchführend = true; vm.IsAccounting = true;
vm.IsOrganic = true; vm.IsOrganic = true;
vm.BillingName = "Neue Holding AG"; vm.BillingName = "Neue Holding AG";
@@ -107,8 +107,8 @@ namespace Tests.UnitTests.ServiceTests {
vm.Comment = "Ich bin eine Anmerkung"; vm.Comment = "Ich bin eine Anmerkung";
vm.ContactViaPost = true; vm.ContactViaPost = true;
vm.ContactViaEmail = true; vm.ContactViaEmail = true;
vm.IsVollLieferant = true; vm.IsFullDelivery = true;
vm.IsFunktionär = true; vm.IsOfficer = true;
using (var ctx = new AppDbContext()) { using (var ctx = new AppDbContext()) {
Assert.That(await ctx.FetchMembers(999).SingleOrDefaultAsync(), Is.Null); Assert.That(await ctx.FetchMembers(999).SingleOrDefaultAsync(), Is.Null);
@@ -146,7 +146,7 @@ namespace Tests.UnitTests.ServiceTests {
Assert.That(m.UstIdNr, Is.EqualTo("ATU12345693")); Assert.That(m.UstIdNr, Is.EqualTo("ATU12345693"));
Assert.That(m.LfbisNr, Is.EqualTo("0123498")); Assert.That(m.LfbisNr, Is.EqualTo("0123498"));
Assert.That(m.IsBuchführend, Is.True); Assert.That(m.IsAccounting, Is.True);
Assert.That(m.IsOrganic, Is.True); Assert.That(m.IsOrganic, Is.True);
Assert.That(m.BillingAddress, Is.Not.Null); Assert.That(m.BillingAddress, Is.Not.Null);
@@ -161,8 +161,8 @@ namespace Tests.UnitTests.ServiceTests {
Assert.That(m.Comment, Is.EqualTo("Ich bin eine Anmerkung")); Assert.That(m.Comment, Is.EqualTo("Ich bin eine Anmerkung"));
Assert.That(m.ContactViaPost, Is.True); Assert.That(m.ContactViaPost, Is.True);
Assert.That(m.ContactViaEmail, Is.True); Assert.That(m.ContactViaEmail, Is.True);
Assert.That(m.IsVollLieferant, Is.True); Assert.That(m.IsFullDelivery, Is.True);
Assert.That(m.IsFunktionär, Is.True); Assert.That(m.IsOfficer, Is.True);
} }
vm = new MemberAdminViewModel(); vm = new MemberAdminViewModel();
@@ -194,7 +194,7 @@ namespace Tests.UnitTests.ServiceTests {
Assert.That(vm.UstIdNr, Is.EqualTo("ATU12345693")); Assert.That(vm.UstIdNr, Is.EqualTo("ATU12345693"));
Assert.That(vm.LfbisNr, Is.EqualTo("0123498")); Assert.That(vm.LfbisNr, Is.EqualTo("0123498"));
Assert.That(vm.IsBuchführend, Is.True); Assert.That(vm.IsAccounting, Is.True);
Assert.That(vm.IsOrganic, Is.True); Assert.That(vm.IsOrganic, Is.True);
Assert.That(vm.BillingName, Is.EqualTo("Neue Holding AG")); Assert.That(vm.BillingName, Is.EqualTo("Neue Holding AG"));
@@ -208,8 +208,8 @@ namespace Tests.UnitTests.ServiceTests {
Assert.That(vm.Comment, Is.EqualTo("Ich bin eine Anmerkung")); Assert.That(vm.Comment, Is.EqualTo("Ich bin eine Anmerkung"));
Assert.That(vm.ContactViaPost, Is.True); Assert.That(vm.ContactViaPost, Is.True);
Assert.That(vm.ContactViaEmail, Is.True); Assert.That(vm.ContactViaEmail, Is.True);
Assert.That(vm.IsVollLieferant, Is.True); Assert.That(vm.IsFullDelivery, Is.True);
Assert.That(vm.IsFunktionär, Is.True); Assert.That(vm.IsOfficer, Is.True);
} }
} }