docs: close M8 with treasury wiki, screenshots and screen fixes (#69 #70 #71 #72 #73)
CI / Build and test (SQLite) (pull_request) Successful in 3m51s
CI / PostgreSQL 16 integration (pull_request) Skipped
CI / PostgreSQL 17 integration (pull_request) Skipped
CI / YAML check (pull_request) Successful in 5s
CI / Docker image (pull_request) Successful in 1m22s
CI / Build and test (SQLite) (pull_request) Successful in 3m51s
CI / PostgreSQL 16 integration (pull_request) Skipped
CI / PostgreSQL 17 integration (pull_request) Skipped
CI / YAML check (pull_request) Successful in 5s
CI / Docker image (pull_request) Successful in 1m22s
Rewrite the Scadenzario wiki page from the real screens and services, add ADR 0038, the 0.8.0 changelog, STATUS, MODULES and the regenerated data model, and update the pages that still pointed to M8. The browser check found a few screen defects, fixed here: reminder channels are flags, so they show as "e-mail + PEC" and are edited with check boxes; icon buttons in grids stay on one row; the summary strip no longer collapses on long pages; the customers/suppliers switch uses the right style; the cash flow bars scale between the lowest and highest balance. The late payment rate of the second half of 2026 is 2.40 (MEF, GU 163 of 16 July 2026), now covered by tests, and the mapping test knows the ten treasury tables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
aef0a0d233
commit
f38b5894ce
44 files changed
+834
-169
No files matched your search
@@ -25,7 +25,7 @@ public sealed class LatePaymentRulesIt : ILatePaymentRules
|
||||
(new DateOnly(2025, 1, 1), 3.15m),
|
||||
(new DateOnly(2025, 7, 1), 2.15m),
|
||||
(new DateOnly(2026, 1, 1), 2.15m),
|
||||
(new DateOnly(2026, 7, 1), 2.15m),
|
||||
(new DateOnly(2026, 7, 1), 2.40m),
|
||||
];
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -52,10 +52,9 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@{ var scale = Math.Max(1m, f.Periods.Select(p => Math.Abs(p.Balance)).DefaultIfEmpty(0m).Max()); }
|
||||
@foreach (var p in f.Periods)
|
||||
{
|
||||
var width = (int)Math.Round(Math.Abs(p.Balance) / scale * 100m);
|
||||
var width = BarWidth(f, p.Balance);
|
||||
<tr>
|
||||
<td>@T.Date(p.From) – @T.Date(p.To)</td>
|
||||
<td class="num pos">@(p.In != 0m ? T.Money(p.In) : null)</td>
|
||||
@@ -148,6 +147,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The length of the bar of a balance, between the lowest and the highest of the forecast: the balances change little
|
||||
/// against the money in the bank, so bars from zero would all look the same.
|
||||
/// </summary>
|
||||
private static int BarWidth(CashFlowForecast forecast, decimal balance)
|
||||
{
|
||||
var low = Math.Min(forecast.Opening, forecast.Periods.Min(p => p.Balance));
|
||||
var high = Math.Max(forecast.Opening, forecast.Periods.Max(p => p.Balance));
|
||||
return high == low ? 100 : (int)Math.Round(10m + ((balance - low) / (high - low) * 90m));
|
||||
}
|
||||
|
||||
private IReadOnlyList<KhStat> Stats(CashFlowForecast f, decimal lowest) =>
|
||||
[
|
||||
new(T["Treasury.CashFlow.Today"], T.Money(f.Opening)),
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
<KhBadge Tone="KhTone.Neutral">@T["Treasury.Dunning.Waiting"]</KhBadge>
|
||||
}
|
||||
</td>
|
||||
<td>@(p.Level is { } l ? T[TreasuryScreens.EnumKey(l.Channel)] : "—") <span class="muted sm">@(p.Pec ?? p.Email)</span></td>
|
||||
<td>@(p.Level is { } l ? TreasuryScreens.ChannelText(T, l.Channel) : "—") <span class="muted sm">@(p.Pec ?? p.Email)</span></td>
|
||||
<td class="num">@T.Money(p.Interest)</td>
|
||||
<td>
|
||||
@if (p.Level is not null)
|
||||
@@ -124,11 +124,11 @@
|
||||
<td>@level.Level</td>
|
||||
<td class="num">@level.DaysAfterDue</td>
|
||||
<td>@level.Name</td>
|
||||
<td>@T[TreasuryScreens.EnumKey(level.Channel)]</td>
|
||||
<td>@TreasuryScreens.ChannelText(T, level.Channel)</td>
|
||||
<td>@T[level.ChargeInterest ? "Treasury.Dunning.InterestYes" : "Treasury.Dunning.InterestNo"]</td>
|
||||
<td>@T[TreasuryScreens.EnumKey(level.Action)]</td>
|
||||
<td>@T[level.Automatic ? "Common.Yes" : "Common.No"]</td>
|
||||
<td class="num">
|
||||
<td class="kh-acts">
|
||||
@if (CanWrite)
|
||||
{
|
||||
<KhIconButton Icon="edit" Text="@T["Treasury.Dunning.EditLevel"]" OnClick="() => OpenLevel(level)" />
|
||||
@@ -173,7 +173,7 @@
|
||||
<td>@T.Date(l.SentOn)</td>
|
||||
<td>@row.PartyName</td>
|
||||
<td>@l.Level</td>
|
||||
<td>@T[TreasuryScreens.EnumKey(l.Channel)]</td>
|
||||
<td>@TreasuryScreens.ChannelText(T, l.Channel)</td>
|
||||
<td class="sm">@l.Recipients</td>
|
||||
<td class="num">@l.ItemCount</td>
|
||||
<td class="num">@T.Money(l.OverdueAmount)</td>
|
||||
@@ -193,12 +193,14 @@
|
||||
@if (_level is { } level)
|
||||
{
|
||||
<div class="form plain">
|
||||
<KhTextBox Label="@T["Treasury.Dunning.Template"]" Name="lname" @bind-Value="level.Name" MaxLength="60" Span="6" Required="true" />
|
||||
<KhNumberBox Label="@T["Treasury.Dunning.After"]" Name="ldays" Value="level.DaysAfterDue" ValueChanged="v => level.DaysAfterDue = (int)(v ?? 0)" Decimals="0" Min="1" Span="3" />
|
||||
<KhSelect TValue="DunningChannel" Label="@T["Treasury.Dunning.Channel"]" Name="lchannel" Options="Channels" @bind-Value="level.Channel" Span="3" />
|
||||
<KhTextBox Label="@T["Treasury.Dunning.Template"]" Name="lname" @bind-Value="level.Name" MaxLength="60" Span="8" Required="true" />
|
||||
<KhNumberBox Label="@T["Treasury.Dunning.After"]" Name="ldays" Value="level.DaysAfterDue" ValueChanged="v => level.DaysAfterDue = (int)(v ?? 0)" Decimals="0" Min="1" Span="4" />
|
||||
<KhSelect TValue="DunningAction" Label="@T["Treasury.Dunning.Action"]" Name="laction" Options="Actions" @bind-Value="level.Action" Span="6" />
|
||||
<KhCheck Label="@T["Treasury.Dunning.ChargeInterest"]" Name="linterest" @bind-Value="level.ChargeInterest" Span="3" />
|
||||
<KhCheck Label="@T["Treasury.Dunning.Automatic"]" Name="lauto" @bind-Value="level.Automatic" Span="3" />
|
||||
<KhCheck Label="@T[TreasuryScreens.EnumKey(DunningChannel.Email)]" Name="lemail" Value="level.Channel.HasFlag(DunningChannel.Email)" ValueChanged="v => level.Channel = TreasuryScreens.Switch(level.Channel, DunningChannel.Email, v)" Span="2" />
|
||||
<KhCheck Label="@T[TreasuryScreens.EnumKey(DunningChannel.Pec)]" Name="lpec" Value="level.Channel.HasFlag(DunningChannel.Pec)" ValueChanged="v => level.Channel = TreasuryScreens.Switch(level.Channel, DunningChannel.Pec, v)" Span="2" />
|
||||
<KhCheck Label="@T[TreasuryScreens.EnumKey(DunningChannel.Letter)]" Name="lletter" Value="level.Channel.HasFlag(DunningChannel.Letter)" ValueChanged="v => level.Channel = TreasuryScreens.Switch(level.Channel, DunningChannel.Letter, v)" Span="2" />
|
||||
<KhCheck Label="@T["Treasury.Dunning.ChargeInterest"]" Name="linterest" @bind-Value="level.ChargeInterest" Span="6" />
|
||||
<KhCheck Label="@T["Treasury.Dunning.Automatic"]" Name="lauto" @bind-Value="level.Automatic" Span="6" />
|
||||
<KhTextBox Label="@T["Treasury.Dunning.Subject"]" Name="lsubject" @bind-Value="level.Subject" MaxLength="200" Span="12" Required="true" />
|
||||
<KhTextArea Label="@T["Treasury.Dunning.Body"]" Name="lbody" @bind-Value="level.Body" Rows="10" Span="12" />
|
||||
</div>
|
||||
@@ -229,7 +231,6 @@
|
||||
new("history", "clock", T["Treasury.Dunning.History"]),
|
||||
];
|
||||
|
||||
private IReadOnlyList<KhOption<DunningChannel>> Channels => TreasuryScreens.Choices<DunningChannel>(T);
|
||||
|
||||
private IReadOnlyList<KhOption<DunningAction>> Actions => TreasuryScreens.Choices<DunningAction>(T);
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<td class="code">@m.Iban</td>
|
||||
<td>@(m.LastCollectionDate is { } last ? T.Date(last) : T["Treasury.Mandates.First"])</td>
|
||||
<td><KhBadge Tone="@(m.Revoked ? KhTone.Error : KhTone.Ok)">@T[m.Revoked ? "Treasury.Mandates.Revoked" : "Treasury.Mandates.Active"]</KhBadge></td>
|
||||
<td class="num">
|
||||
<td class="kh-acts">
|
||||
@if (CanWrite)
|
||||
{
|
||||
<KhIconButton Icon="edit" Text="@T["Treasury.Mandates.Edit"]" OnClick="() => OpenEdit(row)" />
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<a href="@LedgerScreens.EntryUrl(entry)">@row.EntryNumber</a>
|
||||
}
|
||||
</td>
|
||||
<td class="num">
|
||||
<td class="kh-acts">
|
||||
@if (CanWrite && p.Origin != PaymentOrigin.Remittance)
|
||||
{
|
||||
<KhIconButton Icon="undo" Text="@T["Treasury.Payments.Cancel"]" Disabled="_busy" OnClick="() => CancelAsync(row)" />
|
||||
|
||||
@@ -75,11 +75,11 @@
|
||||
var l = row.Line;
|
||||
<tr>
|
||||
<td>@T.Date(l.BookingDate)</td>
|
||||
<td>@l.Description <span class="muted sm">@row.PartyName</span></td>
|
||||
<td class="kh-w260" title="@l.Description">@l.Description <span class="muted sm">@row.PartyName</span></td>
|
||||
<td class="num">@(l.Amount > 0m ? T.Money(l.Amount) : null)</td>
|
||||
<td class="num">@(l.Amount < 0m ? T.Money(-l.Amount) : null)</td>
|
||||
<td><KhBadge Tone="TreasuryScreens.ToneOf(l.Status)">@T[TreasuryScreens.EnumKey(l.Status)]</KhBadge></td>
|
||||
<td>
|
||||
<td class="kh-w260" title="@l.Proposal">
|
||||
@if (l.MatchKind != StatementMatchKind.None)
|
||||
{
|
||||
<span class="muted sm">@T[TreasuryScreens.EnumKey(l.MatchKind)] · </span>
|
||||
@@ -91,7 +91,7 @@
|
||||
}
|
||||
</td>
|
||||
<td class="num">@(l.Confidence > 0 ? l.Confidence + "%" : "—")</td>
|
||||
<td class="num kh-nowrap">
|
||||
<td class="kh-acts">
|
||||
@if (l.Status == StatementLineStatus.Suggested)
|
||||
{
|
||||
<KhIconButton Icon="check" Text="@T["Treasury.Reconciliation.Confirm"]" Primary="true" Disabled="_busy" OnClick="() => ConfirmAsync(l)" />
|
||||
@@ -150,7 +150,7 @@
|
||||
<td>@T[TreasuryScreens.EnumKey(rule.Direction)]</td>
|
||||
<td>@AccountText(rule.AccountId)</td>
|
||||
<td class="num">@rule.Uses</td>
|
||||
<td class="num">
|
||||
<td class="kh-acts">
|
||||
<KhIconButton Icon="edit" Text="@T["Treasury.Rules.Edit"]" OnClick="() => OpenRuleAsync(rule)" />
|
||||
<KhIconButton Icon="trash" Text="@T["Treasury.Rules.Delete"]" Danger="true" Disabled="_busy" OnClick="() => DeleteRuleAsync(rule)" />
|
||||
</td>
|
||||
|
||||
@@ -210,7 +210,7 @@
|
||||
<span class="muted sm"> @T.Date(u) · @T.Money(l.UnpaidFees)</span>
|
||||
}
|
||||
</td>
|
||||
<td class="num">
|
||||
<td class="kh-acts">
|
||||
@if (CanWrite && rem.Status is RemittanceStatus.Draft or RemittanceStatus.Generated)
|
||||
{
|
||||
<KhIconButton Icon="x" Text="@T["Treasury.Remittances.RemoveLine"]" Disabled="_busy" OnClick="() => RemoveLineAsync(l)" />
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
<KhSelect TValue="ScheduleView" Label="@T["Treasury.Schedule.View"]" Name="view" Options="Views" Value="_view" ValueChanged="SetViewAsync" />
|
||||
<KhSelect TValue="long?" Label="@T["Treasury.Fields.Method"]" Name="method" Options="Methods" Empty="@T["Treasury.All"]" Value="_methodId" ValueChanged="SetMethodAsync" />
|
||||
<span class="grow"></span>
|
||||
<div class="seg" role="group" aria-label="@T["Treasury.Schedule.Direction"]">
|
||||
<div class="kh-seg" role="group" aria-label="@T["Treasury.Schedule.Direction"]">
|
||||
<button type="button" class="@(_direction == OpenItemDirection.Receivable ? "on" : null)" @onclick="() => SetDirectionAsync(OpenItemDirection.Receivable)">@T["Treasury.Schedule.Customers"]</button>
|
||||
<button type="button" class="@(_direction == OpenItemDirection.Payable ? "on" : null)" @onclick="() => SetDirectionAsync(OpenItemDirection.Payable)">@T["Treasury.Schedule.Suppliers"]</button>
|
||||
</div>
|
||||
@@ -128,7 +128,7 @@
|
||||
<span class="muted sm"> @remittance</span>
|
||||
}
|
||||
</td>
|
||||
<td class="num">
|
||||
<td class="kh-acts">
|
||||
@if (CanWrite && !item.Closed)
|
||||
{
|
||||
<KhIconButton Icon="edit" Text="@T["Treasury.Schedule.Edit"]" OnClick="() => OpenEdit(row)" />
|
||||
|
||||
@@ -15,6 +15,24 @@ public static class TreasuryScreens
|
||||
/// <summary>The address of the area.</summary>
|
||||
public const string BasePath = "/scadenzario";
|
||||
|
||||
/// <summary>The text of the channels of a reminder level: they are flags, so "e-mail + PEC".</summary>
|
||||
/// <param name="texts">The texts.</param>
|
||||
/// <param name="channel">The channels.</param>
|
||||
/// <returns>The text.</returns>
|
||||
public static string ChannelText(ITexts texts, DunningChannel channel)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(texts);
|
||||
var parts = Enum.GetValues<DunningChannel>().Where(c => c != DunningChannel.None && channel.HasFlag(c)).Select(c => texts[EnumKey(c)]).ToList();
|
||||
return parts.Count == 0 ? texts[EnumKey(DunningChannel.None)] : string.Join(" + ", parts);
|
||||
}
|
||||
|
||||
/// <summary>The channels with one of them switched on or off.</summary>
|
||||
/// <param name="channel">The channels.</param>
|
||||
/// <param name="flag">The channel to switch.</param>
|
||||
/// <param name="on">Whether it is on.</param>
|
||||
/// <returns>The channels.</returns>
|
||||
public static DunningChannel Switch(DunningChannel channel, DunningChannel flag, bool on) => on ? channel | flag : channel & ~flag;
|
||||
|
||||
/// <summary>The key of the text of an enum value.</summary>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <returns>The key.</returns>
|
||||
|
||||
@@ -448,6 +448,11 @@ h1[tabindex="-1"]:focus { outline: none; box-shadow: none; }
|
||||
.grid td.neg, .grid td .neg { color: var(--kh-err); }
|
||||
.grid td.pos { color: var(--kh-ok); }
|
||||
.btn.ok { color: var(--kh-ok); border-color: var(--kh-ok); }
|
||||
/* The strip clips its overflow, so in the column of the page it would shrink to nothing on long pages. */
|
||||
.strip { flex-shrink: 0; }
|
||||
.grid td .ib { display: inline-grid; vertical-align: middle; }
|
||||
.grid td.kh-acts { overflow: visible; max-width: none; white-space: nowrap; text-align: right; }
|
||||
.grid td.kh-w260 { max-width: 260px; }
|
||||
.kh-cfbarcol { width: 28%; }
|
||||
.kh-cfbar { display: block; height: 8px; border-radius: 4px; background: var(--kh-accent); min-width: 2px; }
|
||||
.kh-cfbar.neg { background: var(--kh-err); }
|
||||
|
||||
Reference in new issue
Block a user