Compare commits
9 Commits
v1.0.2.0
...
3419113dec
| Author | SHA1 | Date | |
|---|---|---|---|
| 3419113dec | |||
| bf6297f63b | |||
| f228ba3019 | |||
| 495aa8a691 | |||
| 811916a8b9 | |||
| 3b6333a6a2 | |||
| 9b37330362 | |||
| 889a17b21c | |||
| ac6d559e5d |
@@ -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">
|
||||
|
||||
@@ -124,19 +124,24 @@ namespace Elwig.Controls {
|
||||
SelectItemsReverse();
|
||||
var dmp = !string.IsNullOrEmpty(ListDisplayMemberPath) ? ListDisplayMemberPath : !string.IsNullOrEmpty(DisplayMemberPath) ? DisplayMemberPath : null;
|
||||
if (SelectedItems.Count == ItemsSource.Cast<object>().Count() && AllItemsSelectedContent != null) {
|
||||
_textBox.Text = AllItemsSelectedContent;
|
||||
AllItemsSelected = true;
|
||||
} else if (SelectedItems.Count == 0) {
|
||||
_textBox.Text = "";
|
||||
AllItemsSelected = false;
|
||||
} else {
|
||||
AllItemsSelected = null;
|
||||
}
|
||||
if (SelectedItems.Count > 1 && SelectedItems.Count == ItemsSource.Cast<object>().Count() && AllItemsSelectedContent != null) {
|
||||
_textBox.Text = AllItemsSelectedContent;
|
||||
} else if (SelectedItems.Count == 0) {
|
||||
_textBox.Text = "";
|
||||
} else {
|
||||
_textBox.Text = string.Join(Delimiter,
|
||||
dmp == null ? SelectedItems.Cast<object>() :
|
||||
SelectedItems.Cast<object>()
|
||||
.Select(i => i.GetType().GetProperty(dmp)?.GetValue(i))
|
||||
);
|
||||
AllItemsSelected = null;
|
||||
}
|
||||
|
||||
RaiseEvent(new SelectionChangedEventArgs(SelectionChangedEvent, evt.RemovedItems, evt.AddedItems));
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<TargetFramework>net10.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWPF>true</UseWPF>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
@@ -22,12 +22,12 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
||||
<PackageReference Include="LinqKit" Version="1.3.8" />
|
||||
<PackageReference Include="LinqKit" Version="1.3.9" />
|
||||
<PackageReference Include="MailKit" Version="4.14.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="6.0.36" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="9.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.10" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="9.0.10" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="10.0.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="10.0.0" />
|
||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.3595.46" />
|
||||
<PackageReference Include="NJsonSchema" Version="11.5.2" />
|
||||
<PackageReference Include="PdfiumViewer" Version="2.13.0" />
|
||||
@@ -35,10 +35,10 @@
|
||||
<PackageReference Include="RazorLight" Version="2.3.1" />
|
||||
<PackageReference Include="ScottPlot.WPF" Version="5.1.57" />
|
||||
<PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="3.0.2" />
|
||||
<PackageReference Include="System.IO.Hashing" Version="9.0.10" />
|
||||
<PackageReference Include="System.IO.Ports" Version="9.0.10" />
|
||||
<PackageReference Include="System.Management" Version="9.0.10" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="9.0.10" />
|
||||
<PackageReference Include="System.IO.Hashing" Version="10.0.0" />
|
||||
<PackageReference Include="System.IO.Ports" Version="10.0.0" />
|
||||
<PackageReference Include="System.Management" Version="10.0.0" />
|
||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="10.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -120,7 +120,8 @@ namespace Elwig.Helpers {
|
||||
public static async Task ExecuteBatch(SqliteConnection cnx, string sql) {
|
||||
using var cmd = cnx.CreateCommand();
|
||||
cmd.CommandText = sql;
|
||||
await (await cmd.ExecuteReaderAsync()).CloseAsync();
|
||||
using var reader = await cmd.ExecuteReaderAsync();
|
||||
while (await reader.NextResultAsync());
|
||||
}
|
||||
|
||||
public static async Task ExecuteEmbeddedScript(SqliteConnection cnx, Assembly asm, string name) {
|
||||
|
||||
@@ -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 = 35;
|
||||
|
||||
private static int VersionOffset = 0;
|
||||
|
||||
|
||||
@@ -744,8 +744,8 @@ namespace Elwig.Helpers.Export {
|
||||
};
|
||||
if (p.IsSplCheck) obj["spl_check"] = p.IsSplCheck;
|
||||
if (p.IsHandPicked != null) obj["hand_picked"] = p.IsHandPicked;
|
||||
if (p.IsLesewagen != null) obj["lesewagen"] = p.IsLesewagen;
|
||||
if (p.IsGebunden != null) obj["gebunden"] = p.IsGebunden;
|
||||
if (p.Unloading != null) obj["unloading"] = p.Unloading;
|
||||
if (p.Temperature != null) obj["temperature"] = p.Temperature;
|
||||
if (p.Acid != null) obj["acid"] = p.Acid;
|
||||
if (p.ScaleId != null) obj["scale_id"] = p.ScaleId;
|
||||
@@ -818,8 +818,8 @@ namespace Elwig.Helpers.Export {
|
||||
Comment = p["comment"]?.AsValue().GetValue<string>(),
|
||||
IsSplCheck = p["spl_check"]?.AsValue().GetValue<bool>() ?? false,
|
||||
IsHandPicked = p["hand_picked"]?.AsValue().GetValue<bool>(),
|
||||
IsLesewagen = p["lesewagen"]?.AsValue().GetValue<bool>(),
|
||||
IsGebunden = p["gebunden"]?.AsValue().GetValue<bool>(),
|
||||
Unloading = p["unloading"]?.AsValue().GetValue<string>() ?? ((p["lesewagen"]?.AsValue().GetValue<bool>() ?? false) ? DeliveryPart.Pumped : null),
|
||||
Temperature = p["temperature"]?.AsValue().GetValue<double>(),
|
||||
Acid = p["acid"]?.AsValue().GetValue<double>(),
|
||||
ScaleId = p["scale_id"]?.AsValue().GetValue<string>(),
|
||||
|
||||
@@ -502,6 +502,7 @@ namespace Elwig.Helpers {
|
||||
if (App.Config.Smtp == null)
|
||||
return false;
|
||||
return await Task.Run(async () => {
|
||||
await AddSentMailBody(subject, text, 1);
|
||||
SmtpClient? client = null;
|
||||
try {
|
||||
client = await GetSmtpClient();
|
||||
@@ -519,6 +520,11 @@ namespace Elwig.Helpers {
|
||||
}
|
||||
msg.Body = body;
|
||||
await client!.SendAsync(msg);
|
||||
await AddSentMails([(
|
||||
"email", member.MgNr, member.AdministrativeName,
|
||||
member.EmailAddresses.OrderBy(a => a.Nr).Select(a => a.Address).ToArray(),
|
||||
subject, docs.Select(d => d.Title).ToArray()
|
||||
)]);
|
||||
} catch (Exception exc) {
|
||||
MessageBox.Show(exc.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
return false;
|
||||
@@ -539,7 +545,7 @@ namespace Elwig.Helpers {
|
||||
await doc.Generate();
|
||||
var success = await SendEmail(e.Member, e.Subject, e.Text, [doc]);
|
||||
if (success)
|
||||
MessageBox.Show("Die E-Mail wurde erfolgreich verschickt!", "E-Mail verschickt",
|
||||
MessageBox.Show("Die E-Mail wurde erfolgreich verschickt!\n\nEs kann einige Minuten dauern, bis die E-Mail im Posteingang des Empfängers aufscheint.", "E-Mail verschickt",
|
||||
MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
} else if (mode == ExportMode.SavePdf) {
|
||||
var d = new SaveFileDialog() {
|
||||
@@ -654,9 +660,9 @@ namespace Elwig.Helpers {
|
||||
}
|
||||
|
||||
public static async Task<string?> FindSentMailBody(DateTime target) {
|
||||
var dt = $"{target:yyyy-MM-dd_HH-mm-ss}_";
|
||||
var dt = $"{target:yyyy-MM-dd_HH-mm-ss}";
|
||||
var filename = Directory.GetFiles(App.MailsPath, "????-??-??_??-??-??_*.txt")
|
||||
.Where(n => Path.GetFileName(n).CompareTo(dt) <= 0)
|
||||
.Where(n => Path.GetFileName(n)[..19].CompareTo(dt) <= 0)
|
||||
.Order()
|
||||
.LastOrDefault();
|
||||
if (filename == null)
|
||||
|
||||
@@ -9,6 +9,11 @@ using System.Text.Json.Nodes;
|
||||
namespace Elwig.Models.Entities {
|
||||
[Table("delivery_part"), PrimaryKey("Year", "DId", "DPNr")]
|
||||
public class DeliveryPart : IDelivery {
|
||||
|
||||
public const string Dumper = "dumper";
|
||||
public const string Pumped = "pumped";
|
||||
public const string Box = "box";
|
||||
|
||||
[Column("year")]
|
||||
public int Year { get; set; }
|
||||
|
||||
@@ -86,12 +91,27 @@ namespace Elwig.Models.Entities {
|
||||
[Column("hand_picked")]
|
||||
public bool? IsHandPicked { get; set; }
|
||||
|
||||
[Column("lesewagen")]
|
||||
public bool? IsLesewagen { get; set; }
|
||||
|
||||
[Column("gebunden")]
|
||||
public bool? IsGebunden { get; set; }
|
||||
|
||||
[Column("unloading")]
|
||||
public string? Unloading { get; set; }
|
||||
[NotMapped]
|
||||
public bool IsDumper {
|
||||
get => Unloading == Dumper;
|
||||
set => Unloading = value ? Dumper : Unloading;
|
||||
}
|
||||
[NotMapped]
|
||||
public bool IsPumped {
|
||||
get => Unloading == Pumped;
|
||||
set => Unloading = value ? Pumped : Unloading;
|
||||
}
|
||||
[NotMapped]
|
||||
public bool IsBox {
|
||||
get => Unloading == Box;
|
||||
set => Unloading = value ? Box : Unloading;
|
||||
}
|
||||
|
||||
[Column("temperature")]
|
||||
public double? Temperature { get; set; }
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<PublishDir>bin\Publish</PublishDir>
|
||||
<PublishProtocol>FileSystem</PublishProtocol>
|
||||
<_TargetId>Folder</_TargetId>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<TargetFramework>net10.0-windows</TargetFramework>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<SelfContained>true</SelfContained>
|
||||
<PublishSingleFile>false</PublishSingleFile>
|
||||
|
||||
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;
|
||||
6
Elwig/Resources/Sql/34-35.sql
Normal file
6
Elwig/Resources/Sql/34-35.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
-- schema version 34 to 33
|
||||
|
||||
ALTER TABLE delivery_part ADD COLUMN unloading TEXT DEFAULT NULL;
|
||||
UPDATE delivery_part SET unloading = 'pumped' WHERE lesewagen;
|
||||
UPDATE delivery_part SET unloading = 'box' WHERE (SELECT zwstid IN ('H','S') FROM delivery d WHERE (d.year, d.did) = (delivery_part.year, delivery_part.did));
|
||||
ALTER TABLE delivery_part DROP COLUMN lesewagen;
|
||||
@@ -80,9 +80,9 @@ namespace Elwig.Services {
|
||||
vm.PartComment = p.Comment ?? "";
|
||||
vm.TemperatureString = (p.Temperature != null) ? $"{p.Temperature:N1}" : "";
|
||||
vm.AcidString = (p.Acid != null) ? $"{p.Acid:N1}" : "";
|
||||
vm.IsLesewagen = p.IsLesewagen ?? false;
|
||||
vm.IsHandPicked = p.IsHandPicked;
|
||||
vm.IsGebunden = p.IsGebunden;
|
||||
vm.Unloading = p.Unloading;
|
||||
|
||||
vm.ScaleId = p.ScaleId;
|
||||
vm.WeighingData = p.WeighingData;
|
||||
@@ -188,14 +188,38 @@ namespace Elwig.Services {
|
||||
prd = prd.And(p => p.IsNetWeight == true);
|
||||
filter.RemoveAt(i--);
|
||||
filterNames.Add("gerebelt gewogen");
|
||||
} else if (e.Length >= 5 && e.Length <= 11 && "planenwagen".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
|
||||
prd = prd.And(p => p.Unloading == DeliveryPart.Dumper);
|
||||
filter.RemoveAt(i--);
|
||||
filterNames.Add("Planenw./Kipper");
|
||||
} else if (e.Length >= 6 && e.Length <= 12 && "!planenwagen".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
|
||||
prd = prd.And(p => p.Unloading != DeliveryPart.Dumper);
|
||||
filter.RemoveAt(i--);
|
||||
filterNames.Add("kein Planenw./Kipper");
|
||||
} else if (e.Length >= 4 && e.Length <= 6 && "kipper".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
|
||||
prd = prd.And(p => p.Unloading == DeliveryPart.Dumper);
|
||||
filter.RemoveAt(i--);
|
||||
filterNames.Add("Planenw./Kipper");
|
||||
} else if (e.Length >= 5 && e.Length <= 7 && "!kipper".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
|
||||
prd = prd.And(p => p.Unloading != DeliveryPart.Dumper);
|
||||
filter.RemoveAt(i--);
|
||||
filterNames.Add("kein Planenw./Kipper");
|
||||
} else if (e.Length >= 5 && e.Length <= 9 && "lesewagen".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
|
||||
prd = prd.And(p => p.IsLesewagen == true);
|
||||
prd = prd.And(p => p.Unloading == DeliveryPart.Pumped);
|
||||
filter.RemoveAt(i--);
|
||||
filterNames.Add("Lesewagen");
|
||||
} else if (e.Length >= 6 && e.Length <= 10 && "!lesewagen".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
|
||||
prd = prd.And(p => p.IsLesewagen == false);
|
||||
prd = prd.And(p => p.Unloading != DeliveryPart.Pumped);
|
||||
filter.RemoveAt(i--);
|
||||
filterNames.Add("kein Lesewagen");
|
||||
} else if (e.Length >= 5 && e.Length <= 6 && "kisten".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
|
||||
prd = prd.And(p => p.Unloading == DeliveryPart.Box);
|
||||
filter.RemoveAt(i--);
|
||||
filterNames.Add("Kisten");
|
||||
} else if (e.Length >= 6 && e.Length <= 7 && "!kisten".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
|
||||
prd = prd.And(p => p.Unloading != DeliveryPart.Box);
|
||||
filter.RemoveAt(i--);
|
||||
filterNames.Add("keine Kisten");
|
||||
} else if (e.Length == 2 && var.ContainsKey(e.ToUpper())) {
|
||||
filterVar.Add(e.ToUpper());
|
||||
filter.RemoveAt(i--);
|
||||
@@ -483,8 +507,8 @@ namespace Elwig.Services {
|
||||
|
||||
IsNetWeight = vm.IsNetWeight,
|
||||
IsHandPicked = vm.IsHandPicked,
|
||||
IsLesewagen = vm.IsLesewagen,
|
||||
IsGebunden = vm.IsGebunden,
|
||||
Unloading = vm.Unloading,
|
||||
Temperature = vm.Temperature,
|
||||
Acid = vm.Acid,
|
||||
Comment = string.IsNullOrEmpty(vm.PartComment) ? null : vm.PartComment,
|
||||
|
||||
@@ -169,10 +169,28 @@ namespace Elwig.ViewModels {
|
||||
set => AcidString = $"{value:0.0}";
|
||||
}
|
||||
[ObservableProperty]
|
||||
private bool _isLesewagen;
|
||||
[ObservableProperty]
|
||||
private bool? _isHandPicked;
|
||||
|
||||
public string? Unloading {
|
||||
get => IsUnloadingDumper ? DeliveryPart.Dumper : IsUnloadingPumped ? DeliveryPart.Pumped : IsUnloadingBox ? DeliveryPart.Box : null;
|
||||
set {
|
||||
switch (value) {
|
||||
case DeliveryPart.Dumper: IsUnloadingDumper = true; break;
|
||||
case DeliveryPart.Pumped: IsUnloadingPumped = true; break;
|
||||
case DeliveryPart.Box: IsUnloadingBox = true; break;
|
||||
default: IsUnloadingOther = true; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
[ObservableProperty]
|
||||
private bool _isUnloadingDumper;
|
||||
[ObservableProperty]
|
||||
private bool _isUnloadingPumped;
|
||||
[ObservableProperty]
|
||||
private bool _isUnloadingBox;
|
||||
[ObservableProperty]
|
||||
private bool _isUnloadingOther;
|
||||
|
||||
[ObservableProperty]
|
||||
private string _statusMembers = "-";
|
||||
[ObservableProperty]
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -369,8 +369,9 @@
|
||||
<Grid Grid.Row="1" Grid.Column="2">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="0.625*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="0.875*"/>
|
||||
<RowDefinition Height="0.875*"/>
|
||||
<RowDefinition Height="0.25*"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -404,7 +405,7 @@
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="Lieferung" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" Margin="5,5,5,5">
|
||||
<GroupBox Header="Lieferung" Grid.Column="0" Grid.Row="1" Grid.RowSpan="3" Margin="5,5,5,5">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100"/>
|
||||
@@ -563,7 +564,7 @@
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="Sonstiges" Grid.Column="1" Grid.Row="3" Margin="5,5,5,10">
|
||||
<GroupBox Header="Sonstiges" Grid.Column="1" Grid.Row="3" Grid.RowSpan="2" Margin="5,5,5,10">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100"/>
|
||||
@@ -592,18 +593,31 @@
|
||||
TextChanged="TemperatureAcidInput_TextChanged" LostFocus="TemperatureAcidInput_LostFocus"
|
||||
Grid.Column="1" Margin="0,100,10,10" VerticalAlignment="Top"/>
|
||||
|
||||
<CheckBox x:Name="LesewagenInput" IsChecked="{Binding IsLesewagen, Mode=TwoWay}"
|
||||
Content="Lesewagen" Margin="10,75,0,0" Grid.Column="2"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="LesewagenInput_Changed" Unchecked="LesewagenInput_Changed"/>
|
||||
<CheckBox x:Name="HandPickedInput" IsChecked="{Binding IsHandPicked, Mode=TwoWay}"
|
||||
Content="Handlese" Margin="10,105,0,0" Grid.Column="2" IsThreeState="True"
|
||||
Content="Handlese" Margin="10,135,10,0" Grid.Column="0" Grid.ColumnSpan="2" IsThreeState="True"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="HandPickedInput_Changed" Unchecked="HandPickedInput_Changed" Indeterminate="HandPickedInput_Changed"/>
|
||||
|
||||
<RadioButton x:Name="UnloadingDumperInput" GroupName="Unloading" IsChecked="{Binding IsUnloadingDumper, Mode=TwoWay}"
|
||||
Content="Planenw./Kipper" Margin="10,75,0,0" Grid.Column="2"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="UnloadingInput_Checked" Unchecked="UnloadingInput_Unchecked"/>
|
||||
<RadioButton x:Name="UnloadingPumpedInput" GroupName="Unloading" IsChecked="{Binding IsUnloadingPumped, Mode=TwoWay}"
|
||||
Content="Lesewagen" Margin="10,95,0,0" Grid.Column="2"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="UnloadingInput_Checked" Unchecked="UnloadingInput_Unchecked"/>
|
||||
<RadioButton x:Name="UnloadingBoxInput" GroupName="Unloading" IsChecked="{Binding IsUnloadingBox, Mode=TwoWay}"
|
||||
Content="Kiste(n)" Margin="10,115,0,0" Grid.Column="2"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="UnloadingInput_Checked" Unchecked="UnloadingInput_Unchecked"/>
|
||||
<RadioButton x:Name="UnloadingOtherInput" GroupName="Unloading" IsChecked="{Binding IsUnloadingOther, Mode=TwoWay}"
|
||||
Content="Andere/Unbek." Margin="10,135,0,0" Grid.Column="2"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="UnloadingInput_Checked" Unchecked="UnloadingInput_Unchecked"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="Herkunft" Grid.Column="0" Grid.Row="3" Margin="5,5,5,10">
|
||||
<GroupBox Header="Herkunft" Grid.Column="0" Grid.Row="4" Margin="5,5,5,10">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100"/>
|
||||
|
||||
@@ -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;
|
||||
@@ -319,11 +320,16 @@ namespace Elwig.Windows {
|
||||
}
|
||||
|
||||
if (App.Config.WeighingMode == WeighingMode.Box) {
|
||||
LesewagenInput.IsEnabled = false;
|
||||
SetDefaultValue(LesewagenInput, false);
|
||||
SetDefaultValue(UnloadingDumperInput, false);
|
||||
SetDefaultValue(UnloadingPumpedInput, false);
|
||||
SetDefaultValue(UnloadingBoxInput, true);
|
||||
SetDefaultValue(UnloadingOtherInput, false);
|
||||
UnloadingBoxInput.IsChecked = true;
|
||||
} else {
|
||||
LesewagenInput.IsEnabled = true;
|
||||
UnsetDefaultValue(LesewagenInput);
|
||||
UnsetDefaultValue(UnloadingDumperInput);
|
||||
UnsetDefaultValue(UnloadingPumpedInput);
|
||||
UnsetDefaultValue(UnloadingBoxInput);
|
||||
UnsetDefaultValue(UnloadingOtherInput);
|
||||
}
|
||||
|
||||
if (App.Config.WeighingMode != WeighingMode.Net) {
|
||||
@@ -353,8 +359,8 @@ namespace Elwig.Windows {
|
||||
ClearDefaultValues();
|
||||
|
||||
ViewModel.IsNetWeight = App.Config.WeighingMode == WeighingMode.Net;
|
||||
ViewModel.IsLesewagen = false;
|
||||
ViewModel.IsHandPicked = App.Config.WeighingMode != WeighingMode.Net ? true : null;
|
||||
ViewModel.Unloading = null;
|
||||
ViewModel.IsGebunden = null;
|
||||
InitialDefaultInputs();
|
||||
|
||||
@@ -1324,42 +1330,73 @@ namespace Elwig.Windows {
|
||||
|
||||
private void ModifiersInput_SelectionChanged(object sender, SelectionChangedEventArgs evt) {
|
||||
if (!IsEditing && !IsCreating) return;
|
||||
var mod = ModifiersInput.SelectedItems.Cast<Modifier>().ToList();
|
||||
var mod = ViewModel.Modifiers.ToList();
|
||||
var source = ViewModel.ModifiersSource.ToList();
|
||||
if (App.Client.IsMatzen) {
|
||||
var kl = mod.Where(m => m.Name.StartsWith("Klasse "));
|
||||
if (kl.Count() > 1) {
|
||||
App.MainDispatcher.BeginInvoke(() => {
|
||||
foreach (var r in kl.Take(kl.Count() - 1))
|
||||
ModifiersInput.SelectedItems.Remove(r);
|
||||
ViewModel.Modifiers.Remove(r);
|
||||
});
|
||||
}
|
||||
} else if (App.Client.IsWinzerkeller) {
|
||||
if (mod.Any(m => m.Name.Contains("Lesewagen"))) {
|
||||
ViewModel.IsLesewagen = true;
|
||||
} else {
|
||||
ViewModel.IsLesewagen = false;
|
||||
if (source.Any(m => m.Name.Contains("Lesewagen"))) {
|
||||
if (mod.Any(m => m.Name.Contains("Lesewagen"))) {
|
||||
ViewModel.IsUnloadingPumped = true;
|
||||
} else {
|
||||
ViewModel.IsUnloadingPumped = false;
|
||||
}
|
||||
}
|
||||
} else if (App.Client.IsBaden) {
|
||||
if (source.Any(m => m.Name.Contains("Kiste"))) {
|
||||
if (mod.Any(m => m.Name.Contains("Kiste"))) {
|
||||
ViewModel.IsUnloadingBox = true;
|
||||
} else {
|
||||
ViewModel.IsUnloadingBox = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LesewagenInput_Changed(object sender, RoutedEventArgs evt) {
|
||||
private void UnloadingInput_Checked(object sender, RoutedEventArgs evt) {
|
||||
if (!IsEditing && !IsCreating) return;
|
||||
var mod = ModifiersInput.SelectedItems.Cast<Modifier>().ToList();
|
||||
var source = ModifiersInput.ItemsSource.Cast<Modifier>().ToList();
|
||||
var lw = LesewagenInput.IsChecked == true;
|
||||
var mod = ViewModel.Modifiers.ToList();
|
||||
var source = ViewModel.ModifiersSource.ToList();
|
||||
if (App.Client.IsMatzen) {
|
||||
var kl = mod.Where(m => m.Name.StartsWith("Klasse ")).Select(m => m.ModId).LastOrDefault("A")[0];
|
||||
if (lw) kl++; else kl--;
|
||||
var newKl = source.FirstOrDefault(m => m.ModId == kl.ToString());
|
||||
if (newKl != null) ModifiersInput.SelectedItems.Add(newKl);
|
||||
var kl = mod.Where(m => m.Name.StartsWith("Klasse ")).Select(m => m.ModId).LastOrDefault("_")[0];
|
||||
if (ViewModel.IsUnloadingPumped && (kl == 'A' || kl == '_')) {
|
||||
kl = 'B';
|
||||
} else if (ViewModel.IsUnloadingDumper && kl == '_') {
|
||||
kl = 'A';
|
||||
} else {
|
||||
kl = '_';
|
||||
}
|
||||
var newKl = source.FirstOrDefault(m => m?.ModId == kl.ToString(), null);
|
||||
if (newKl != null) ViewModel.Modifiers.Add(newKl);
|
||||
} else if (App.Client.IsWinzerkeller) {
|
||||
if (lw && !mod.Any(m => m.Name.Contains("Lesewagen"))) {
|
||||
ModifiersInput.SelectedItems.Add(source.First(m => m.Name.Contains("Lesewagen")));
|
||||
} else if (!lw && mod.Any(m => m.Name.Contains("Lesewagen"))) {
|
||||
ModifiersInput.SelectedItems.Remove(mod.First(m => m.Name.Contains("Lesewagen")));
|
||||
if (source.Any(m => m.Name.Contains("Lesewagen"))) {
|
||||
if (ViewModel.IsUnloadingPumped && !mod.Any(m => m.Name.Contains("Lesewagen"))) {
|
||||
ViewModel.Modifiers.Add(source.First(m => m.Name.Contains("Lesewagen")));
|
||||
} else if (!ViewModel.IsUnloadingPumped && mod.Any(m => m.Name.Contains("Lesewagen"))) {
|
||||
ViewModel.Modifiers.Remove(mod.First(m => m.Name.Contains("Lesewagen")));
|
||||
}
|
||||
}
|
||||
} else if (App.Client.IsBaden) {
|
||||
if (source.Any(m => m.Name.Contains("Kiste"))) {
|
||||
if (ViewModel.IsUnloadingBox && !mod.Any(m => m.Name.Contains("Kiste"))) {
|
||||
ViewModel.Modifiers.Add(source.First(m => m.Name.Contains("Kiste")));
|
||||
} else if (!ViewModel.IsUnloadingBox && mod.Any(m => m.Name.Contains("Kiste"))) {
|
||||
ViewModel.Modifiers.Remove(mod.First(m => m.Name.Contains("Kiste")));
|
||||
}
|
||||
}
|
||||
}
|
||||
CheckBox_Changed(sender, evt);
|
||||
RadioButton_Changed(sender, evt);
|
||||
}
|
||||
|
||||
private void UnloadingInput_Unchecked(object sender, RoutedEventArgs evt) {
|
||||
if (!IsEditing && !IsCreating) return;
|
||||
RadioButton_Changed(sender, evt);
|
||||
}
|
||||
|
||||
private void UpdateWineOrigin() {
|
||||
|
||||
@@ -929,13 +929,13 @@ namespace Elwig.Windows {
|
||||
await Utils.AddSentMails([(
|
||||
"email", m.MgNr, m.AdministrativeName,
|
||||
m.EmailAddresses.OrderBy(a => a.Nr).Select(a => a.Address).ToArray(),
|
||||
subject,
|
||||
docs.Select(d => d.Title).ToArray()
|
||||
subject, docs.Select(d => d.Title).ToArray()
|
||||
)]);
|
||||
}
|
||||
});
|
||||
|
||||
MessageBox.Show("Erfolgreich alle E-Mails verschickt!", "Rundschreiben verschicken", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
MessageBox.Show("Erfolgreich alle E-Mails verschickt!\n\nEs kann einige Minuten dauern, bis die E-Mails in den Posteingängen der Empfänger aufscheinen.", "Rundschreiben verschicken",
|
||||
MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
} catch (Exception exc) {
|
||||
MessageBox.Show(exc.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
} finally {
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Tests.E2ETests {
|
||||
|
||||
public const int WINDOW_OPEN_SLEEP = 2000;
|
||||
|
||||
public static readonly string ApplicationPath = Path.GetFullPath(@"..\..\..\..\Elwig\bin\Debug\net8.0-windows\Elwig.exe");
|
||||
public static readonly string ApplicationPath = Path.GetFullPath(@"..\..\..\..\Elwig\bin\Debug\net10.0-windows\Elwig.exe");
|
||||
public static readonly string ConfigPath = Path.GetFullPath(@"..\..\..\..\Tests\config.test.ini");
|
||||
public static readonly string TestDatabasePath = Path.GetFullPath(@"..\..\..\..\Tests\ElwigTestDB.sqlite3");
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<TargetFramework>net10.0-windows</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<IsPackable>false</IsPackable>
|
||||
@@ -19,7 +19,7 @@
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
|
||||
<PackageReference Include="Appium.WebDriver" Version="4.4.5" />
|
||||
<PackageReference Include="NReco.PdfRenderer" Version="1.6.0" />
|
||||
<PackageReference Include="NUnit" Version="4.4.0" />
|
||||
|
||||
@@ -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=35" -u "elwig:ganzGeheim123!" -o "Resources\Sql\Create.sql"
|
||||
|
||||
Reference in New Issue
Block a user