Billing: Include all deliveries when calculating under delivery for area commitments
All checks were successful
Test / Run tests (push) Successful in 1m43s
All checks were successful
Test / Run tests (push) Successful in 1m43s
This commit is contained in:
@ -81,11 +81,11 @@ namespace Elwig.Documents {
|
||||
}
|
||||
|
||||
private static string FormatRow(
|
||||
int obligation, int right, int delivery, int? payment = null, int? area = null,
|
||||
int obligation, int right, int delivery, int? totalDelivery = null, int? payment = null, int? area = null,
|
||||
bool isGa = false, bool showPayment = false, bool showArea = false
|
||||
) {
|
||||
totalDelivery ??= delivery;
|
||||
payment ??= delivery;
|
||||
var baseline = showPayment ? payment : delivery;
|
||||
|
||||
if (showArea) {
|
||||
return $"<td>{(area == null ? "" : $"{area:N0}")}</td>" +
|
||||
@ -95,15 +95,15 @@ namespace Elwig.Documents {
|
||||
|
||||
return $"<td>{(obligation == 0 ? "-" : $"{obligation:N0}")}</td>" +
|
||||
$"<td>{(right == 0 ? "-" : $"{right:N0}")}</td>" +
|
||||
$"<td>{(baseline < obligation ? $"<b>{obligation - baseline:N0}</b>" : "-")}</td>" +
|
||||
$"<td>{(baseline >= obligation && delivery <= right ? $"{right - delivery:N0}" : "-")}</td>" +
|
||||
$"<td>{(totalDelivery < obligation ? $"<b>{obligation - totalDelivery:N0}</b>" : "-")}</td>" +
|
||||
$"<td>{(delivery <= right ? $"{right - delivery:N0}" : "-")}</td>" +
|
||||
$"<td>{(obligation == 0 && right == 0 ? "-" : (delivery > right ? ((isGa ? "<b>" : "") + $"{delivery - right:N0}" + (isGa ? "</b>" : "")) : "-"))}</td>" +
|
||||
(showPayment ? $"<td>{(isGa ? "" : obligation == 0 && right == 0 ? "-" : $"{payment:N0}")}</td>" : "") +
|
||||
$"<td>{delivery:N0}</td>";
|
||||
$"<td>{totalDelivery:N0}</td>";
|
||||
}
|
||||
|
||||
private static string FormatRow(MemberBucket bucket, bool isGa = false, bool showPayment = false, bool showArea = false) {
|
||||
return FormatRow(bucket.Obligation, bucket.Right, bucket.Delivery, bucket.Payment, bucket.Area, isGa, showPayment, showArea);
|
||||
return FormatRow(bucket.Obligation, bucket.Right, bucket.Delivery, bucket.DeliveryTotal, bucket.Payment, bucket.Area, isGa, showPayment, showArea);
|
||||
}
|
||||
|
||||
public string PrintBucketTable(
|
||||
|
Reference in New Issue
Block a user