Compare commits

...

5 Commits

Author SHA1 Message Date
9a2fa3ee3d Bump version to 0.8.9
All checks were successful
Deploy / Build and Deploy (push) Successful in 2m37s
2024-07-23 20:22:52 +02:00
ba9e1d7201 Export/Ods: Escape strings in XML 2024-07-23 20:13:04 +02:00
49f03c0a3c CheckComboBox: Fix SelectedItems property
All checks were successful
Test / Run tests (push) Successful in 2m12s
2024-07-23 11:08:42 +02:00
37adf92e80 Bump version to 0.8.8
All checks were successful
Test / Run tests (push) Successful in 2m37s
Deploy / Build and Deploy (push) Successful in 2m33s
2024-07-22 09:48:53 +02:00
4c75dbe4aa GassnerScale: Hot fix record parsing 2024-07-22 09:48:18 +02:00
8 changed files with 52 additions and 14 deletions

View File

@ -3,6 +3,31 @@ Changelog
=========
[v0.8.9][v0.8.9] (2024-07-23) {#v0.8.9}
---------------------------------------
### Behobene Fehler {#v0.8.8-bugfixes}
* Absturz im Rundschreiben-Fenster (`MailWindow`). Fehler bei `CheckComboBox`. (49f03c0a3c)
* Excel-Exporte können nun auch Sonderzeichen (wie `&`) enthalten. (ba9e1d7201)
[v0.8.9]: https://git.necronda.net/winzer/elwig/releases/tag/v0.8.9
[v0.8.8][v0.8.8] (2024-07-22) {#v0.8.8}
---------------------------------------
### Behobene Fehler {#v0.8.8-bugfixes}
* Schnittstelle für Gassner-Waagen nicht funktionsfähig. (4c75dbe4aa)
[v0.8.8]: https://git.necronda.net/winzer/elwig/releases/tag/v0.8.8
[v0.8.7][v0.8.7] (2024-07-22) {#v0.8.7}
---------------------------------------

View File

@ -8,7 +8,7 @@ using System.Windows.Controls;
namespace Elwig.Controls {
public class CheckComboBox : ListBox {
public new static readonly DependencyProperty SelectedItemsProperty = DependencyProperty.Register(nameof(SelectedItems), typeof(IList), typeof(CheckComboBox), new FrameworkPropertyMetadata(new ObservableCollection<object>(), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSelectedItemsChangedCallback));
public new static readonly DependencyProperty SelectedItemsProperty = DependencyProperty.Register(nameof(SelectedItems), typeof(IList), typeof(CheckComboBox), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnSelectedItemsChangedCallback));
public new IList SelectedItems {
get => (IList)GetValue(SelectedItemsProperty);
set => SetValue(SelectedItemsProperty, value);
@ -72,6 +72,7 @@ namespace Elwig.Controls {
public CheckComboBox() {
SelectionMode = SelectionMode.Multiple;
SelectedItems = new ObservableCollection<object>();
}
public override void OnApplyTemplate() {

View File

@ -7,7 +7,7 @@
<UseWPF>true</UseWPF>
<PreserveCompilationContext>true</PreserveCompilationContext>
<ApplicationIcon>Resources\Images\Elwig.ico</ApplicationIcon>
<Version>0.8.7</Version>
<Version>0.8.9</Version>
<SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ApplicationManifest>app.manifest</ApplicationManifest>

View File

@ -6,6 +6,7 @@ using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Security;
using System.Threading.Tasks;
namespace Elwig.Helpers.Export {
@ -312,7 +313,7 @@ namespace Elwig.Helpers.Export {
}
c = $"<{ct} office:value-type=\"float\" calcext:value-type=\"float\" office:value=\"{v.ToString(CultureInfo.InvariantCulture)}\"{add}><text:p>{data}</text:p></{ct}>";
} else {
c = $"<{ct} office:value-type=\"string\" calcext:value-type=\"string\"{add}><text:p>{data}</text:p></{ct}>";
c = $"<{ct} office:value-type=\"string\" calcext:value-type=\"string\"{add}><text:p>{SecurityElement.Escape(data.ToString())}</text:p></{ct}>";
}
return $" {c}\r\n" + (colSpan > 1 ? $" <table:covered-table-cell table:number-rows-repeated=\"{colSpan - 1}\"/>\r\n" : "");

View File

@ -60,14 +60,13 @@ namespace Elwig.Helpers.Weighing {
throw new IOException("Invalid response from scale: Received record has invalid size");
var line = record[2..];
var status = line[ 0.. 2];
var brutto = line[ 2.. 9].Trim();
var tara = line[ 9..16].Trim();
var netto = line[16..23].Trim();
var scaleNr = line[23..25].Trim();
var identNr = line[25..31].Trim();
var date = line[31..39];
var time = line[39..45];
var brutto = line[ 0.. 7].Trim();
var tara = line[ 7..14].Trim();
var netto = line[14..21].Trim();
var scaleNr = line[21..23].Trim();
var identNr = line[23..29].Trim();
var date = line[29..37];
var time = line[37..43];
identNr = identNr.Length > 0 && identNr != "0" ? identNr : null;
var parsedDate = DateOnly.ParseExact(date, "yyyyMMdd");

View File

@ -1,5 +1,6 @@
<local:ContextWindow
x:Class="Elwig.Windows.MailWindow"
AutomationProperties.AutomationId="MailWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

View File

@ -139,7 +139,7 @@ namespace Elwig.Windows {
AvaiableDocumentsList.ItemsSource = l;
ControlUtils.RenewItemsSource(MemberBranchInput, await ctx.Branches
.Where(b => b.Members.Any())
.Where(b => b.Members.Count != 0)
.OrderBy(b => b.Name)
.ToListAsync(), MemberInput_SelectionChanged);
if (MemberBranchInput.SelectedItems.Count == 0) {
@ -148,7 +148,7 @@ namespace Elwig.Windows {
MemberBranchInput.SelectionChanged += MemberInput_SelectionChanged;
}
ControlUtils.RenewItemsSource(MemberKgInput, await ctx.Katastralgemeinden
.Where(k => k.WbKg!.Members.Any())
.Where(k => k.WbKg!.Members.Count != 0)
.OrderBy(k => k.Name)
.ToListAsync(), MemberInput_SelectionChanged);
if (MemberKgInput.SelectedItems.Count == 0) {
@ -561,7 +561,7 @@ namespace Elwig.Windows {
double totalNum = printNum + emailNum;
var email = memberDocs
.Where(d => d.Docs.Count > 0 && d.Member.EmailAddresses.Any() && (emailMode == 2 || (emailMode == 1 && d.Member.ContactViaEmail)))
.Where(d => d.Docs.Count > 0 && d.Member.EmailAddresses.Count > 0 && (emailMode == 2 || (emailMode == 1 && d.Member.ContactViaEmail)))
.ToDictionary(d => d.Member, m => {
var docs = m.Docs.Select(d => d.Doc).ToList();
foreach (var doc in docs) {

View File

@ -46,5 +46,16 @@
window.Close();
});
}
[Test]
public void Test_Open_MailWindow() {
Assert.DoesNotThrow(() => {
Session.App.FindElement(By.Name("Rundschreiben")).Click();
Thread.Sleep(Utils.WINDOW_OPEN_SLEEP);
var window = Session.CreateWindowDriver("MailWindow");
Assert.That(window.Title, Is.EqualTo($"Rundschreiben - Lese {Elwig.Helpers.Utils.Today.Year} - Elwig"));
window.Close();
});
}
}
}