Billing: Fix BIO billing and update method parameters
This commit is contained in:
@ -18,14 +18,10 @@ namespace Elwig.Helpers.Billing {
|
||||
Data = PaymentBillingData.FromJson(PaymentVariant.Data, Utils.GetVaributes(Context, Year, onlyDelivered: false));
|
||||
}
|
||||
|
||||
public async Task Calculate() {
|
||||
public async Task Calculate(bool? honorGebunden = null, bool ? allowAttrsIntoLower = null, bool? avoidUnderDeliveries = null) {
|
||||
using var cnx = await AppDbContext.ConnectAsync();
|
||||
using var tx = await cnx.BeginTransactionAsync();
|
||||
await CalculateBuckets(
|
||||
Season.Billing_AllowAttrsIntoLower,
|
||||
Season.Billing_AvoidUnderDeliveries,
|
||||
Season.Billing_HonorGebunden,
|
||||
cnx);
|
||||
await CalculateBuckets(honorGebunden, allowAttrsIntoLower, avoidUnderDeliveries, cnx);
|
||||
await DeleteInDb(cnx);
|
||||
await SetCalcTime(cnx);
|
||||
await CalculatePrices(cnx);
|
||||
@ -149,8 +145,9 @@ namespace Elwig.Helpers.Billing {
|
||||
foreach (var part in parts) {
|
||||
var ungeb = part.Discr == "_";
|
||||
var payAttrId = (part.Discr is "" or "_") ? null : part.Discr;
|
||||
var geb = !ungeb && payAttrId == part.AttrId;
|
||||
var price = Data.CalculatePrice(part.SortId, part.AttrId, part.QualId, geb, part.Oe, part.Kmw);
|
||||
var attrId = part.AttrId == "B" ? "B" : payAttrId; // FIXME
|
||||
var geb = !ungeb; // FIXME && payAttrId == part.AttrId;
|
||||
var price = Data.CalculatePrice(part.SortId, attrId, part.QualId, geb, part.Oe, part.Kmw);
|
||||
var priceL = PaymentVariant.Season.DecToDb(price);
|
||||
inserts.Add((part.Year, part.DId, part.DPNr, part.BktNr, priceL, priceL * part.Value));
|
||||
}
|
||||
|
Reference in New Issue
Block a user