diff --git a/Elwig/Documents/DeliveryNote.cshtml.cs b/Elwig/Documents/DeliveryNote.cshtml.cs
index b584e23..631a9d7 100644
--- a/Elwig/Documents/DeliveryNote.cshtml.cs
+++ b/Elwig/Documents/DeliveryNote.cshtml.cs
@@ -10,10 +10,10 @@ namespace Elwig.Documents {
public IEnumerable<(string, string, int, int, int)> MemberBuckets;
// 0 - none
- // 1 - only business shares
- // 2 - only business shares and area commitments of varieties from delivery note
+ // 1 - GA only
+ // 2 - GA only and area commitments of varieties from delivery note
// 3 - full
- public int DisplayStats = 2;
+ public int DisplayStats = App.Client.ModeDeliveryNoteStats;
public DeliveryNote(Delivery d, AppDbContext ctx) : base($"Traubenübernahmeschein Nr. {d.LsNr}", d.Member) {
UseBillingAddress = true;
diff --git a/Elwig/Documents/style-deliverynote.css b/Elwig/Documents/style-deliverynote.css
index 3c876ce..44543ff 100644
--- a/Elwig/Documents/style-deliverynote.css
+++ b/Elwig/Documents/style-deliverynote.css
@@ -58,6 +58,11 @@ table.delivery-stats {
break-after: avoid;
}
+table.delivery-stats th,
+table.delivery-stats td {
+ padding: 0.125mm 0;
+}
+
table.delivery-stats:not(.expanded) tr.optional {
display: none;
}
@@ -66,8 +71,8 @@ table.delivery-stats tr.subheading th {
text-align: left;
}
-table.delivery.expanded tr.subheading:not(:has(~ tr)),
-table.delivery tr.subheading:not(:has(~ tr:not(.optional))) {
+table.delivery-stats.expanded tr.subheading:not(:has(~ tr)),
+table.delivery-stats tr.subheading:not(:has(~ tr:not(.optional))) {
display: none;
}
diff --git a/Elwig/Helpers/ClientParameters.cs b/Elwig/Helpers/ClientParameters.cs
index ec37554..9a200ea 100644
--- a/Elwig/Helpers/ClientParameters.cs
+++ b/Elwig/Helpers/ClientParameters.cs
@@ -55,6 +55,8 @@ namespace Elwig.Helpers {
public decimal VatReduced;
public decimal VatFlatRate;
+ public int ModeDeliveryNoteStats;
+
public string? TextDeliveryNote;
public ClientParameters(AppDbContext ctx) : this(ctx.ClientParameters.ToDictionary(e => e.Param, e => e.Value)) { }
@@ -89,6 +91,13 @@ namespace Elwig.Helpers {
VatReduced = decimal.Parse((parameters["VAT_REDUCED"] ?? "").Replace(".", ","));
VatFlatRate = decimal.Parse((parameters["VAT_FLATRATE"] ?? "").Replace(".", ","));
+ switch (parameters.GetValueOrDefault("MODE_DELIVERYNOTE_STATS", "SHORT")?.ToUpper()) {
+ case "NONE": ModeDeliveryNoteStats = 0; break;
+ case "GA_ONLY": ModeDeliveryNoteStats = 1; break;
+ case "SHORT": ModeDeliveryNoteStats = 2; break;
+ case "FULL": ModeDeliveryNoteStats = 3; break;
+ }
+
Sender2 = parameters.GetValueOrDefault("DOCUMENT_SENDER") ?? "";
TextDeliveryNote = parameters.GetValueOrDefault("TEXT_DELIVERYNOTE");
} catch {
@@ -97,6 +106,13 @@ namespace Elwig.Helpers {
}
private IEnumerable<(string, string?)> GetParamValues() {
+ string deliveryNoteStats = "SHORT";
+ switch (ModeDeliveryNoteStats) {
+ case 0: deliveryNoteStats = "NONE"; break;
+ case 1: deliveryNoteStats = "GA_ONLY"; break;
+ case 2: deliveryNoteStats = "SHORT"; break;
+ case 3: deliveryNoteStats = "FULL"; break;
+ }
return new (string, string?)[] {
("CLIENT_NAME_TOKEN", NameToken),
("CLIENT_NAME_SHORT", NameShort),
@@ -119,6 +135,7 @@ namespace Elwig.Helpers {
("VAT_NORMAL", VatNormal.ToString().Replace(",", ".")),
("VAT_REDUCED", VatReduced.ToString().Replace(",", ".")),
("VAT_FLATRATE", VatFlatRate.ToString().Replace(",", ".")),
+ ("MODE_DELIVERYNOTE_STATS", deliveryNoteStats),
("DOCUMENT_SENDER", Sender2),
("TEXT_DELIVERYNOTE", TextDeliveryNote),
};
diff --git a/Elwig/Windows/BaseDataWindow.xaml b/Elwig/Windows/BaseDataWindow.xaml
index bca3c3c..8eeccf1 100644
--- a/Elwig/Windows/BaseDataWindow.xaml
+++ b/Elwig/Windows/BaseDataWindow.xaml
@@ -215,7 +215,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Elwig/Windows/BaseDataWindow.xaml.cs b/Elwig/Windows/BaseDataWindow.xaml.cs
index 6e94df4..ee40944 100644
--- a/Elwig/Windows/BaseDataWindow.xaml.cs
+++ b/Elwig/Windows/BaseDataWindow.xaml.cs
@@ -201,6 +201,14 @@ namespace Elwig.Windows {
ClientEmailAddressInput.Text = p.EmailAddress;
ClientWebsiteInput.Text = p.Website;
+ TextElementDeliveryNote.Text = p.TextDeliveryNote;
+ switch (p.ModeDeliveryNoteStats) {
+ case 0: ModeDeliveryNoteNone.IsChecked = true; break;
+ case 1: ModeDeliveryNoteGaOnly.IsChecked = true; break;
+ case 2: ModeDeliveryNoteShort.IsChecked = true; break;
+ case 3: ModeDeliveryNoteFull.IsChecked = true; break;
+ }
+
FinishInputFilling();
}
@@ -222,6 +230,9 @@ namespace Elwig.Windows {
p.EmailAddress = ClientEmailAddressInput.Text.Length > 0 ? ClientEmailAddressInput.Text : null;
p.Website = ClientWebsiteInput.Text.Length > 0 ? ClientWebsiteInput.Text : null;
+ p.TextDeliveryNote = TextElementDeliveryNote.Text.Length > 0 ? TextElementDeliveryNote.Text : null;
+ p.ModeDeliveryNoteStats = (ModeDeliveryNoteNone.IsChecked == true) ? 0 : (ModeDeliveryNoteGaOnly.IsChecked == true) ? 1 : (ModeDeliveryNoteShort.IsChecked == true) ? 2 : (ModeDeliveryNoteFull.IsChecked == true) ? 3 : 2;
+
await p.UpdateValues();
}