Elwig: Rename buchführend, funktionär, volllieferant, and gebunden
This commit is contained in:
@@ -14,7 +14,7 @@ namespace Elwig.Helpers.Billing {
|
||||
|
||||
public enum CalculationMode { Elwig, WgMaster }
|
||||
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; }
|
||||
|
||||
@@ -179,10 +179,10 @@ namespace Elwig.Helpers.Billing {
|
||||
} else {
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
var geb = obj["geb"];
|
||||
if (geb is JsonObject) {
|
||||
c2 = GetCurveData(geb.AsObject(), cMode);
|
||||
} else if (geb?.AsValue().TryGetValue(out decimal v) == true) {
|
||||
var ctrd = obj["ctrd"] ?? obj["geb"];
|
||||
if (ctrd is JsonObject) {
|
||||
c2 = GetCurveData(ctrd.AsObject(), cMode);
|
||||
} else if (ctrd?.AsValue().TryGetValue(out decimal v) == true) {
|
||||
var splitVal = GetCurveValueAt(c1, quw);
|
||||
c2 = c1.ToDictionary(e => e.Key, e => e.Value + (e.Key >= quw ? v : 0));
|
||||
c2[quw] = splitVal + v;
|
||||
@@ -274,7 +274,7 @@ namespace Elwig.Helpers.Billing {
|
||||
|
||||
protected static JsonNode GraphEntryToJson(GraphEntry entry) {
|
||||
try {
|
||||
if (entry.GebundenFlatBonus == null) {
|
||||
if (entry.ContractedFlatBonus == null) {
|
||||
return JsonValue.Create((decimal)entry.DataGraph.DataY.Distinct().Single());
|
||||
}
|
||||
} catch { }
|
||||
@@ -286,10 +286,10 @@ namespace Elwig.Helpers.Billing {
|
||||
|
||||
curve["data"] = GraphToJson(entry.DataGraph, entry.Mode.ToString().ToLower());
|
||||
|
||||
if (entry.GebundenFlatBonus != null) {
|
||||
curve["geb"] = (decimal)entry.GebundenFlatBonus;
|
||||
} else if (entry.GebundenGraph != null) {
|
||||
curve["geb"] = GraphToJson(entry.GebundenGraph, entry.Mode.ToString().ToLower());
|
||||
if (entry.ContractedFlatBonus != null) {
|
||||
curve["ctrd"] = (decimal)entry.ContractedFlatBonus;
|
||||
} else if (entry.ContractedGraph != null) {
|
||||
curve["ctrd"] = GraphToJson(entry.ContractedGraph, entry.Mode.ToString().ToLower());
|
||||
}
|
||||
|
||||
return curve;
|
||||
|
||||
Reference in New Issue
Block a user