feat: automatic codes and automatic filling (#43)
Parties, items and the CRM archives need codes given by the system without
duplicates, and the address and bank fields should fill themselves; this adds
both before the party and item screens that use them.
- CodeMask ({seq:0000}, {anno}, {categoria}) and code_sequences (migration
015): one sequence per rule, year and category, taken under a lock in the
transaction that saves the record, skipping codes written by hand
- CodeRuleService: rules in company settings with the masks of SPEC 11.12,
validation, preview of the next code, manual code allowed or not
- AutoFillService: municipality from postal code and back, personal tax code,
VIES, bank and BIC from the IBAN, delivery date on working days, options
that can be switched off (the ECB job honours its option)
- IBankDirectory.ReadIban gives ABI and CAB even without the ABI list; the
Italian pack now registers the directory
- Company preferences page (mockup 074) at /tabelle/preferenze, in the menu
- aria-checked now renders true/false on switch rows and profile radios
- ADR 0027, wiki, CHANGELOG, STATUS, DATA-MODEL
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9bcf8c1082
commit
07555de700
27 files changed
+1627
-40
No files matched your search
@@ -0,0 +1,23 @@
|
||||
using Khaemhat.Data.Migrations;
|
||||
using Khaemhat.Data.Schema;
|
||||
|
||||
namespace Khaemhat.Data.CompanyDatabase.Migrations;
|
||||
|
||||
/// <summary>The sequences of the automatic codes (SPEC §11.12): one row per rule, year and category.</summary>
|
||||
[Migration(20261111_015, "create_code_sequences")]
|
||||
public sealed class M20261111_015_CreateCodeSequences : IMigration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void Up(ISchemaBuilder schema)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(schema);
|
||||
schema.CreateTable("code_sequences", t =>
|
||||
{
|
||||
t.Id();
|
||||
t.String("key", 100).NotNull();
|
||||
t.Int64("last_value").NotNull();
|
||||
t.AuditColumns();
|
||||
t.Unique("ux_code_sequences_key", "key");
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -435,3 +435,14 @@ public sealed class JobMap : EntityMap<Job>
|
||||
Map(x => x.Description).MaxLength(100);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Map of <see cref="CodeSequence"/> to <c>code_sequences</c>.</summary>
|
||||
public sealed class CodeSequenceMap : EntityMap<CodeSequence>
|
||||
{
|
||||
/// <summary>Creates the map.</summary>
|
||||
public CodeSequenceMap()
|
||||
{
|
||||
ToTable("code_sequences");
|
||||
Map(x => x.Key).MaxLength(100);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user