-
@T.Format("Purchases.SelfInvoices.Advice", advice.DocumentTypeCode, advice.Reason, T.Date(advice.Deadline))
+
@T.Format("Purchases.SelfInvoices.Advice", advice.DocumentTypeCode, Sentence(advice.Reason), T.Date(advice.Deadline))
@if (Session.Permissions.Allows(PurchaseService.WritePermission) && DocumentStateMachine.IsInForce(h.Status))
{
@@ -354,11 +354,11 @@ else
@if (SalesScreens.RecordUrl(link.Kind, link.Id) is { } url)
{
- @(link.DocumentNumber ?? T["Sales.DraftNumber"])
+ @SalesScreens.Number(T, link.DocumentNumber, link.Status)
}
else
{
- @(link.DocumentNumber ?? T["Sales.DraftNumber"])
+ @SalesScreens.Number(T, link.DocumentNumber, link.Status)
}
|
@T.Date(link.Date) |
diff --git a/src/Khaemhat.Web/Components/Pages/Sales/SalesDocumentPage.razor.cs b/src/Khaemhat.Web/Components/Pages/Sales/SalesDocumentPage.razor.cs
index d0eaa8e..2d2e1b3 100644
--- a/src/Khaemhat.Web/Components/Pages/Sales/SalesDocumentPage.razor.cs
+++ b/src/Khaemhat.Web/Components/Pages/Sales/SalesDocumentPage.razor.cs
@@ -115,7 +115,7 @@ public sealed partial class SalesDocumentPage
private string PageTitle => Record is null || _definition is null
? T["Shell.Menu.Sales"]
- : _definition.Type.Description + " " + (Record.Header.DocumentNumber ?? T["Sales.DraftNumber"]);
+ : _definition.Type.Description + " " + SalesScreens.Number(T, Record.Header.DocumentNumber, Record.Header.Status);
private bool IsInvoice => Record is not null && (Behavior.Lifecycle == DocumentLifecycle.Invoice || H.Kind == DocumentKind.ProForma || IsRegistered);
@@ -336,6 +336,9 @@ public sealed partial class SalesDocumentPage
}
// A supplier invoice: the prices that differ from its order or receipt, and the self-invoice it needs.
+ // A reason ends with one full stop, whether the fiscal pack wrote it or not.
+ private static string Sentence(string text) => text.EndsWith('.') ? text : text + ".";
+
private async Task LoadPurchaseChecksAsync(Actor actor, string company)
{
_differences = [];
diff --git a/src/Khaemhat.Web/Components/Pages/Sales/SalesDocumentsPage.razor b/src/Khaemhat.Web/Components/Pages/Sales/SalesDocumentsPage.razor
index f234831..54381f8 100644
--- a/src/Khaemhat.Web/Components/Pages/Sales/SalesDocumentsPage.razor
+++ b/src/Khaemhat.Web/Components/Pages/Sales/SalesDocumentsPage.razor
@@ -103,7 +103,7 @@ else
private IReadOnlyList
> Columns =>
[
- new("number", T[_section?.Kinds.Contains(DocumentKind.PurchaseInvoice) == true ? "Purchases.Fields.Protocol" : "Sales.Fields.DocumentNumber"], r => r.DocumentNumber ?? T["Sales.DraftNumber"]) { Kind = KhColumnKind.Code, Width = "130px" },
+ new("number", T[_section?.Kinds.Contains(DocumentKind.PurchaseInvoice) == true ? "Purchases.Fields.Protocol" : "Sales.Fields.DocumentNumber"], r => SalesScreens.Number(T, r.DocumentNumber, r.Status)) { Kind = KhColumnKind.Code, Width = "130px" },
new("date", T["Sales.Fields.DocumentDate"], r => r.Date) { Kind = KhColumnKind.Date, Width = "100px" },
new("type", T["Sales.Radar.Kind"], r => SalesScreens.KindName(T, r.Kind)) { Width = "150px", Sortable = false, Visible = _section?.Kinds.Count > 1 },
new("party", T[SalesScreens.PartyLabel(_section?.Direction ?? DocumentDirection.Sale)], r => r.PartyName) { Sortable = false, Visible = !Internal },
diff --git a/src/Khaemhat.Web/Documents/SalesScreens.cs b/src/Khaemhat.Web/Documents/SalesScreens.cs
index 463bc5e..5c1ee73 100644
--- a/src/Khaemhat.Web/Documents/SalesScreens.cs
+++ b/src/Khaemhat.Web/Documents/SalesScreens.cs
@@ -134,6 +134,20 @@ public static class SalesScreens
return texts["Sales.Kinds." + kind];
}
+ ///
+ /// The number shown for a document: its own number, else "Bozza" for a draft and "Senza numero" for a confirmed
+ /// document of a type without numerator (a supplier delivery note, which keeps the supplier's number).
+ ///
+ /// The texts.
+ /// The document number.
+ /// The state.
+ /// The text.
+ public static string Number(ITexts texts, string? number, DocumentStatus status)
+ {
+ ArgumentNullException.ThrowIfNull(texts);
+ return number ?? texts[status == DocumentStatus.Draft ? "Sales.DraftNumber" : "Sales.NoNumber"];
+ }
+
/// The label and tone of a state; a quotation shows its outcome (accepted, refused, expired).
/// The texts.
/// The kind.
diff --git a/src/Khaemhat.Web/Resources/it-IT/Purchases.json b/src/Khaemhat.Web/Resources/it-IT/Purchases.json
index 2a62a3c..4689ab9 100644
--- a/src/Khaemhat.Web/Resources/it-IT/Purchases.json
+++ b/src/Khaemhat.Web/Resources/it-IT/Purchases.json
@@ -56,10 +56,11 @@
"Reason": "Motivo",
"Deadline": "Entro il",
"Create": "Crea autofattura",
- "Advice": "Serve un'autofattura {0}: {1}. Da emettere entro il {2}."
+ "Advice": "Serve un'autofattura {0}: {1} Da emettere entro il {2}."
},
"PriceDifferences": {
"Summary": "{0} righe hanno un prezzo diverso dall'ordine o dal ricevimento: differenza totale {1}.",
+ "SummaryOne": "Una riga ha un prezzo diverso dall'ordine o dal ricevimento: differenza {0}.",
"Line": "Riga {0}, {1}: {2} a {3}, in fattura {4}."
}
},
diff --git a/src/Khaemhat.Web/Resources/it-IT/Sales.json b/src/Khaemhat.Web/Resources/it-IT/Sales.json
index 1f10cb0..4698eab 100644
--- a/src/Khaemhat.Web/Resources/it-IT/Sales.json
+++ b/src/Khaemhat.Web/Resources/it-IT/Sales.json
@@ -4,6 +4,7 @@
"NotFound": "Documento non trovato",
"BackToList": "Torna all'elenco",
"DraftNumber": "Bozza",
+ "NoNumber": "Senza numero",
"NumberOnConfirm": "Assegnato alla conferma",
"NoParty": "Cliente da scegliere",
"Demo": "Dato dimostrativo",
diff --git a/src/Khaemhat.Web/wwwroot/app.css b/src/Khaemhat.Web/wwwroot/app.css
index 6b513a0..64c1bf0 100644
--- a/src/Khaemhat.Web/wwwroot/app.css
+++ b/src/Khaemhat.Web/wwwroot/app.css
@@ -409,10 +409,15 @@ h1[tabindex="-1"]:focus { outline: none; box-shadow: none; }
/* Warehouse (M6): filters above a radar, count boxes, file picker as a button, grids inside dialogs. */
.kh-pagefilters { margin: 10px 0 4px; }
.kh-searchbox { width: 220px; }
+.kh-taketools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--kh-border); }
+.kh-taketools .in { width: auto; }
+.kh-taketools .kh-searchbox { flex: 1 1 200px; max-width: 320px; }
+.kh-scrollx { overflow-x: auto; }
.in.kh-countbox { width: 96px; height: 26px; text-align: right; }
.kh-filebtn { position: relative; overflow: hidden; cursor: pointer; }
.kh-filebtn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.kh-dialoggrid { max-height: 52vh; overflow: auto; margin-top: 10px; }
+.kh-dialoggrid .mono { font-family: var(--kh-mono); font-size: 12px; }
.kh-cellpick { min-width: 220px; }
.kh-cellpick .f > label:empty { display: none; }
.kh-plainlist { margin: 4px 0 0; padding-left: 18px; }