diff --git a/Elwig/App.xaml b/Elwig/App.xaml index e600f81..3c2eed1 100644 --- a/Elwig/App.xaml +++ b/Elwig/App.xaml @@ -55,6 +55,12 @@ + + + + + + diff --git a/Elwig/Documents/CreditNote.cs b/Elwig/Documents/CreditNote.cs index f4018b0..5c4e357 100644 --- a/Elwig/Documents/CreditNote.cs +++ b/Elwig/Documents/CreditNote.cs @@ -48,7 +48,7 @@ namespace Elwig.Documents { if (CustomPayment?.ModComment != null) { MemberModifier = CustomPayment.ModComment; } else if (mod != null) { - MemberModifier = $"{mod.Name} ({mod.ValueStr})"; + MemberModifier = $"{mod.Name} ({mod.PublicValueStr})"; } else { MemberModifier = "Sonstige Zu-/Abschläge"; } diff --git a/Elwig/Documents/DeliveryNote.cshtml b/Elwig/Documents/DeliveryNote.cshtml index 85b2fea..30e929a 100644 --- a/Elwig/Documents/DeliveryNote.cshtml +++ b/Elwig/Documents/DeliveryNote.cshtml @@ -55,7 +55,7 @@ @if (part.Modifiers.Count() > 0) { var first = true; foreach (var mod in part.Modifiers) { - @Raw(first ? "Zu-/Abschläge:" : "")@mod.Name@mod.ValueStr + @Raw(first ? "Zu-/Abschläge:" : "")@mod.Name@mod.PublicValueStr first = false; } } diff --git a/Elwig/Helpers/AppDbUpdater.cs b/Elwig/Helpers/AppDbUpdater.cs index 2186739..9b327dd 100644 --- a/Elwig/Helpers/AppDbUpdater.cs +++ b/Elwig/Helpers/AppDbUpdater.cs @@ -9,7 +9,7 @@ namespace Elwig.Helpers { public static class AppDbUpdater { // Don't forget to update value in Tests/fetch-resources.bat! - public static readonly int RequiredSchemaVersion = 33; + public static readonly int RequiredSchemaVersion = 34; private static int VersionOffset = 0; diff --git a/Elwig/Models/Entities/Modifier.cs b/Elwig/Models/Entities/Modifier.cs index 80ba35f..811303a 100644 --- a/Elwig/Models/Entities/Modifier.cs +++ b/Elwig/Models/Entities/Modifier.cs @@ -16,6 +16,9 @@ namespace Elwig.Models.Entities { [Column("active")] public bool IsActive { get; set; } + [Column("redacted")] + public bool IsRedacted { get; set; } + [Column("ordering")] public int Ordering { get; set; } @@ -46,6 +49,8 @@ namespace Elwig.Models.Entities { (Rel != null) ? $"{Utils.GetSign(Rel.Value)}{(Math.Abs(Rel.Value) < 0.1m ? "\u2007" : "")}{Math.Abs(Rel.Value):0.00##\u00a0%}" : ""; + public string? PublicValueStr => IsRedacted ? null : ValueStr; + public override string ToString() { return Name; } diff --git a/Elwig/Resources/Sql/33-34.sql b/Elwig/Resources/Sql/33-34.sql new file mode 100644 index 0000000..1d00b92 --- /dev/null +++ b/Elwig/Resources/Sql/33-34.sql @@ -0,0 +1,3 @@ +-- schema version 33 to 34 + +ALTER TABLE modifier ADD COLUMN redacted INTEGER NOT NULL CHECK (redacted IN (TRUE, FALSE)) DEFAULT FALSE; diff --git a/Elwig/Windows/BaseDataWindow.xaml b/Elwig/Windows/BaseDataWindow.xaml index 54d2d89..069beab 100644 --- a/Elwig/Windows/BaseDataWindow.xaml +++ b/Elwig/Windows/BaseDataWindow.xaml @@ -8,7 +8,7 @@ xmlns:local="clr-namespace:Elwig.Windows" xmlns:ctrl="clr-namespace:Elwig.Controls" mc:Ignorable="d" - Title="Stammdaten - Elwig" Height="500" MinHeight="400" Width="850" MinWidth="810" + Title="Stammdaten - Elwig" Height="520" MinHeight="400" Width="860" MinWidth="810" Loaded="Window_Loaded">