Elwig: Rename buchführend, funktionär, volllieferant, and gebunden
This commit is contained in:
@@ -7,7 +7,7 @@ namespace Elwig.Helpers.Billing {
|
||||
public class GraphEntry {
|
||||
|
||||
public const int MinX = 50;
|
||||
public const int MinXGeb = 73;
|
||||
public const int MinXCtrd = 73;
|
||||
public const int MaxX = 120;
|
||||
|
||||
public int Id { get; set; }
|
||||
@@ -15,11 +15,11 @@ namespace Elwig.Helpers.Billing {
|
||||
public bool Abgewertet { get; set; }
|
||||
|
||||
public Graph DataGraph { get; set; }
|
||||
public Graph? GebundenGraph { get; set; }
|
||||
public double? GebundenFlatBonus {
|
||||
public Graph? ContractedGraph { get; set; }
|
||||
public double? ContractedFlatBonus {
|
||||
get {
|
||||
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))
|
||||
.Distinct()
|
||||
.Single();
|
||||
@@ -30,10 +30,10 @@ namespace Elwig.Helpers.Billing {
|
||||
}
|
||||
set {
|
||||
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))
|
||||
.ToArray();
|
||||
GebundenGraph = new Graph(values, Precision, MinXGeb, MaxX);
|
||||
ContractedGraph = new Graph(values, Precision, MinXCtrd, MaxX);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,39 +52,39 @@ namespace Elwig.Helpers.Billing {
|
||||
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) {
|
||||
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) :
|
||||
this(id, precision, curve.Mode) {
|
||||
DataGraph = new Graph(curve.Normal, precision, MinX, MaxX);
|
||||
if (curve.Gebunden != null)
|
||||
GebundenGraph = new Graph(curve.Gebunden, precision, MinXGeb, MaxX);
|
||||
if (curve.Contracted != null)
|
||||
ContractedGraph = new Graph(curve.Contracted, precision, MinXCtrd, MaxX);
|
||||
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;
|
||||
Precision = precision;
|
||||
Mode = mode;
|
||||
DataGraph = dataGraph;
|
||||
GebundenGraph = gebundenGraph;
|
||||
ContractedGraph = contractedGraph;
|
||||
Vaributes = vaributes;
|
||||
}
|
||||
|
||||
public void AddGebundenGraph() {
|
||||
GebundenGraph ??= new Graph(Precision, MinXGeb, MaxX);
|
||||
public void AddContractedGraph() {
|
||||
ContractedGraph ??= new Graph(Precision, MinXCtrd, MaxX);
|
||||
}
|
||||
|
||||
public void RemoveGebundenGraph() {
|
||||
GebundenGraph = null;
|
||||
public void RemoveContractedGraph() {
|
||||
ContractedGraph = null;
|
||||
}
|
||||
|
||||
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(), []);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user