feat: company table screens, profile and fiscal years, seed command (#38, #39, #45)

Gives the company tables of the previous commit their screens, so a company
can be configured from the browser, and makes the base data runnable outside
the web server.

- one generic editor for the 26 coded tables (/tabelle/<slug>), described in
  TableScreens: grid with active/disabled filter, detail with errors and
  warnings, disable instead of delete, CSV export and all-or-nothing import,
  "update from base tables"; index page and menu entries
- company profile in tabs with the fiscal pack checks, fiscal years with
  month lock/unlock, exchange rates with manual rates
- PaymentTermService: installments saved together, percentages must sum to 100
- a new profile proposes the registered company name instead of its code
- seed verb in Khaemhat.Web and scripts/seed.sh --base [--company CODE],
  shipped in the image under /app/scripts
- ADR 0026 (base data only adds missing codes; ISTAT and ABI/CAB lists come
  as separate datasets), wiki, CHANGELOG, STATUS

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-11 23:15:09 +01:00
1 parent 34e196424f
commit 9bcf8c1082
33 files changed
+3272 -43

No files matched your search

@@ -203,4 +203,30 @@ public sealed class CompanyTablesTests
await app.StopAsync();
}
}
[TestMethod]
public async Task PaymentTermLines_AreReplacedTogether_OrNotAtAll()
{
var (app, _, company) = await TestInstance.StartAsync(CancellationToken.None);
await using (app)
{
var tables = app.Services.GetRequiredService<TableService>();
var terms = app.Services.GetRequiredService<PaymentTermService>();
var term = (await tables.AllAsync<PaymentTerm>(Root, company)).Single(t => t.Code == "RB3060FM");
Assert.HasCount(2, await terms.LinesAsync(Root, company, term.Id));
var saved = await terms.SaveLinesAsync(Root, company, term.Id,
[
new() { Days = 30, EndOfMonth = true, Percent = 40m },
new() { Days = 60, EndOfMonth = true, Percent = 30m },
new() { Days = 90, EndOfMonth = true, Percent = 30m },
]);
CollectionAssert.AreEqual(new[] { 1, 2, 3 }, saved.Select(l => l.Number).ToArray());
var refused = await Assert.ThrowsExactlyAsync<ValidationFailedException>(() =>
terms.SaveLinesAsync(Root, company, term.Id, [new() { Days = 30, Percent = 90m }]));
CollectionAssert.Contains(refused.Errors.ToList(), PaymentTermService.LinesField + ":" + PaymentTermService.PercentTotal);
Assert.HasCount(3, await terms.LinesAsync(Root, company, term.Id), "Nothing changed.");
}
}
}