Compare commits

..

7 Commits

Author SHA1 Message Date
lorenz.stechauner 3f7cd2a6ff DeliveryAncmtAdminWindow: Focus MgNrInput when creating new ancmt
Test / Run tests (push) Successful in 2m8s
2024-09-19 09:34:44 +02:00
lorenz.stechauner 21a1b11d68 AreaCom: Make YearFrom nullable
Test / Run tests (push) Successful in 1m48s
2024-09-18 18:26:16 +02:00
lorenz.stechauner d8beb03b96 Tests: Update dependencies
Test / Run tests (push) Successful in 1m53s
2024-09-17 23:18:51 +02:00
lorenz.stechauner eee90c784b Elwig: Update dependencies 2024-09-17 23:18:41 +02:00
lorenz.stechauner 74200083ab DeliveryAncmtAdminWindow: Mark cancelled schedules with Strikethrough
Test / Run tests (push) Successful in 1m38s
2024-09-17 23:08:22 +02:00
lorenz.stechauner 871bc299bd Utils: Fix SplitName() for double names
Test / Run tests (push) Successful in 1m46s
2024-09-17 19:18:43 +02:00
lorenz.stechauner a18b58f438 DeliveryAncmtAdminWindow: Make delivery schedule list bigger
Test / Run tests (push) Successful in 2m10s
2024-09-17 19:07:59 +02:00
13 changed files with 49 additions and 23 deletions
+1 -1
View File
@@ -206,7 +206,7 @@
<td class="text">@areaCom.GstNr.Replace(",", ", ").Replace("-", "")</td> <td class="text">@areaCom.GstNr.Replace(",", ", ").Replace("-", "")</td>
<td class="number">@($"{areaCom.Area:N0}")</td> <td class="number">@($"{areaCom.Area:N0}")</td>
<td class="center">@areaCom.WineCult?.Name</td> <td class="center">@areaCom.WineCult?.Name</td>
<td class="center">@(areaCom.YearTo == null ? $"ab {areaCom.YearFrom}" : $"{areaCom.YearFrom}{areaCom.YearTo}")</td> <td class="center">@(areaCom.YearTo == null ? (areaCom.YearFrom == null ? "unbefristet" : $"ab {areaCom.YearFrom}") : (areaCom.YearFrom == null ? $"bis {areaCom.YearTo}" : $"{areaCom.YearFrom}{areaCom.YearTo}"))</td>
</tr> </tr>
lastContract = contractType.AreaComType.DisplayName; lastContract = contractType.AreaComType.DisplayName;
} }
+6 -6
View File
@@ -25,17 +25,17 @@
</Target> </Target>
<ItemGroup> <ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" /> <PackageReference Include="CommunityToolkit.Mvvm" Version="8.3.1" />
<PackageReference Include="LinqKit" Version="1.3.0" /> <PackageReference Include="LinqKit" Version="1.3.0" />
<PackageReference Include="MailKit" Version="4.7.1.1" /> <PackageReference Include="MailKit" Version="4.7.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="6.0.32" /> <PackageReference Include="Microsoft.AspNetCore.Razor.Language" Version="6.0.33" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.7" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="8.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.7" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.8" />
<PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Ini" Version="8.0.0" />
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2592.51" /> <PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2739.15" />
<PackageReference Include="NJsonSchema" Version="11.0.2" /> <PackageReference Include="NJsonSchema" Version="11.0.2" />
<PackageReference Include="RazorLight" Version="2.3.1" /> <PackageReference Include="RazorLight" Version="2.3.1" />
<PackageReference Include="ScottPlot.WPF" Version="5.0.36" /> <PackageReference Include="ScottPlot.WPF" Version="5.0.39" />
<PackageReference Include="System.IO.Ports" Version="8.0.0" /> <PackageReference Include="System.IO.Ports" Version="8.0.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" /> <PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
</ItemGroup> </ItemGroup>
+1 -1
View File
@@ -9,7 +9,7 @@ namespace Elwig.Helpers {
public static class AppDbUpdater { public static class AppDbUpdater {
// Don't forget to update value in Tests/fetch-resources.bat! // Don't forget to update value in Tests/fetch-resources.bat!
public static readonly int RequiredSchemaVersion = 29; public static readonly int RequiredSchemaVersion = 30;
private static int VersionOffset = 0; private static int VersionOffset = 0;
+1 -1
View File
@@ -565,7 +565,7 @@ namespace Elwig.Helpers.Export {
KgNr = kgnr, KgNr = kgnr,
GstNr = json["gstnr"]?.AsValue().GetValue<string>() ?? "-", GstNr = json["gstnr"]?.AsValue().GetValue<string>() ?? "-",
RdNr = rd?.RdNr, RdNr = rd?.RdNr,
YearFrom = json["year_from"]!.AsValue().GetValue<int>(), YearFrom = json["year_from"]?.AsValue().GetValue<int>(),
YearTo = json["year_to"]?.AsValue().GetValue<int>(), YearTo = json["year_to"]?.AsValue().GetValue<int>(),
Comment = json["comment"]?.AsValue().GetValue<string>(), Comment = json["comment"]?.AsValue().GetValue<string>(),
}, newRd ? rd : null); }, newRd ? rd : null);
+5 -3
View File
@@ -348,7 +348,7 @@ namespace Elwig.Helpers {
} }
public static (string, string?) SplitName(string fullName, string? familyName) { public static (string, string?) SplitName(string fullName, string? familyName) {
if (familyName == null || familyName == "") return (fullName, null); if (string.IsNullOrWhiteSpace(familyName)) return (fullName, null);
var p0 = fullName.IndexOf(familyName, StringComparison.CurrentCultureIgnoreCase); var p0 = fullName.IndexOf(familyName, StringComparison.CurrentCultureIgnoreCase);
if (p0 == -1) return (fullName, null); if (p0 == -1) return (fullName, null);
var p1 = fullName.IndexOf(" und "); var p1 = fullName.IndexOf(" und ");
@@ -362,8 +362,10 @@ namespace Elwig.Helpers {
var p3 = fullName.LastIndexOf(' ', p2 - 1); var p3 = fullName.LastIndexOf(' ', p2 - 1);
return (fullName[0..p3], fullName[(p3 + 1)..^0]); return (fullName[0..p3], fullName[(p3 + 1)..^0]);
} }
} else { } else if (p0 + familyName.Length >= fullName.Length || fullName[p0 + familyName.Length] == ' ') {
return (familyName, fullName.Replace(familyName, "").Replace(" ", " ").Trim()); return (familyName, fullName.Replace(familyName, "").Replace(" ", " ").Trim());
} else {
return (fullName, null);
} }
} }
@@ -558,7 +560,7 @@ namespace Elwig.Helpers {
public static Expression<Func<AreaCom, bool>> ActiveAreaCommitments() => ActiveAreaCommitments(CurrentYear); public static Expression<Func<AreaCom, bool>> ActiveAreaCommitments() => ActiveAreaCommitments(CurrentYear);
public static Expression<Func<AreaCom, bool>> ActiveAreaCommitments(int year) => public static Expression<Func<AreaCom, bool>> ActiveAreaCommitments(int year) =>
c => (c.YearFrom <= year) && (c.YearTo == null || c.YearTo >= year); c => (c.YearFrom == null || c.YearFrom <= year) && (c.YearTo == null || c.YearTo >= year);
public static IQueryable<AreaCom> ActiveAreaCommitments(IQueryable<AreaCom> query) => ActiveAreaCommitments(query, CurrentYear); public static IQueryable<AreaCom> ActiveAreaCommitments(IQueryable<AreaCom> query) => ActiveAreaCommitments(query, CurrentYear);
public static IQueryable<AreaCom> ActiveAreaCommitments(IQueryable<AreaCom> query, int year) => public static IQueryable<AreaCom> ActiveAreaCommitments(IQueryable<AreaCom> query, int year) =>
+1 -1
View File
@@ -32,7 +32,7 @@ namespace Elwig.Models.Entities {
public int? RdNr { get; set; } public int? RdNr { get; set; }
[Column("year_from")] [Column("year_from")]
public int YearFrom { get; set; } public int? YearFrom { get; set; }
[Column("year_to")] [Column("year_to")]
public int? YearTo { get; set; } public int? YearTo { get; set; }
@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq; using System.Linq;
using System.Windows;
namespace Elwig.Models.Entities { namespace Elwig.Models.Entities {
[Table("delivery_schedule"), PrimaryKey("Year", "DsNr")] [Table("delivery_schedule"), PrimaryKey("Year", "DsNr")]
@@ -47,6 +48,8 @@ namespace Elwig.Models.Entities {
[Column("cancelled")] [Column("cancelled")]
public bool IsCancelled { get; set; } public bool IsCancelled { get; set; }
[NotMapped]
public TextDecorationCollection? TextDecoration => IsCancelled ? TextDecorations.Strikethrough : null;
[Column("ancmt_from")] [Column("ancmt_from")]
public long? AncmtFromUnix { get; set; } public long? AncmtFromUnix { get; set; }
+18
View File
@@ -0,0 +1,18 @@
-- schema version 29 to 30
PRAGMA writable_schema = ON;
DROP VIEW v_bki_member;
CREATE VIEW v_bki_member AS
SELECT s.year, m.mgnr, m.lfbis_nr, m.name,
(COALESCE(m.prefix || ' ', '') || m.given_name || COALESCE(' ' || m.middle_names, '') || COALESCE(' ' || m.suffix, '')) AS other_names,
a.name AS billing_name, COALESCE(a.address, m.address) AS address,
COALESCE(a.country, m.country) AS country, COALESCE(a.postal_dest, m.postal_dest) AS postal_dest,
SUM(COALESCE(IIF((c.year_from IS NULL OR c.year_from <= s.year) AND (c.year_to IS NULL OR c.year_to >= s.year), c.area, NULL), 0)) AS area
FROM season s, member m
LEFT JOIN member_billing_address a ON a.mgnr = m.mgnr
LEFT JOIN area_commitment c ON c.mgnr = m.mgnr
GROUP BY s.year, m.mgnr;
PRAGMA schema_version = 2901;
PRAGMA writable_schema = OFF;
+1 -1
View File
@@ -106,7 +106,7 @@ namespace Elwig.Services {
var a = new AreaCom { var a = new AreaCom {
FbNr = oldFbNr ?? newFbNr, FbNr = oldFbNr ?? newFbNr,
MgNr = (int)vm.MgNr!, MgNr = (int)vm.MgNr!,
YearFrom = (int)vm.YearFrom!, YearFrom = vm.YearFrom,
YearTo = vm.YearTo, YearTo = vm.YearTo,
VtrgId = vm.AreaComType!.VtrgId, VtrgId = vm.AreaComType!.VtrgId,
CultId = vm.WineCult?.CultId, CultId = vm.WineCult?.CultId,
+3 -3
View File
@@ -84,7 +84,7 @@
<RowDefinition Height="42"/> <RowDefinition Height="42"/>
<RowDefinition Height="1*" MinHeight="100"/> <RowDefinition Height="1*" MinHeight="100"/>
<RowDefinition Height="5"/> <RowDefinition Height="5"/>
<RowDefinition Height="2*" MinHeight="100"/> <RowDefinition Height="1*" MinHeight="100"/>
<RowDefinition Height="42"/> <RowDefinition Height="42"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
@@ -129,7 +129,7 @@
<TextBlock Text="{Binding Date, StringFormat='ddd.'}" Width="24"/> <TextBlock Text="{Binding Date, StringFormat='ddd.'}" Width="24"/>
<TextBlock Text="{Binding Date, StringFormat='dd.MM.'}" Width="32"/> <TextBlock Text="{Binding Date, StringFormat='dd.MM.'}" Width="32"/>
<TextBlock Text="{Binding ZwstId}" Width="25" TextAlignment="Center"/> <TextBlock Text="{Binding ZwstId}" Width="25" TextAlignment="Center"/>
<TextBlock Text="{Binding Description}" Width="200"/> <TextBlock Text="{Binding Description}" Width="200" TextDecorations="{Binding TextDecoration}"/>
<TextBlock TextAlignment="Right"> <TextBlock TextAlignment="Right">
<TextBlock Text="{Binding AnnouncedWeight, StringFormat='{}{0:N0}'}" Width="42" TextAlignment="Right"/> kg <TextBlock Text="{Binding AnnouncedWeight, StringFormat='{}{0:N0}'}" Width="42" TextAlignment="Right"/> kg
/ <TextBlock Text="{Binding MaxWeight, StringFormat='{}{0:N0}'}" Width="42" TextAlignment="Right"/> kg / <TextBlock Text="{Binding MaxWeight, StringFormat='{}{0:N0}'}" Width="42" TextAlignment="Right"/> kg
@@ -288,7 +288,7 @@
<TextBlock Text="{Binding Date, StringFormat='ddd.'}" Width="28"/> <TextBlock Text="{Binding Date, StringFormat='ddd.'}" Width="28"/>
<TextBlock Text="{Binding Date, StringFormat='dd.MM.'}" Width="35"/> <TextBlock Text="{Binding Date, StringFormat='dd.MM.'}" Width="35"/>
<TextBlock Text="{Binding ZwstId}" Width="30" TextAlignment="Center"/> <TextBlock Text="{Binding ZwstId}" Width="30" TextAlignment="Center"/>
<TextBlock Text="{Binding Description}"/> <TextBlock Text="{Binding Description}" TextDecorations="{Binding TextDecoration}"/>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
@@ -276,6 +276,9 @@ namespace Elwig.Windows {
InitInputs(); InitInputs();
ViewModel.MgNr = mgnr; ViewModel.MgNr = mgnr;
ViewModel.EnableSearchInputs = false; ViewModel.EnableSearchInputs = false;
MgNrInput.Focus();
MgNrInput.SelectAll();
} }
protected override void ShortcutEdit() { protected override void ShortcutEdit() {
+5 -5
View File
@@ -19,12 +19,12 @@
</Target> </Target>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Appium.WebDriver" Version="4.4.5" /> <PackageReference Include="Appium.WebDriver" Version="4.4.5" />
<PackageReference Include="NReco.PdfRenderer" Version="1.5.3" /> <PackageReference Include="NReco.PdfRenderer" Version="1.5.4" />
<PackageReference Include="NUnit" Version="4.1.0" /> <PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" /> <PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.2.0"> <PackageReference Include="NUnit.Analyzers" Version="4.3.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
+1 -1
View File
@@ -1 +1 @@
curl --fail -s -L "https://elwig.at/files/create.sql?v=29" -u "elwig:ganzGeheim123!" -o "Resources\Sql\Create.sql" curl --fail -s -L "https://elwig.at/files/create.sql?v=30" -u "elwig:ganzGeheim123!" -o "Resources\Sql\Create.sql"