DeliveryNote: Add option to redact modifier value
All checks were successful
Test / Run tests (push) Successful in 2m26s
All checks were successful
Test / Run tests (push) Successful in 2m26s
This commit is contained in:
@@ -55,6 +55,12 @@
|
||||
<TextBlock Text="{Binding ValueStr}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="PublicModifierTemplate">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Name}" MinWidth="250" Margin="0,0,10,0"/>
|
||||
<TextBlock Text="{Binding PublicValueStr}"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="WineAttributeTemplate">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
@if (part.Modifiers.Count() > 0) {
|
||||
var first = true;
|
||||
foreach (var mod in part.Modifiers) {
|
||||
<tr class="tight @(first ? "first" : "")"><td></td><td>@Raw(first ? "<i>Zu-/Abschläge:</i>" : "")</td><td colspan="3"><b>@mod.Name</b></td><td style="white-space: pre;">@mod.ValueStr</td></tr>
|
||||
<tr class="tight @(first ? "first" : "")"><td></td><td>@Raw(first ? "<i>Zu-/Abschläge:</i>" : "")</td><td colspan="3"><b>@mod.Name</b></td><td style="white-space: pre;">@mod.PublicValueStr</td></tr>
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
3
Elwig/Resources/Sql/33-34.sql
Normal file
3
Elwig/Resources/Sql/33-34.sql
Normal file
@@ -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;
|
||||
@@ -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">
|
||||
<Window.Resources>
|
||||
<Style TargetType="Label">
|
||||
@@ -532,6 +532,10 @@
|
||||
<CheckBox x:Name="SeasonModifierActiveInput" Content="In Übernahme-Fenster anzeigen"
|
||||
Grid.Column="1" Grid.ColumnSpan="2" Margin="10,134,10,10" HorizontalAlignment="Left" VerticalAlignment="Top"
|
||||
Checked="SeasonModifier_Changed" Unchecked="SeasonModifier_Changed"/>
|
||||
|
||||
<CheckBox x:Name="SeasonModifierRedactedInput" Content="Wert auf Lieferschein verbergen"
|
||||
Grid.Column="1" Grid.ColumnSpan="2" Margin="10,154,10,10" HorizontalAlignment="Left" VerticalAlignment="Top"
|
||||
Checked="SeasonModifier_Changed" Unchecked="SeasonModifier_Changed"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
|
||||
@@ -135,12 +135,14 @@ namespace Elwig.Windows {
|
||||
SeasonModifierRelInput.Text = "";
|
||||
SeasonModifierAbsInput.Text = "";
|
||||
SeasonModifierActiveInput.IsChecked = false;
|
||||
SeasonModifierRedactedInput.IsChecked = false;
|
||||
} else {
|
||||
SeasonModifierIdInput.Text = mod.ModId;
|
||||
SeasonModifierNameInput.Text = mod.Name;
|
||||
SeasonModifierRelInput.Text = (mod.Rel * 100)?.ToString() ?? "";
|
||||
SeasonModifierAbsInput.Text = mod.Abs?.ToString() ?? "";
|
||||
SeasonModifierActiveInput.IsChecked = mod.IsActive;
|
||||
SeasonModifierRedactedInput.IsChecked = mod.IsRedacted;
|
||||
}
|
||||
_modUpdate = false;
|
||||
}
|
||||
@@ -157,6 +159,7 @@ namespace Elwig.Windows {
|
||||
mod.Rel = decimal.TryParse(SeasonModifierRelInput.Text, out var vRel) ? vRel / 100 : null;
|
||||
mod.AbsValue = decimal.TryParse(SeasonModifierAbsInput.Text, out var vAbs) ? Utils.DecToDb(vAbs, s.Precision) : null;
|
||||
mod.IsActive = SeasonModifierActiveInput.IsChecked ?? false;
|
||||
mod.IsRedacted = SeasonModifierRedactedInput.IsChecked ?? false;
|
||||
|
||||
CollectionViewSource.GetDefaultView(_modList).Refresh();
|
||||
UpdateButtons();
|
||||
|
||||
@@ -95,6 +95,7 @@ namespace Elwig.Windows {
|
||||
if (App.Client.IsMatzen) {
|
||||
RequiredInputs = [.. RequiredInputs, ModifiersInput];
|
||||
}
|
||||
ModifiersInput.ItemTemplate = (DataTemplate)ModifiersInput.FindResource("PublicModifierTemplate");
|
||||
} else {
|
||||
WeighingManualButton.Visibility = Visibility.Hidden;
|
||||
WeighingAButton.Visibility = Visibility.Hidden;
|
||||
|
||||
@@ -1 +1 @@
|
||||
curl --fail -s -L "https://elwig.at/files/create.sql?v=33" -u "elwig:ganzGeheim123!" -o "Resources\Sql\Create.sql"
|
||||
curl --fail -s -L "https://elwig.at/files/create.sql?v=34" -u "elwig:ganzGeheim123!" -o "Resources\Sql\Create.sql"
|
||||
|
||||
Reference in New Issue
Block a user