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
+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 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));
}
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 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));
}
@@ -84,11 +84,11 @@ namespace Tests.UnitTests.HelperTests {
TestCalcOe(data, "GV", 80, 0.85m);
TestCalcOe(data, "GV", 83, 1.00m);
TestCalcOe(data, "GV", 90, 1.00m);
TestCalcOe(data, "GV", 73, 0.60m, geb: true);
TestCalcOe(data, "GV", 74, 0.65m, geb: true);
TestCalcOe(data, "GV", 80, 0.95m, geb: true);
TestCalcOe(data, "GV", 83, 1.10m, geb: true);
TestCalcOe(data, "GV", 90, 1.10m, geb: true);
TestCalcOe(data, "GV", 73, 0.60m, ctrd: true);
TestCalcOe(data, "GV", 74, 0.65m, ctrd: true);
TestCalcOe(data, "GV", 80, 0.95m, ctrd: true);
TestCalcOe(data, "GV", 83, 1.10m, ctrd: true);
TestCalcOe(data, "GV", 90, 1.10m, ctrd: true);
}
}
@@ -298,7 +298,7 @@ namespace Tests.UnitTests.HelperTests {
"73oe": 0.5,
"17kmw": 0.6
},
"geb": 0.1
"ctrd": 0.1
}, {
"id": 2,
"mode": "kmw",
@@ -306,7 +306,7 @@ namespace Tests.UnitTests.HelperTests {
"15kmw": 0.6,
"17kmw": 0.7
},
"geb": {
"ctrd": {
"73oe": 0.65,
"17kmw": 0.80
}
@@ -318,21 +318,21 @@ namespace Tests.UnitTests.HelperTests {
TestCalcKmw(data, "GVS", 15.0, 0.50m);
TestCalcKmw(data, "GVS", 16.0, 0.55m);
TestCalcKmw(data, "GVS", 17.0, 0.60m);
TestCalcKmw(data, "GVS", 15.0, 0.60m, geb: true);
TestCalcKmw(data, "GVS", 16.0, 0.65m, geb: true);
TestCalcKmw(data, "GVS", 17.0, 0.70m, geb: true);
TestCalcKmw(data, "GVS", 15.0, 0.60m, ctrd: true);
TestCalcKmw(data, "GVS", 16.0, 0.65m, ctrd: true);
TestCalcKmw(data, "GVS", 17.0, 0.70m, ctrd: true);
TestCalcKmw(data, "GVK", 15.0, 0.60m);
TestCalcKmw(data, "GVK", 16.0, 0.65m);
TestCalcKmw(data, "GVK", 17.0, 0.70m);
TestCalcKmw(data, "GVK", 15.0, 0.65m, geb: true);
TestCalcKmw(data, "GVK", 16.0, 0.725m, geb: true);
TestCalcKmw(data, "GVK", 17.0, 0.80m, geb: true);
TestCalcKmw(data, "GVK", 15.0, 0.65m, ctrd: true);
TestCalcKmw(data, "GVK", 16.0, 0.725m, ctrd: true);
TestCalcKmw(data, "GVK", 17.0, 0.80m, ctrd: true);
TestCalcKmw(data, "WRS", 15.0, 0.70m);
TestCalcKmw(data, "WRS", 16.0, 0.75m);
TestCalcKmw(data, "WRS", 17.0, 0.80m);
TestCalcKmw(data, "WRS", 15.0, 0.80m, geb: true);
TestCalcKmw(data, "WRS", 16.0, 0.875m, geb: true);
TestCalcKmw(data, "WRS", 17.0, 0.95m, geb: true);
TestCalcKmw(data, "WRS", 15.0, 0.80m, ctrd: true);
TestCalcKmw(data, "WRS", 16.0, 0.875m, ctrd: 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 decimal
GV_ungeb = 0.50m,
GV_geb = 0.60m,
GVB_ungeb = 0.54m,
GVB_geb = 0.64m,
GVK_ungeb = 0.61m,
GVK_geb = 0.71m,
GV_unctrd = 0.50m,
GV_ctrd = 0.60m,
GVB_unctrd = 0.54m,
GVB_ctrd = 0.64m,
GVK_unctrd = 0.61m,
GVK_ctrd = 0.71m,
WEI = 0.10m;
private SqliteConnection? Connection;
@@ -56,12 +56,12 @@ namespace Tests.UnitTests.HelperTests {
"id": 1,
"mode": "oe",
"data": {"15kmw": 0.54},
"geb": 0.1
"ctrd": 0.1
}, {
"id": 2,
"mode": "oe",
"data": {"15kmw": 0.61},
"geb": 0.1
"ctrd": 0.1
}]
}
""";
@@ -148,17 +148,17 @@ namespace Tests.UnitTests.HelperTests {
using (Assert.EnterMultipleScope()) {
Assert.That(prices, Has.Count.EqualTo(6));
// 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
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
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
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
Assert.That(prices[("20201001X003/1", "GV_")], Is.EqualTo(( 500, WEI)));
// 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()) {
Assert.That(prices, Has.Count.EqualTo(7));
// 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
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
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
Assert.That(prices[("20211001X002/2", "GV_")], Is.EqualTo((2_000, GVB_ungeb)));
Assert.That(prices[("20211001X002/2", "GV")], Is.EqualTo((2_000, GVB_geb)));
Assert.That(prices[("20211001X002/2", "GV_")], Is.EqualTo((2_000, GVB_unctrd)));
Assert.That(prices[("20211001X002/2", "GV")], Is.EqualTo((2_000, GVB_ctrd)));
// ohne Attribut
Assert.That(prices[("20211001X003/1", "GV_")], Is.EqualTo(( 500, WEI)));
// 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]
public async Task Test_03_SimpleNotStrictAreaComs_HonorGebunden() {
public async Task Test_03_SimpleNotStrictAreaComs_HonorContracted() {
int mgnr = MgNr1, year = Year2;
var areaCom = await GetMemberAreaCommitmentBuckets(year, mgnr);
@@ -239,17 +239,17 @@ namespace Tests.UnitTests.HelperTests {
using (Assert.EnterMultipleScope()) {
Assert.That(prices, Has.Count.EqualTo(6));
// 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
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
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
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
Assert.That(prices[("20211001X003/1", "GV_")], Is.EqualTo(( 500, WEI)));
// 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]
[Ignore("Not implemented yet")]
public Task Test_05_ComplexNotStrictAreaComs_HonorGebunden() {
public Task Test_05_ComplexNotStrictAreaComs_HonorContracted() {
// TODO
return Task.CompletedTask;
}
@@ -93,7 +93,7 @@ namespace Tests.UnitTests.ServiceTests {
vm.UstIdNr = "ATU12345693";
vm.LfbisNr = "0123498";
vm.IsBuchführend = true;
vm.IsAccounting = true;
vm.IsOrganic = true;
vm.BillingName = "Neue Holding AG";
@@ -107,8 +107,8 @@ namespace Tests.UnitTests.ServiceTests {
vm.Comment = "Ich bin eine Anmerkung";
vm.ContactViaPost = true;
vm.ContactViaEmail = true;
vm.IsVollLieferant = true;
vm.IsFunktionär = true;
vm.IsFullDelivery = true;
vm.IsOfficer = true;
using (var ctx = new AppDbContext()) {
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.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.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.ContactViaPost, Is.True);
Assert.That(m.ContactViaEmail, Is.True);
Assert.That(m.IsVollLieferant, Is.True);
Assert.That(m.IsFunktionär, Is.True);
Assert.That(m.IsFullDelivery, Is.True);
Assert.That(m.IsOfficer, Is.True);
}
vm = new MemberAdminViewModel();
@@ -194,7 +194,7 @@ namespace Tests.UnitTests.ServiceTests {
Assert.That(vm.UstIdNr, Is.EqualTo("ATU12345693"));
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.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.ContactViaPost, Is.True);
Assert.That(vm.ContactViaEmail, Is.True);
Assert.That(vm.IsVollLieferant, Is.True);
Assert.That(vm.IsFunktionär, Is.True);
Assert.That(vm.IsFullDelivery, Is.True);
Assert.That(vm.IsOfficer, Is.True);
}
}