Compare commits
31 Commits
Author | SHA1 | Date | |
---|---|---|---|
7ef3faa39e | |||
8c8c0a8c2b | |||
78a72c641f | |||
e18bc58b6c | |||
21f68caf4c | |||
2ef10b4bb2 | |||
5321be46c7 | |||
0f24f9da08 | |||
8ce8492c74 | |||
ee1315929c | |||
9930e6173c | |||
b5c1bfb08f | |||
cd2b482b5a | |||
bec1b165bf | |||
2ae2564647 | |||
adbe418b7c | |||
94db0723c5 | |||
f54677d429 | |||
49e4b65c27 | |||
ada5085cae | |||
85931e62e8 | |||
39956cbcbd | |||
84d8d0cecb | |||
fe7f9d675b | |||
9d1ee8638c | |||
cd40075702 | |||
204dfe8745 | |||
f97dfc3c72 | |||
d3839c288a | |||
2764a0ca21 | |||
48970de652 |
102
CHANGELOG.md
102
CHANGELOG.md
@ -3,6 +3,108 @@ Changelog
|
|||||||
=========
|
=========
|
||||||
|
|
||||||
|
|
||||||
|
[v0.10.6][v0.10.6] (2024-08-30) {#v0.10.6}
|
||||||
|
------------------------------------------
|
||||||
|
|
||||||
|
### Behobene Fehler {#v0.10.6-bugfixes}
|
||||||
|
|
||||||
|
* Der Titel des Flächenbindungs-Fensters (`AreaComAdminWindow`) ist jetzt _Flächenbindungen_, nicht mehr _Lieferungen_. (ee1315929c)
|
||||||
|
* Im Auszahlungsvariante-Fenster (`ChartWindow`) einen Skalierungs-Fehler behoben. ([#33][i33])
|
||||||
|
* Versuch: Fehler bei automatischer Daten-Erneuerung bei längerer Benutzung. (8c8c0a8c2b)
|
||||||
|
|
||||||
|
### Sonstiges {#v0.10.6-misc}
|
||||||
|
|
||||||
|
* SQL-Queries für Auszahlung-Anpassen-Fenster (`PaymentAdjustmentWindow`) und Über-/Unterlieferungen effizienter umgeschrieben. (9930e6173c)
|
||||||
|
* Im Haupt-Fenster (`MainWindow`) den Menüpunkt _Waagen_ zu _Waage_ geändert. (8ce8492c74)
|
||||||
|
* Im Übernahme-Fenster (`DeliveryAdminWindow`) wird in der Teil-Lieferungen-Liste immer die letzte Teil-Lieferung angezeigt. (2ef10b4bb2)
|
||||||
|
* Breite des Traubenanmeldungen-Fensters (`DeliveryAncmtAdminWindow`) leicht erhöht und Fehler beim Enter-Drücken im _Gewicht_ Eingabefeld. (21f68caf4c, e18bc58b6c)
|
||||||
|
* Im Mitglieder-Fenster (`MemberAdminWindow`) wird das ändern der Kontaktart E-Mail wieder farblich hervorgehoben. (78a72c641f)
|
||||||
|
|
||||||
|
[v0.10.6]: https://git.necronda.net/winzer/elwig/releases/tag/v0.10.6
|
||||||
|
[i33]: https://git.necronda.net/winzer/elwig/issues/33
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[v0.10.5][v0.10.5] (2024-08-24) {#v0.10.5}
|
||||||
|
------------------------------------------
|
||||||
|
|
||||||
|
### Neue Funktionen {#v0.10.5-features}
|
||||||
|
|
||||||
|
* Im Mitglieder-Fenster (`MemberAdminWindow`) kann der Benutzer beim Übertragen von Flächenbindungen entscheiden, ob der Beginn der Laufzeit übernommen werden soll, oder nicht. (bec1b165bf)
|
||||||
|
* Im Haupt-Fenster (`MainWindow`) ist es nun möglich für Waagen vom Typ `SysTec-IT` Datum und Uhrzeit festzulegen. (cd2b482b5a)
|
||||||
|
|
||||||
|
### Sonstiges {#v0.10.5-misc}
|
||||||
|
|
||||||
|
* Abstände in der Statusleiste im Anmeldungen-Fenster (`DeliveryAncmtAdminWindow`). (adbe418b7c)
|
||||||
|
* Im Anmeldungen-Fenster (`DeliveryAncmtAdminWindow`) scheinen keine Warnungen mehr auf, wenn ein nicht-optionales Feld nicht ausgefüllt wurde. (2ae2564647)
|
||||||
|
|
||||||
|
[v0.10.5]: https://git.necronda.net/winzer/elwig/releases/tag/v0.10.5
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[v0.10.4][v0.10.4] (2024-08-22) {#v0.10.4}
|
||||||
|
------------------------------------------
|
||||||
|
|
||||||
|
### Sonstiges {#v0.10.4-misc}
|
||||||
|
|
||||||
|
* Im Anmeldungen-Fenster (`DeliveryAncmtAdminWindow`) wird der Wochentag auch beim Bearbeiten angezeigt. (85931e62e8)
|
||||||
|
* Im Mitglieder-Fenster (`MemberAdminWindow`) werden Anzahl der Mitglieder und Geschäftsanteile nicht mehr von allen aktiven angezeigt, sonder von den momentan gefilterten. (49e4b65c27)
|
||||||
|
* Statusleiste im Anmeldungen-Fenster (`DeliveryAncmtAdminWindow`). (f54677d429)
|
||||||
|
|
||||||
|
[v0.10.4]: https://git.necronda.net/winzer/elwig/releases/tag/v0.10.4
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[v0.10.3][v0.10.3] (2024-08-21) {#v0.10.3}
|
||||||
|
------------------------------------------
|
||||||
|
|
||||||
|
### Behobene Fehler {#v0.10.3-bugfixes}
|
||||||
|
|
||||||
|
* Datum für _Anmeldungen bis_ im Leseplan-Fenster (`DeliveryScheduleAdminWindow`) ab jetzt änderbar. (84d8d0cecb)
|
||||||
|
|
||||||
|
### Sonstiges {#v0.10.3-misc}
|
||||||
|
|
||||||
|
* Wochentag bei Leseplan-Liste im Anmeldungen-Fenster (`DeliveryAncmtAdminWindow`) anzeigen. (fe7f9d675b)
|
||||||
|
|
||||||
|
[v0.10.3]: https://git.necronda.net/winzer/elwig/releases/tag/v0.10.3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[v0.10.2][v0.10.2] (2024-08-16) {#v0.10.2}
|
||||||
|
------------------------------------------
|
||||||
|
|
||||||
|
### Behobene Fehler {#v0.10.2-bugfixes}
|
||||||
|
|
||||||
|
* Beim Hochladen der Mitgliederdaten sind Flächenbindungen nicht mitexportiert worden. (204dfe8745)
|
||||||
|
* Beim Importieren von älteren Exportdaten kam es zu einem Fehler. (cd40075702)
|
||||||
|
|
||||||
|
[v0.10.2]: https://git.necronda.net/winzer/elwig/releases/tag/v0.10.2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[v0.10.1][v0.10.1] (2024-08-14) {#v0.10.1}
|
||||||
|
------------------------------------------
|
||||||
|
|
||||||
|
### Neue Funktionen {#v0.10.1-features}
|
||||||
|
|
||||||
|
* In der Mitglieder-Liste (PDF und Excel) werden ggf. gefilterte Flächenbindungen angegeben. (d3839c288a)
|
||||||
|
|
||||||
|
### Behobene Fehler {#v0.10.1-bugfixes}
|
||||||
|
|
||||||
|
* Fehler beim Berechnen...
|
||||||
|
* falls in Saison keine Lieferungen vorhanden sind. (48970de652)
|
||||||
|
* falls der Vorname eines Mitgliedes nicht gesetzt ist. (2764a0ca21)
|
||||||
|
|
||||||
|
[v0.10.1]: https://git.necronda.net/winzer/elwig/releases/tag/v0.10.1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[v0.10.0][v0.10.0] (2024-08-13) {#v0.10.0}
|
[v0.10.0][v0.10.0] (2024-08-13) {#v0.10.0}
|
||||||
------------------------------------------
|
------------------------------------------
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ namespace Elwig {
|
|||||||
public static Dispatcher MainDispatcher { get; private set; }
|
public static Dispatcher MainDispatcher { get; private set; }
|
||||||
private DateTime LastChanged;
|
private DateTime LastChanged;
|
||||||
private static DateTime CurrentLastWrite => File.GetLastWriteTime(Config.DatabaseFile);
|
private static DateTime CurrentLastWrite => File.GetLastWriteTime(Config.DatabaseFile);
|
||||||
private readonly DispatcherTimer ContextTimer = new() { Interval = TimeSpan.FromSeconds(2) };
|
private readonly DispatcherTimer ContextTimer = new() { Interval = TimeSpan.FromSeconds(5) };
|
||||||
|
|
||||||
public App() : base() {
|
public App() : base() {
|
||||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||||
@ -70,8 +70,9 @@ namespace Elwig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ContextTimer.Tick += (object? sender, EventArgs evt) => {
|
ContextTimer.Tick += (object? sender, EventArgs evt) => {
|
||||||
if (CurrentLastWrite > LastChanged) {
|
var ch = CurrentLastWrite;
|
||||||
LastChanged = CurrentLastWrite;
|
if (ch > LastChanged) {
|
||||||
|
LastChanged = ch;
|
||||||
OnContextChanged();
|
OnContextChanged();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
ResizeMode="NoResize" ShowInTaskbar="False" Topmost="True"
|
ResizeMode="NoResize" ShowInTaskbar="False" Topmost="True"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
||||||
Title="Flächenbindungen übertragen" Height="230" Width="450">
|
Title="Flächenbindungen übertragen" Height="260" Width="450">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<Style TargetType="Label">
|
<Style TargetType="Label">
|
||||||
<Setter Property="HorizontalAlignment" Value="Left"/>
|
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||||
@ -48,11 +48,15 @@
|
|||||||
Minimum="1900" Maximum="9999"
|
Minimum="1900" Maximum="9999"
|
||||||
HorizontalAlignment="Center" VerticalAlignment="Top"
|
HorizontalAlignment="Center" VerticalAlignment="Top"
|
||||||
TextChanged="SeasonInput_TextChanged"/>
|
TextChanged="SeasonInput_TextChanged"/>
|
||||||
|
<CheckBox x:Name="CopyYearToInput" Content="Beginn der Laufzeit von Vorgänger übernehmen" Margin="0,80,0,0"
|
||||||
|
HorizontalAlignment="Center" VerticalAlignment="Top"
|
||||||
|
Checked="CopyYearToInput_Changed" Unchecked="CopyYearToInput_Changed"
|
||||||
|
IsChecked="{Binding MaintainYearTo}"/>
|
||||||
|
|
||||||
<TextBlock x:Name="DescBlock1" Margin="0,85,0,0" TextAlignment="Center"
|
<TextBlock x:Name="DescBlock1" Margin="0,105,0,0" TextAlignment="Center"
|
||||||
HorizontalAlignment="Center" VerticalAlignment="Top">
|
HorizontalAlignment="Center" VerticalAlignment="Top">
|
||||||
Die Flächenbindungen beim <Bold>Vorgänger</Bold> sind bis inkl. Saison <Bold><Run x:Name="CancelSeason1"/></Bold> gültig,<LineBreak/>
|
Die Flächenbindungen beim <Bold>Vorgänger</Bold> sind bis inkl. Saison <Bold><Run x:Name="CancelSeason1"/></Bold> gültig,<LineBreak/>
|
||||||
und werden beim <Bold>Nachfolger</Bold> ab inkl. Saison <Bold><Run x:Name="TransferSeason"/></Bold> übernommen.
|
und werden beim <Bold>Nachfolger</Bold> ab <Run x:Name="DescBlock1Season" Text="inkl. Saison "/><Bold><Run x:Name="TransferSeason"/></Bold> übernommen.
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
<TextBlock x:Name="DescBlock2" Margin="0,70,0,0" TextAlignment="Center" Visibility="Hidden"
|
<TextBlock x:Name="DescBlock2" Margin="0,70,0,0" TextAlignment="Center" Visibility="Hidden"
|
||||||
HorizontalAlignment="Center" VerticalAlignment="Top">
|
HorizontalAlignment="Center" VerticalAlignment="Top">
|
||||||
|
@ -7,6 +7,7 @@ namespace Elwig.Dialogs {
|
|||||||
|
|
||||||
public int CancelSeason { get; set; }
|
public int CancelSeason { get; set; }
|
||||||
public int SuccessorSeason => CancelSeason + 1;
|
public int SuccessorSeason => CancelSeason + 1;
|
||||||
|
public bool MaintainYearTo { get; set; }
|
||||||
|
|
||||||
public string AreaComNum { get; set; }
|
public string AreaComNum { get; set; }
|
||||||
public string Area { get; set; }
|
public string Area { get; set; }
|
||||||
@ -22,6 +23,7 @@ namespace Elwig.Dialogs {
|
|||||||
QuestionBlock2.Visibility = Visibility.Visible;
|
QuestionBlock2.Visibility = Visibility.Visible;
|
||||||
DescBlock1.Visibility = Visibility.Hidden;
|
DescBlock1.Visibility = Visibility.Hidden;
|
||||||
DescBlock2.Visibility = Visibility.Visible;
|
DescBlock2.Visibility = Visibility.Visible;
|
||||||
|
CopyYearToInput.Visibility = Visibility.Hidden;
|
||||||
Height = 240;
|
Height = 240;
|
||||||
SeasonInput.Margin = new(0, 40, 0, 0);
|
SeasonInput.Margin = new(0, 40, 0, 0);
|
||||||
SeasonLabel.Margin = new(0, 40, 100, 0);
|
SeasonLabel.Margin = new(0, 40, 100, 0);
|
||||||
@ -41,7 +43,13 @@ namespace Elwig.Dialogs {
|
|||||||
CancelSeason = (int)SeasonInput.Value!;
|
CancelSeason = (int)SeasonInput.Value!;
|
||||||
CancelSeason1.Text = $"{CancelSeason}";
|
CancelSeason1.Text = $"{CancelSeason}";
|
||||||
CancelSeason2.Text = $"{CancelSeason}";
|
CancelSeason2.Text = $"{CancelSeason}";
|
||||||
TransferSeason.Text = $"{SuccessorSeason}";
|
TransferSeason.Text = MaintainYearTo ? "" : $"{SuccessorSeason}";
|
||||||
|
DescBlock1Season.Text = MaintainYearTo ? "dem originalen Beginn der FB" : "inkl. Saison ";
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CopyYearToInput_Changed(object sender, RoutedEventArgs evt) {
|
||||||
|
TransferSeason.Text = MaintainYearTo ? "" : $"{SuccessorSeason}";
|
||||||
|
DescBlock1Season.Text = MaintainYearTo ? "dem originalen Beginn der FB" : "inkl. Saison ";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ConfirmButton_Click(object sender, RoutedEventArgs evt) {
|
private void ConfirmButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using Elwig.Models.Dtos;
|
using Elwig.Models.Dtos;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace Elwig.Documents {
|
namespace Elwig.Documents {
|
||||||
public class MemberList : Document {
|
public class MemberList : Document {
|
||||||
@ -9,9 +10,17 @@ namespace Elwig.Documents {
|
|||||||
public string Filter;
|
public string Filter;
|
||||||
public IEnumerable<MemberListRow> Members;
|
public IEnumerable<MemberListRow> Members;
|
||||||
|
|
||||||
|
public string[] AreaComFilters;
|
||||||
|
public bool FilterAreaComs => AreaComFilters.Length > 0;
|
||||||
|
|
||||||
public MemberList(string filter, IEnumerable<MemberListRow> members) : base(Name) {
|
public MemberList(string filter, IEnumerable<MemberListRow> members) : base(Name) {
|
||||||
Filter = filter;
|
Filter = filter;
|
||||||
Members = members;
|
Members = members;
|
||||||
|
AreaComFilters = [..members
|
||||||
|
.SelectMany(m => m.AreaCommitmentsFiltered)
|
||||||
|
.Select(c => c.VtrgId)
|
||||||
|
.Distinct()
|
||||||
|
.Order()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public MemberList(string filter, MemberListData data) :
|
public MemberList(string filter, MemberListData data) :
|
||||||
|
@ -8,30 +8,61 @@
|
|||||||
<h2>@Model.Filter</h2>
|
<h2>@Model.Filter</h2>
|
||||||
<table class="members">
|
<table class="members">
|
||||||
<colgroup>
|
<colgroup>
|
||||||
<col style="width: 8mm;"/>
|
|
||||||
<col style="width: 42mm;"/>
|
|
||||||
<col style="width: 40mm;"/>
|
|
||||||
<col style="width: 8mm;"/>
|
<col style="width: 8mm;"/>
|
||||||
<col style="width: 20mm;"/>
|
@if (Model.AreaComFilters.Length > 1) {
|
||||||
|
<col style="width: 38mm;"/>
|
||||||
|
} else {
|
||||||
|
<col style="width: 42mm;"/>
|
||||||
|
}
|
||||||
|
@if (Model.AreaComFilters.Length > 1) {
|
||||||
|
<col style="width: 36mm;"/>
|
||||||
|
} else {
|
||||||
|
<col style="width: 40mm;"/>
|
||||||
|
}
|
||||||
|
<col style="width: 8mm;"/>
|
||||||
|
@if (Model.AreaComFilters.Length > 1) {
|
||||||
|
<col style="width: 18mm;"/>
|
||||||
|
} else {
|
||||||
|
<col style="width: 20mm;"/>
|
||||||
|
}
|
||||||
<col style="width: 12mm;"/>
|
<col style="width: 12mm;"/>
|
||||||
<col style="width: 5mm;" />
|
<col style="width: 5mm;"/>
|
||||||
<col style="width: 18mm;"/>
|
@if (Model.AreaComFilters.Length > 1) {
|
||||||
|
<col style="width: 16mm;"/>
|
||||||
|
} else {
|
||||||
|
<col style="width: 18mm;"/>
|
||||||
|
}
|
||||||
<col style="width: 12mm;"/>
|
<col style="width: 12mm;"/>
|
||||||
|
@if (Model.AreaComFilters.Length > 1) {
|
||||||
|
<col style="width: 12mm;"/>
|
||||||
|
}
|
||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th rowspan="2">Nr.</th>
|
@{
|
||||||
<th rowspan="2" style="text-align: left;">Name</th>
|
var headerSpan = Model.FilterAreaComs ? 3 : 2;
|
||||||
<th rowspan="2" style="text-align: left;">Adresse</th>
|
}
|
||||||
<th rowspan="2">PLZ</th>
|
<th rowspan="@headerSpan">Nr.</th>
|
||||||
<th rowspan="2" style="text-align: left;">Ort</th>
|
<th rowspan="@headerSpan" style="text-align: left;">Name</th>
|
||||||
<th rowspan="2">Betr.-Nr.</th>
|
<th rowspan="@headerSpan" style="text-align: left;">Adresse</th>
|
||||||
<th rowspan="2">GA</th>
|
<th rowspan="@headerSpan">PLZ</th>
|
||||||
<th rowspan="2" style="text-align: left;">Stamm-KG</th>
|
<th rowspan="@headerSpan" style="text-align: left;">Ort</th>
|
||||||
<th>Geb. Fl.</th>
|
<th rowspan="@headerSpan">Betr.-Nr.</th>
|
||||||
|
<th rowspan="@headerSpan">GA</th>
|
||||||
|
<th rowspan="@headerSpan" style="text-align: left;">Stamm-KG</th>
|
||||||
|
<th colspan="@(Model.FilterAreaComs ? Model.AreaComFilters.Length : 1)">Geb. Fl.</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@if (Model.FilterAreaComs) {
|
||||||
|
<tr>
|
||||||
|
@foreach (var vtrgId in Model.AreaComFilters) {
|
||||||
|
<th>@vtrgId</th>
|
||||||
|
}
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
<tr>
|
<tr>
|
||||||
<th class="unit">[m²]</th>
|
@for (int i = 0; i < Math.Max(Model.AreaComFilters.Length, 1); i++) {
|
||||||
|
<th class="unit">[m²]</th>
|
||||||
|
}
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody class="small">
|
<tbody class="small">
|
||||||
@ -40,22 +71,28 @@
|
|||||||
}
|
}
|
||||||
@foreach (var m in Model.Members) {
|
@foreach (var m in Model.Members) {
|
||||||
if (lastBranch != null && m.Branch != lastBranch) {
|
if (lastBranch != null && m.Branch != lastBranch) {
|
||||||
<tr class="spacing"><td colspan="9"></td></tr>
|
<tr class="spacing"><td colspan="@(8 + Math.Max(Model.AreaComFilters.Length, 1))"></td></tr>
|
||||||
<tr class="header">
|
<tr class="header">
|
||||||
<th colspan="9">@m.Branch</th>
|
<th colspan="@(8 + Math.Max(Model.AreaComFilters.Length, 1))">@m.Branch</th>
|
||||||
</tr>
|
</tr>
|
||||||
lastBranch = m.Branch;
|
lastBranch = m.Branch;
|
||||||
}
|
}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="number" rowspan="@(m.BillingName != null ? 2 : 1)">@m.MgNr</td>
|
<td class="number" rowspan="@(m.BillingName != null ? 2 : 1)">@m.MgNr</td>
|
||||||
<td>@m.Name1.Replace('ß', 'ẞ').ToUpper() @m.Name2</td>
|
<td>@m.AdminName1 @m.Name2</td>
|
||||||
<td>@m.Address</td>
|
<td>@m.Address</td>
|
||||||
<td>@m.Plz</td>
|
<td>@m.Plz</td>
|
||||||
<td class="tiny">@m.Locality</td>
|
<td class="tiny">@m.Locality</td>
|
||||||
<td>@m.LfbisNr</td>
|
<td>@m.LfbisNr</td>
|
||||||
<td class="number">@m.BusinessShares</td>
|
<td class="number">@m.BusinessShares</td>
|
||||||
<td class="tiny">@m.DefaultKg</td>
|
<td class="tiny">@m.DefaultKg</td>
|
||||||
<td class="number">@($"{m.AreaCommitment:N0}")</td>
|
@if (Model.AreaComFilters.Length > 0) {
|
||||||
|
foreach (var v in Model.AreaComFilters) {
|
||||||
|
<td class="number">@($"{m.AreaCommitmentsFiltered.FirstOrDefault(c => c.VtrgId == v).Area:N0}")</td>
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
<td class="number">@($"{m.AreaCommitment:N0}")</td>
|
||||||
|
}
|
||||||
</tr>
|
</tr>
|
||||||
if (m.BillingName != null) {
|
if (m.BillingName != null) {
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||||
<ApplicationIcon>Resources\Images\Elwig.ico</ApplicationIcon>
|
<ApplicationIcon>Resources\Images\Elwig.ico</ApplicationIcon>
|
||||||
<Version>0.10.0</Version>
|
<Version>0.10.6</Version>
|
||||||
<SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages>
|
<SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
|
@ -157,13 +157,15 @@ namespace Elwig.Helpers.Billing {
|
|||||||
lastMgNr = mgnr;
|
lastMgNr = mgnr;
|
||||||
}
|
}
|
||||||
|
|
||||||
await AppDbContext.ExecuteBatch(cnx, $"""
|
await AppDbContext.ExecuteBatch(cnx, $"UPDATE delivery_part_bucket SET value = 0 WHERE year = {Year}");
|
||||||
UPDATE delivery_part_bucket SET value = 0 WHERE year = {Year};
|
if (inserts.Count > 0) {
|
||||||
INSERT INTO delivery_part_bucket (year, did, dpnr, bktnr, discr, value)
|
await AppDbContext.ExecuteBatch(cnx, $"""
|
||||||
VALUES {string.Join(",\n ", inserts.Select(i => $"({Year}, {i.Item1}, {i.Item2}, {i.Item3}, '{i.Item4}', {i.Item5})"))}
|
INSERT INTO delivery_part_bucket (year, did, dpnr, bktnr, discr, value)
|
||||||
ON CONFLICT DO UPDATE
|
VALUES {string.Join(",\n ", inserts.Select(i => $"({Year}, {i.Item1}, {i.Item2}, {i.Item3}, '{i.Item4}', {i.Item5})"))}
|
||||||
SET discr = excluded.discr, value = value + excluded.value;
|
ON CONFLICT DO UPDATE
|
||||||
""");
|
SET discr = excluded.discr, value = value + excluded.value;
|
||||||
|
""");
|
||||||
|
}
|
||||||
|
|
||||||
if (!avoidUnderDlvrs) {
|
if (!avoidUnderDlvrs) {
|
||||||
if (ownCnx) await cnx.DisposeAsync();
|
if (ownCnx) await cnx.DisposeAsync();
|
||||||
|
@ -39,6 +39,7 @@ namespace Elwig.Helpers.Export {
|
|||||||
Dictionary<int, int> currentDids;
|
Dictionary<int, int> currentDids;
|
||||||
Dictionary<string, int> currentLsNrs;
|
Dictionary<string, int> currentLsNrs;
|
||||||
Dictionary<int, List<WbRd>> currentWbRde;
|
Dictionary<int, List<WbRd>> currentWbRde;
|
||||||
|
Dictionary<int, AT_Kg> kgs;
|
||||||
|
|
||||||
using (var ctx = new AppDbContext()) {
|
using (var ctx = new AppDbContext()) {
|
||||||
branches = await ctx.Branches.ToDictionaryAsync(b => b.ZwstId);
|
branches = await ctx.Branches.ToDictionaryAsync(b => b.ZwstId);
|
||||||
@ -50,6 +51,7 @@ namespace Elwig.Helpers.Export {
|
|||||||
currentWbRde = await ctx.WbRde
|
currentWbRde = await ctx.WbRde
|
||||||
.GroupBy(r => r.KgNr)
|
.GroupBy(r => r.KgNr)
|
||||||
.ToDictionaryAsync(g => g.Key, g => g.ToList());
|
.ToDictionaryAsync(g => g.Key, g => g.ToList());
|
||||||
|
kgs = await ctx.Katastralgemeinden.Include(k => k.WbKg).ToDictionaryAsync(k => k.KgNr);
|
||||||
}
|
}
|
||||||
|
|
||||||
var data = new List<(
|
var data = new List<(
|
||||||
@ -101,9 +103,9 @@ namespace Elwig.Helpers.Export {
|
|||||||
string? line;
|
string? line;
|
||||||
while ((line = await reader.ReadLineAsync()) != null) {
|
while ((line = await reader.ReadLineAsync()) != null) {
|
||||||
var obj = JsonNode.Parse(line)!.AsObject();
|
var obj = JsonNode.Parse(line)!.AsObject();
|
||||||
var (m, b, telNrs, emailAddrs) = obj.ToMember();
|
var (m, b, telNrs, emailAddrs) = obj.ToMember(kgs);
|
||||||
r.Members.Add(m);
|
r.Members.Add(m);
|
||||||
if (b != null) data[^1].BillingAddresses.Add(b);
|
if (b != null) r.BillingAddresses.Add(b);
|
||||||
r.TelephoneNumbers.AddRange(telNrs);
|
r.TelephoneNumbers.AddRange(telNrs);
|
||||||
r.EmailAddresses.AddRange(emailAddrs);
|
r.EmailAddresses.AddRange(emailAddrs);
|
||||||
}
|
}
|
||||||
@ -115,9 +117,12 @@ namespace Elwig.Helpers.Export {
|
|||||||
string? line;
|
string? line;
|
||||||
while ((line = await reader.ReadLineAsync()) != null) {
|
while ((line = await reader.ReadLineAsync()) != null) {
|
||||||
var obj = JsonNode.Parse(line)!.AsObject();
|
var obj = JsonNode.Parse(line)!.AsObject();
|
||||||
var (areaCom, wbrd) = obj.ToAreaCom(currentWbRde);
|
var (areaCom, wbrd) = obj.ToAreaCom(kgs, currentWbRde);
|
||||||
r.AreaCommitments.Add(areaCom);
|
r.AreaCommitments.Add(areaCom);
|
||||||
if (wbrd != null) r.Riede.Add(wbrd);
|
if (wbrd != null) {
|
||||||
|
currentWbRde[wbrd.KgNr].Add(wbrd);
|
||||||
|
r.Riede.Add(wbrd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -223,6 +228,7 @@ namespace Elwig.Helpers.Export {
|
|||||||
importedMembers.Add((meta.FileName, meta.ZwstId, meta.Device, n, o, members.Count - n - o, meta.MemberFilters));
|
importedMembers.Add((meta.FileName, meta.ZwstId, meta.Device, n, o, members.Count - n - o, meta.MemberFilters));
|
||||||
}
|
}
|
||||||
if (areaCommitments.Count > 0) {
|
if (areaCommitments.Count > 0) {
|
||||||
|
ctx.AddRange(riede);
|
||||||
var imported = areaCommitments.Where(c => (importNewMembers && !duplicateMgNrs.Contains(c.MgNr)) || (importDuplicateMembers && duplicateMgNrs.Contains(c.MgNr))).ToList();
|
var imported = areaCommitments.Where(c => (importNewMembers && !duplicateMgNrs.Contains(c.MgNr)) || (importDuplicateMembers && duplicateMgNrs.Contains(c.MgNr))).ToList();
|
||||||
importedAreaComs.Add((meta.FileName, meta.ZwstId, meta.Device, imported.Count, areaCommitments.Count - imported.Count, meta.AreaComFilters));
|
importedAreaComs.Add((meta.FileName, meta.ZwstId, meta.Device, imported.Count, areaCommitments.Count - imported.Count, meta.AreaComFilters));
|
||||||
}
|
}
|
||||||
@ -457,12 +463,16 @@ namespace Elwig.Helpers.Export {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static (Member, BillingAddr?, List<MemberTelNr>, List<MemberEmailAddr>) ToMember(this JsonNode json) {
|
public static (Member, BillingAddr?, List<MemberTelNr>, List<MemberEmailAddr>) ToMember(this JsonNode json, Dictionary<int, AT_Kg> kgs) {
|
||||||
var mgnr = json["mgnr"]!.AsValue().GetValue<int>();
|
var mgnr = json["mgnr"]!.AsValue().GetValue<int>();
|
||||||
|
var kgnr = json["default_kgnr"]?.AsValue().GetValue<int>();
|
||||||
|
if (kgnr != null && !kgs.Values.Any(k => k.WbKg?.KgNr == kgnr)) {
|
||||||
|
throw new ArgumentException($"Für KG {(kgs.TryGetValue(kgnr.Value, out var k) ? k.Name : "?")} ({kgnr:00000}) ist noch keine Großlage festgelegt!\n(Stammdaten → Herkunftshierarchie)");
|
||||||
|
}
|
||||||
return (new Member {
|
return (new Member {
|
||||||
MgNr = mgnr,
|
MgNr = mgnr,
|
||||||
PredecessorMgNr = json["predecessor_mgnr"]?.AsValue().GetValue<int>(),
|
PredecessorMgNr = json["predecessor_mgnr"]?.AsValue().GetValue<int>(),
|
||||||
Name = json["name"]!.AsValue().GetValue<string>(),
|
Name = json["name"]?.AsValue().GetValue<string>() ?? json["family_name"]!.AsValue().GetValue<string>(),
|
||||||
Prefix = json["prefix"]?.AsValue().GetValue<string>(),
|
Prefix = json["prefix"]?.AsValue().GetValue<string>(),
|
||||||
GivenName = json["given_name"]?.AsValue().GetValue<string>(),
|
GivenName = json["given_name"]?.AsValue().GetValue<string>(),
|
||||||
MiddleName = json["middle_names"]?.AsValue().GetValue<string>(),
|
MiddleName = json["middle_names"]?.AsValue().GetValue<string>(),
|
||||||
@ -488,7 +498,7 @@ namespace Elwig.Helpers.Export {
|
|||||||
CountryNum = json["address"]!["country"]!.AsValue().GetValue<int>(),
|
CountryNum = json["address"]!["country"]!.AsValue().GetValue<int>(),
|
||||||
PostalDestId = json["address"]!["postal_dest"]!.AsValue().GetValue<string>(),
|
PostalDestId = json["address"]!["postal_dest"]!.AsValue().GetValue<string>(),
|
||||||
Address = json["address"]!["address"]!.AsValue().GetValue<string>(),
|
Address = json["address"]!["address"]!.AsValue().GetValue<string>(),
|
||||||
DefaultKgNr = json["default_kgnr"]?.AsValue().GetValue<int>(),
|
DefaultKgNr = kgnr,
|
||||||
ContactViaPost = json["contact_postal"]?.AsValue().GetValue<bool>() ?? false,
|
ContactViaPost = json["contact_postal"]?.AsValue().GetValue<bool>() ?? false,
|
||||||
ContactViaEmail = json["contact_email"]?.AsValue().GetValue<bool>() ?? false,
|
ContactViaEmail = json["contact_email"]?.AsValue().GetValue<bool>() ?? false,
|
||||||
Comment = json["comment"]?.AsValue().GetValue<string>(),
|
Comment = json["comment"]?.AsValue().GetValue<string>(),
|
||||||
@ -528,13 +538,13 @@ namespace Elwig.Helpers.Export {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static (AreaCom, WbRd?) ToAreaCom(this JsonNode json, Dictionary<int, List<WbRd>> riede) {
|
public static (AreaCom, WbRd?) ToAreaCom(this JsonNode json, Dictionary<int, AT_Kg> kgs, Dictionary<int, List<WbRd>> riede) {
|
||||||
var kgnr = json["kgnr"]!.AsValue().GetValue<int>();
|
var kgnr = json["kgnr"]!.AsValue().GetValue<int>();
|
||||||
var ried = json["ried"]?.AsValue().GetValue<string>();
|
var ried = json["ried"]?.AsValue().GetValue<string>();
|
||||||
WbRd? rd = null;
|
WbRd? rd = null;
|
||||||
bool newRd = false;
|
bool newRd = false;
|
||||||
if (ried != null) {
|
if (ried != null) {
|
||||||
var rde = riede[kgnr] ?? throw new ArgumentException($"KG {kgnr:00000} is no WbKg");
|
var rde = riede[kgnr] ?? throw new ArgumentException($"Für KG {(kgs.TryGetValue(kgnr, out var k) ? k.Name : "?")} ({kgnr:00000}) ist noch keine Großlage festgelegt!\n(Stammdaten → Herkunftshierarchie)");
|
||||||
rd = rde.FirstOrDefault(r => r.Name == ried);
|
rd = rde.FirstOrDefault(r => r.Name == ried);
|
||||||
if (rd == null) {
|
if (rd == null) {
|
||||||
newRd = true;
|
newRd = true;
|
||||||
|
@ -8,7 +8,7 @@ namespace Elwig.Helpers {
|
|||||||
public static class Validator {
|
public static class Validator {
|
||||||
|
|
||||||
private static readonly Dictionary<string, string[][]> PHONE_NRS = new() {
|
private static readonly Dictionary<string, string[][]> PHONE_NRS = new() {
|
||||||
{ "43", new string[][] {
|
{ "43", [
|
||||||
[],
|
[],
|
||||||
["57", "59"],
|
["57", "59"],
|
||||||
[
|
[
|
||||||
@ -17,17 +17,17 @@ namespace Elwig.Helpers {
|
|||||||
"650", "651", "652", "653", "655", "657", "659", "660", "661",
|
"650", "651", "652", "653", "655", "657", "659", "660", "661",
|
||||||
"663", "664", "665", "666", "667", "668", "669", "67", "68", "69"
|
"663", "664", "665", "666", "667", "668", "669", "67", "68", "69"
|
||||||
]
|
]
|
||||||
} },
|
] },
|
||||||
{ "49", Array.Empty<string[]>() },
|
{ "49", [] },
|
||||||
{ "48", Array.Empty<string[]>() },
|
{ "48", [] },
|
||||||
{ "420", Array.Empty<string[]>() },
|
{ "420", [] },
|
||||||
{ "421", Array.Empty<string[]>() },
|
{ "421", [] },
|
||||||
{ "36", Array.Empty<string[]>() },
|
{ "36", [] },
|
||||||
{ "386", Array.Empty<string[]>() },
|
{ "386", [] },
|
||||||
{ "39", Array.Empty<string[]>() },
|
{ "39", [] },
|
||||||
{ "33", Array.Empty<string[]>() },
|
{ "33", [] },
|
||||||
{ "41", Array.Empty<string[]>() },
|
{ "41", [] },
|
||||||
{ "423", Array.Empty<string[]>() },
|
{ "423", [] },
|
||||||
};
|
};
|
||||||
|
|
||||||
public static ValidationResult CheckInteger(TextBox input, bool required) {
|
public static ValidationResult CheckInteger(TextBox input, bool required) {
|
||||||
|
@ -118,5 +118,9 @@ namespace Elwig.Helpers.Weighing {
|
|||||||
public async Task RevokeFillingClearance() {
|
public async Task RevokeFillingClearance() {
|
||||||
await SetFillingClearance(false);
|
await SetFillingClearance(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Task SetDateAndTime(DateTime dateTime) {
|
||||||
|
throw new NotImplementedException("Für Waagen vom Typ 'Gassner' ist diese Funktion noch nicht implementiert");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Elwig.Helpers.Weighing {
|
namespace Elwig.Helpers.Weighing {
|
||||||
@ -31,5 +32,10 @@ namespace Elwig.Helpers.Weighing {
|
|||||||
/// Revoke clearance to fill the scale container
|
/// Revoke clearance to fill the scale container
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Task RevokeFillingClearance();
|
Task RevokeFillingClearance();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Try to set date and time on the scale
|
||||||
|
/// </summary>
|
||||||
|
Task SetDateAndTime(DateTime dateTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -161,5 +161,10 @@ namespace Elwig.Helpers.Weighing {
|
|||||||
public async Task RevokeFillingClearance() {
|
public async Task RevokeFillingClearance() {
|
||||||
await SetFillingClearance(false);
|
await SetFillingClearance(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task SetDateAndTime(DateTime dateTime) {
|
||||||
|
await SendCommand($"ST{dateTime:dd.MM.yyHH:mm:ss}");
|
||||||
|
await ReceiveResponse();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,12 +40,12 @@ namespace Elwig.Models.Dtos {
|
|||||||
COALESCE(' ' || m.middle_names, '') || COALESCE(' ' || m.suffix, '') AS name_2,
|
COALESCE(' ' || m.middle_names, '') || COALESCE(' ' || m.suffix, '') AS name_2,
|
||||||
p.plz, o.name AS ort, m.address,
|
p.plz, o.name AS ort, m.address,
|
||||||
c.bucket, c.area, u.min_kg, u.weight
|
c.bucket, c.area, u.min_kg, u.weight
|
||||||
FROM member m
|
FROM v_area_commitment_bucket_strict c
|
||||||
|
LEFT JOIN member m ON m.mgnr = c.mgnr
|
||||||
LEFT JOIN AT_plz_dest p ON p.id = m.postal_dest
|
LEFT JOIN AT_plz_dest p ON p.id = m.postal_dest
|
||||||
LEFT JOIN AT_ort o ON o.okz = p.okz
|
LEFT JOIN AT_ort o ON o.okz = p.okz
|
||||||
LEFT JOIN v_area_commitment_bucket_strict c ON c.mgnr = m.mgnr AND c.year = {year}
|
|
||||||
JOIN v_under_delivery u ON (u.mgnr, u.bucket, u.year) = (m.mgnr, c.bucket, c.year)
|
JOIN v_under_delivery u ON (u.mgnr, u.bucket, u.year) = (m.mgnr, c.bucket, c.year)
|
||||||
WHERE m.active = 1
|
WHERE c.year = {year} AND m.active = 1
|
||||||
ORDER BY m.mgnr, c.bucket
|
ORDER BY m.mgnr, c.bucket
|
||||||
""").ToListAsync();
|
""").ToListAsync();
|
||||||
}
|
}
|
||||||
@ -54,7 +54,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
public class AreaComUnderDeliveryRow {
|
public class AreaComUnderDeliveryRow {
|
||||||
public int MgNr;
|
public int MgNr;
|
||||||
public string Name1;
|
public string Name1;
|
||||||
public string Name2;
|
public string? Name2;
|
||||||
public string Address;
|
public string Address;
|
||||||
public int Plz;
|
public int Plz;
|
||||||
public string Locality;
|
public string Locality;
|
||||||
@ -88,7 +88,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
[Column("name_1")]
|
[Column("name_1")]
|
||||||
public required string Name1 { get; set; }
|
public required string Name1 { get; set; }
|
||||||
[Column("name_2")]
|
[Column("name_2")]
|
||||||
public required string Name2 { get; set; }
|
public string? Name2 { get; set; }
|
||||||
[Column("address")]
|
[Column("address")]
|
||||||
public required string Address { get; set; }
|
public required string Address { get; set; }
|
||||||
[Column("plz")]
|
[Column("plz")]
|
||||||
|
@ -79,7 +79,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
public class CreditNoteRow {
|
public class CreditNoteRow {
|
||||||
public int MgNr;
|
public int MgNr;
|
||||||
public string Name1;
|
public string Name1;
|
||||||
public string Name2;
|
public string? Name2;
|
||||||
public string Address;
|
public string Address;
|
||||||
public int Plz;
|
public int Plz;
|
||||||
public string Locality;
|
public string Locality;
|
||||||
@ -144,7 +144,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
[Column("name_1")]
|
[Column("name_1")]
|
||||||
public required string Name1 { get; set; }
|
public required string Name1 { get; set; }
|
||||||
[Column("name_2")]
|
[Column("name_2")]
|
||||||
public required string Name2 { get; set; }
|
public string? Name2 { get; set; }
|
||||||
[Column("address")]
|
[Column("address")]
|
||||||
public required string Address { get; set; }
|
public required string Address { get; set; }
|
||||||
[Column("plz")]
|
[Column("plz")]
|
||||||
|
@ -38,7 +38,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
public string Branch;
|
public string Branch;
|
||||||
public int MgNr;
|
public int MgNr;
|
||||||
public string Name1;
|
public string Name1;
|
||||||
public string Name2;
|
public string? Name2;
|
||||||
public string AdministrativeName;
|
public string AdministrativeName;
|
||||||
public string SortId;
|
public string SortId;
|
||||||
public string Variety;
|
public string Variety;
|
||||||
|
@ -58,7 +58,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
public string DeliveryBranch;
|
public string DeliveryBranch;
|
||||||
public int MgNr;
|
public int MgNr;
|
||||||
public string Name1;
|
public string Name1;
|
||||||
public string Name2;
|
public string? Name2;
|
||||||
public string AdministrativeName;
|
public string AdministrativeName;
|
||||||
public string? MemberBranch;
|
public string? MemberBranch;
|
||||||
public string SortId;
|
public string SortId;
|
||||||
|
@ -72,7 +72,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
public class MemberDeliveryPerVariantRow {
|
public class MemberDeliveryPerVariantRow {
|
||||||
public int MgNr;
|
public int MgNr;
|
||||||
public string Name1;
|
public string Name1;
|
||||||
public string Name2;
|
public string? Name2;
|
||||||
public string Address;
|
public string Address;
|
||||||
public int Plz;
|
public int Plz;
|
||||||
public string Locality;
|
public string Locality;
|
||||||
@ -104,7 +104,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
[Column("name_1")]
|
[Column("name_1")]
|
||||||
public required string Name1 { get; set; }
|
public required string Name1 { get; set; }
|
||||||
[Column("name_2")]
|
[Column("name_2")]
|
||||||
public required string Name2 { get; set; }
|
public string? Name2 { get; set; }
|
||||||
[Column("address")]
|
[Column("address")]
|
||||||
public required string Address { get; set; }
|
public required string Address { get; set; }
|
||||||
[Column("plz")]
|
[Column("plz")]
|
||||||
|
@ -31,6 +31,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
("EntryDate", "Eintritt", null, 20),
|
("EntryDate", "Eintritt", null, 20),
|
||||||
("ExitDate", "Austritt", null, 20),
|
("ExitDate", "Austritt", null, 20),
|
||||||
("AreaCommitment", "geb. Fläche", "m²", 20),
|
("AreaCommitment", "geb. Fläche", "m²", 20),
|
||||||
|
("AreaCommitmentsFiltered", "geb. Fläche", "Vtrg.|m²", 30),
|
||||||
("UstIdNr", "UID", null, 25),
|
("UstIdNr", "UID", null, 25),
|
||||||
("Iban", "IBAN", null, 45),
|
("Iban", "IBAN", null, 45),
|
||||||
("Bic", "BIC", null, 30),
|
("Bic", "BIC", null, 30),
|
||||||
@ -45,8 +46,8 @@ namespace Elwig.Models.Dtos {
|
|||||||
base(MemberList.Name, MemberList.Name, string.Join(" / ", filterNames), rows, FieldNames) {
|
base(MemberList.Name, MemberList.Name, string.Join(" / ", filterNames), rows, FieldNames) {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<MemberListData> FromQuery(IQueryable<Member> query, List<string> filterNames) {
|
public static async Task<MemberListData> FromQuery(IQueryable<Member> query, List<string> filterNames, IEnumerable<string> filterAreaCom) {
|
||||||
var areaCom = await query.ToDictionaryAsync(m => m.MgNr, m => Utils.ActiveAreaCommitments(m.AreaCommitments).Sum(c => c.Area));
|
var areaComs = await query.ToDictionaryAsync(m => m.MgNr, m => Utils.ActiveAreaCommitments(m.AreaCommitments));
|
||||||
return new((await query
|
return new((await query
|
||||||
.Include(m => m.DefaultWbKg!.AtKg)
|
.Include(m => m.DefaultWbKg!.AtKg)
|
||||||
.Include(m => m.Branch)
|
.Include(m => m.Branch)
|
||||||
@ -55,13 +56,17 @@ namespace Elwig.Models.Dtos {
|
|||||||
.Include(m => m.TelephoneNumbers)
|
.Include(m => m.TelephoneNumbers)
|
||||||
.Include(m => m.EmailAddresses)
|
.Include(m => m.EmailAddresses)
|
||||||
.AsSplitQuery()
|
.AsSplitQuery()
|
||||||
.ToListAsync()).Select(m => new MemberListRow(m, areaCom[m.MgNr])), filterNames);
|
.ToListAsync()).Select(m => new MemberListRow(m,
|
||||||
|
areaComs[m.MgNr].Sum(c => c.Area),
|
||||||
|
areaComs[m.MgNr].Where(c => filterAreaCom.Contains(c.VtrgId)).GroupBy(c => c.VtrgId).ToDictionary(g => g.Key, g => g.Sum(c => c.Area)))),
|
||||||
|
filterNames);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class MemberListRow {
|
public class MemberListRow {
|
||||||
public int MgNr;
|
public int MgNr;
|
||||||
public string? Name1;
|
public string? Name1;
|
||||||
|
public string? AdminName1;
|
||||||
public string? Name2;
|
public string? Name2;
|
||||||
public string? DefaultKg;
|
public string? DefaultKg;
|
||||||
public string? Branch;
|
public string? Branch;
|
||||||
@ -78,6 +83,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
public string? Iban;
|
public string? Iban;
|
||||||
public string? Bic;
|
public string? Bic;
|
||||||
public int? AreaCommitment;
|
public int? AreaCommitment;
|
||||||
|
public (string VtrgId, int Area)[] AreaCommitmentsFiltered;
|
||||||
public bool IsBuchführend;
|
public bool IsBuchführend;
|
||||||
public bool IsOrganic;
|
public bool IsOrganic;
|
||||||
public bool IsActive;
|
public bool IsActive;
|
||||||
@ -89,9 +95,10 @@ namespace Elwig.Models.Dtos {
|
|||||||
public string? AdditionalContact;
|
public string? AdditionalContact;
|
||||||
public string? Comment;
|
public string? Comment;
|
||||||
|
|
||||||
public MemberListRow(Member m, int? areaCom = null) {
|
public MemberListRow(Member m, int? areaCom = null, Dictionary<string, int>? filtered = null) {
|
||||||
MgNr = m.MgNr;
|
MgNr = m.MgNr;
|
||||||
Name1 = m.Name;
|
Name1 = m.Name;
|
||||||
|
AdminName1 = m.AdministrativeName1;
|
||||||
Name2 = m.AdministrativeName2;
|
Name2 = m.AdministrativeName2;
|
||||||
DefaultKg = m.DefaultKg?.Name;
|
DefaultKg = m.DefaultKg?.Name;
|
||||||
Branch = m.Branch?.Name;
|
Branch = m.Branch?.Name;
|
||||||
@ -125,6 +132,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
.Concat(m.EmailAddresses.OrderBy(a => a.Nr).Select(a => a.Address).Except([EmailAddress])));
|
.Concat(m.EmailAddresses.OrderBy(a => a.Nr).Select(a => a.Address).Except([EmailAddress])));
|
||||||
Comment = m.Comment;
|
Comment = m.Comment;
|
||||||
AreaCommitment = areaCom == 0 ? null : areaCom;
|
AreaCommitment = areaCom == 0 ? null : areaCom;
|
||||||
|
AreaCommitmentsFiltered = filtered != null ? filtered.OrderBy(f => f.Key).Select(f => (f.Key, f.Value)).ToArray() : [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,12 +33,12 @@ namespace Elwig.Models.Dtos {
|
|||||||
m.business_shares * s.min_kg_per_bs AS min_kg,
|
m.business_shares * s.min_kg_per_bs AS min_kg,
|
||||||
m.business_shares * s.max_kg_per_bs AS max_kg,
|
m.business_shares * s.max_kg_per_bs AS max_kg,
|
||||||
COALESCE(SUM(d.weight), 0) AS sum
|
COALESCE(SUM(d.weight), 0) AS sum
|
||||||
FROM member m
|
FROM v_delivery d
|
||||||
|
LEFT JOIN member m ON m.mgnr = d.mgnr
|
||||||
LEFT JOIN AT_plz_dest p ON p.id = m.postal_dest
|
LEFT JOIN AT_plz_dest p ON p.id = m.postal_dest
|
||||||
LEFT JOIN AT_ort o ON o.okz = p.okz
|
LEFT JOIN AT_ort o ON o.okz = p.okz
|
||||||
LEFT JOIN season s ON s.year = {year}
|
LEFT JOIN season s ON s.year = d.year
|
||||||
LEFT JOIN v_delivery d ON d.mgnr = m.mgnr AND d.year = s.year
|
WHERE s.year = {year} AND (m.active = TRUE OR d.weight > 0)
|
||||||
WHERE m.active = TRUE OR d.weight > 0
|
|
||||||
GROUP BY d.year, m.mgnr
|
GROUP BY d.year, m.mgnr
|
||||||
ORDER BY 100.0 * sum / max_kg, m.mgnr;
|
ORDER BY 100.0 * sum / max_kg, m.mgnr;
|
||||||
""").ToListAsync();
|
""").ToListAsync();
|
||||||
@ -53,7 +53,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
[Column("name_1")]
|
[Column("name_1")]
|
||||||
public required string Name1 { get; set; }
|
public required string Name1 { get; set; }
|
||||||
[Column("name_2")]
|
[Column("name_2")]
|
||||||
public required string Name2 { get; set; }
|
public string? Name2 { get; set; }
|
||||||
[Column("address")]
|
[Column("address")]
|
||||||
public required string Address { get; set; }
|
public required string Address { get; set; }
|
||||||
[Column("plz")]
|
[Column("plz")]
|
||||||
|
@ -9,7 +9,6 @@ using Elwig.Documents;
|
|||||||
using Elwig.Helpers.Export;
|
using Elwig.Helpers.Export;
|
||||||
using Elwig.Models.Dtos;
|
using Elwig.Models.Dtos;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using System.Net.Http;
|
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System;
|
using System;
|
||||||
@ -27,6 +26,8 @@ namespace Elwig.Services {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void ClearInputs(this DeliveryAncmtAdminViewModel vm) {
|
public static void ClearInputs(this DeliveryAncmtAdminViewModel vm) {
|
||||||
|
vm.StatusAncmtCreated = "-";
|
||||||
|
vm.StatusAncmtModified = "-";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task FillInputs(this DeliveryAncmtAdminViewModel vm, DeliveryAncmt a) {
|
public static async Task FillInputs(this DeliveryAncmtAdminViewModel vm, DeliveryAncmt a) {
|
||||||
@ -34,6 +35,8 @@ namespace Elwig.Services {
|
|||||||
vm.DeliverySchedule = (DeliverySchedule?)ControlUtils.GetItemFromSourceWithPk(vm.DeliveryScheduleSource, a.Year, a.DsNr);
|
vm.DeliverySchedule = (DeliverySchedule?)ControlUtils.GetItemFromSourceWithPk(vm.DeliveryScheduleSource, a.Year, a.DsNr);
|
||||||
vm.SortId = a.SortId;
|
vm.SortId = a.SortId;
|
||||||
vm.Weight = a.Weight;
|
vm.Weight = a.Weight;
|
||||||
|
vm.StatusAncmtCreated = $"{a.CreatedTimestamp:dd.MM.yyyy, HH:mm} ({a.Type})";
|
||||||
|
vm.StatusAncmtModified = a.ModifiedTimestamp != a.CreatedTimestamp ? $"{a.ModifiedTimestamp:dd.MM.yyyy, HH:mm}" : "-";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<(List<string>, IQueryable<DeliveryAncmt>, List<string>)> GetFilters(this DeliveryAncmtAdminViewModel vm, AppDbContext ctx) {
|
public static async Task<(List<string>, IQueryable<DeliveryAncmt>, List<string>)> GetFilters(this DeliveryAncmtAdminViewModel vm, AppDbContext ctx) {
|
||||||
|
@ -420,7 +420,7 @@ namespace Elwig.Services {
|
|||||||
if (d.ShowDialog() == true) {
|
if (d.ShowDialog() == true) {
|
||||||
Mouse.OverrideCursor = Cursors.AppStarting;
|
Mouse.OverrideCursor = Cursors.AppStarting;
|
||||||
try {
|
try {
|
||||||
var data = await MemberListData.FromQuery(query, filterNames);
|
var data = await MemberListData.FromQuery(query, filterNames, filterNames.Where(f => f.StartsWith("Flächenbindung")).Select(f => f.Split(' ')[^1]));
|
||||||
using var ods = new OdsFile(d.FileName);
|
using var ods = new OdsFile(d.FileName);
|
||||||
await ods.AddTable(data);
|
await ods.AddTable(data);
|
||||||
} catch (Exception exc) {
|
} catch (Exception exc) {
|
||||||
@ -460,26 +460,30 @@ namespace Elwig.Services {
|
|||||||
try {
|
try {
|
||||||
var filename = $"{DateTime.Now:yyyy-MM-dd_HH-mm-ss}_{App.ZwstId}.elwig.zip";
|
var filename = $"{DateTime.Now:yyyy-MM-dd_HH-mm-ss}_{App.ZwstId}.elwig.zip";
|
||||||
var path = Path.Combine(App.TempPath, filename);
|
var path = Path.Combine(App.TempPath, filename);
|
||||||
var list = await query
|
var members = await query
|
||||||
.OrderBy(m => m.MgNr)
|
.OrderBy(m => m.MgNr)
|
||||||
.Include(m => m.BillingAddress)
|
.Include(m => m.BillingAddress)
|
||||||
.Include(m => m.TelephoneNumbers)
|
.Include(m => m.TelephoneNumbers)
|
||||||
.Include(m => m.EmailAddresses)
|
.Include(m => m.EmailAddresses)
|
||||||
.AsSplitQuery()
|
.AsSplitQuery()
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
if (list.Count == 0) {
|
var areaComs = await query
|
||||||
|
.SelectMany(m => m.AreaCommitments)
|
||||||
|
.Include(c => c.Rd)
|
||||||
|
.ToListAsync();
|
||||||
|
if (members.Count == 0) {
|
||||||
MessageBox.Show("Es wurden keine Mitglieder zum Hochladen ausgewählt!", "Mitglieder hochladen",
|
MessageBox.Show("Es wurden keine Mitglieder zum Hochladen ausgewählt!", "Mitglieder hochladen",
|
||||||
MessageBoxButton.OK, MessageBoxImage.Error);
|
MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
} else {
|
} else {
|
||||||
await ElwigData.Export(path, list, filterNames);
|
await ElwigData.Export(path, members, areaComs, filterNames);
|
||||||
await Utils.UploadExportData(path, App.Config.SyncUrl, App.Config.SyncUsername, App.Config.SyncPassword);
|
await Utils.UploadExportData(path, App.Config.SyncUrl, App.Config.SyncUsername, App.Config.SyncPassword);
|
||||||
MessageBox.Show($"Hochladen von {list.Count} Mitgliedern erfolgreich!", "Mitglieder hochgeladen",
|
MessageBox.Show($"Hochladen von {members.Count} Mitgliedern erfolgreich!", "Mitglieder hochgeladen",
|
||||||
MessageBoxButton.OK, MessageBoxImage.Information);
|
MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
}
|
}
|
||||||
} catch (HttpRequestException exc) {
|
} catch (HttpRequestException exc) {
|
||||||
MessageBox.Show("Eventuell Internetverbindung prüfen!\n\n" + exc.Message, "Lieferungen hochladen", MessageBoxButton.OK, MessageBoxImage.Error);
|
MessageBox.Show("Eventuell Internetverbindung prüfen!\n\n" + exc.Message, "Mitglieder hochladen", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
} catch (TaskCanceledException exc) {
|
} catch (TaskCanceledException exc) {
|
||||||
MessageBox.Show("Eventuell Internetverbindung prüfen!\n\n" + exc.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
MessageBox.Show("Eventuell Internetverbindung prüfen!\n\n" + exc.Message, "Mitglieder hochladen", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
} catch (Exception exc) {
|
} catch (Exception exc) {
|
||||||
MessageBox.Show(exc.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
MessageBox.Show(exc.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
}
|
}
|
||||||
@ -487,7 +491,7 @@ namespace Elwig.Services {
|
|||||||
} else {
|
} else {
|
||||||
Mouse.OverrideCursor = Cursors.AppStarting;
|
Mouse.OverrideCursor = Cursors.AppStarting;
|
||||||
try {
|
try {
|
||||||
var data = await MemberListData.FromQuery(query, filterNames);
|
var data = await MemberListData.FromQuery(query, filterNames, filterNames.Where(f => f.StartsWith("Flächenbindung")).Select(f => f.Split(' ')[^1]));
|
||||||
using var doc = new MemberList(string.Join(" / ", filterNames), data);
|
using var doc = new MemberList(string.Join(" / ", filterNames), data);
|
||||||
await Utils.ExportDocument(doc, mode);
|
await Utils.ExportDocument(doc, mode);
|
||||||
} catch (Exception exc) {
|
} catch (Exception exc) {
|
||||||
@ -593,7 +597,7 @@ namespace Elwig.Services {
|
|||||||
KgNr = c.KgNr,
|
KgNr = c.KgNr,
|
||||||
GstNr = c.GstNr,
|
GstNr = c.GstNr,
|
||||||
RdNr = c.RdNr,
|
RdNr = c.RdNr,
|
||||||
YearFrom = year,
|
YearFrom = vm.MaintainAreaComYearTo ? c.YearFrom : year,
|
||||||
YearTo = c.YearTo,
|
YearTo = c.YearTo,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -62,6 +62,15 @@ namespace Elwig.ViewModels {
|
|||||||
set => WeightString = $"{value}";
|
set => WeightString = $"{value}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ObservableProperty]
|
||||||
|
private string _statusAncmts = "-";
|
||||||
|
[ObservableProperty]
|
||||||
|
private string _statusWeight = "-";
|
||||||
|
[ObservableProperty]
|
||||||
|
private string _statusAncmtCreated = "-";
|
||||||
|
[ObservableProperty]
|
||||||
|
private string _statusAncmtModified = "-";
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private Visibility _controlButtonsVisibility = Visibility.Visible;
|
private Visibility _controlButtonsVisibility = Visibility.Visible;
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
|
@ -11,6 +11,7 @@ namespace Elwig.ViewModels {
|
|||||||
public partial class MemberAdminViewModel : ObservableObject {
|
public partial class MemberAdminViewModel : ObservableObject {
|
||||||
|
|
||||||
public int? TransferPredecessorAreaComs = null;
|
public int? TransferPredecessorAreaComs = null;
|
||||||
|
public bool MaintainAreaComYearTo = false;
|
||||||
public int? CancelAreaComs = null;
|
public int? CancelAreaComs = null;
|
||||||
|
|
||||||
public ObservableCollection<KeyValuePair<string, string>> PhoneNrTypes { get; set; } = new(Utils.PhoneNrTypes);
|
public ObservableCollection<KeyValuePair<string, string>> PhoneNrTypes { get; set; } = new(Utils.PhoneNrTypes);
|
||||||
|
@ -133,7 +133,7 @@ namespace Elwig.Windows {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ViewModel.FilterMember = m;
|
ViewModel.FilterMember = m;
|
||||||
ViewModel.Title = $"Lieferungen - {ViewModel.FilterMember.AdministrativeName} - Elwig";
|
ViewModel.Title = $"Flächenbindungen - {ViewModel.FilterMember.AdministrativeName} - Elwig";
|
||||||
|
|
||||||
ControlUtils.RenewItemsSource(KgInput, await ctx.WbKgs
|
ControlUtils.RenewItemsSource(KgInput, await ctx.WbKgs
|
||||||
.Include(k => k.AtKg.WbKg!.Rds)
|
.Include(k => k.AtKg.WbKg!.Rds)
|
||||||
|
@ -132,18 +132,20 @@
|
|||||||
<GroupBox Header="Datenpunkt" Grid.Row="0" Margin="0,5,5,5">
|
<GroupBox Header="Datenpunkt" Grid.Row="0" Margin="0,5,5,5">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="85"/>
|
<ColumnDefinition Width="65"/>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Label Content="Oechsle:" Margin="10,10,0,0" Grid.Column="0"/>
|
<Label Content="Oechsle:" Margin="10,10,0,0" Grid.Column="0"/>
|
||||||
<ctrl:UnitTextBox x:Name="OechsleInput" Unit="°Oe" TextChanged="OechsleInput_TextChanged" IsEnabled="False" LostFocus="OechsleInput_LostFocus"
|
<ctrl:UnitTextBox x:Name="OechsleInput" Unit="°Oe" TextChanged="OechsleInput_TextChanged" IsEnabled="False"
|
||||||
Grid.Column="1" Width="90" Margin="0,10,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
Grid.Column="1" Width="52" Margin="0,10,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||||
|
<CheckBox x:Name="GebInput" Content="Geb." IsEnabled="False"
|
||||||
|
Grid.Column="1" Margin="0,15,10,0" HorizontalAlignment="Right" VerticalAlignment="Top"
|
||||||
|
Checked="GebInput_Changed" Unchecked="GebInput_Changed"/>
|
||||||
|
|
||||||
<Label Content="Preis:" Margin="10,40,0,0" Grid.Column="0"/>
|
<Label Content="Preis:" Margin="10,40,0,0" Grid.Column="0"/>
|
||||||
<ctrl:UnitTextBox x:Name="PriceInput" Unit="€/kg" TextChanged="PriceInput_TextChanged" IsEnabled="False" LostFocus="PriceInput_LostFocus"
|
<ctrl:UnitTextBox x:Name="PriceInput" Unit="€/kg" TextChanged="PriceInput_TextChanged" IsEnabled="False"
|
||||||
Grid.Column="1" Width="90" Margin="0,40,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
Grid.Column="1" Margin="0,40,10,0" HorizontalAlignment="Stretch" VerticalAlignment="Top"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@ using System.Threading.Tasks;
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using Elwig.Controls;
|
|
||||||
using Elwig.Helpers;
|
using Elwig.Helpers;
|
||||||
using Elwig.Helpers.Billing;
|
using Elwig.Helpers.Billing;
|
||||||
using Elwig.Models.Entities;
|
using Elwig.Models.Entities;
|
||||||
@ -22,8 +21,10 @@ namespace Elwig.Windows {
|
|||||||
public readonly int Year;
|
public readonly int Year;
|
||||||
public readonly int AvNr;
|
public readonly int AvNr;
|
||||||
public Season Season;
|
public Season Season;
|
||||||
|
public string CurrencySymbol;
|
||||||
private PaymentVar PaymentVar;
|
private PaymentVar PaymentVar;
|
||||||
private bool HasChanged = false;
|
private bool HasChanged = false;
|
||||||
|
private bool Updating = false;
|
||||||
|
|
||||||
private Scatter DataPlot;
|
private Scatter DataPlot;
|
||||||
private Scatter? GebundenPlot;
|
private Scatter? GebundenPlot;
|
||||||
@ -72,6 +73,9 @@ namespace Elwig.Windows {
|
|||||||
AvNr = avnr;
|
AvNr = avnr;
|
||||||
using var ctx = new AppDbContext();
|
using var ctx = new AppDbContext();
|
||||||
Season = ctx.Seasons.Find(year) ?? throw new ArgumentException("Season not found");
|
Season = ctx.Seasons.Find(year) ?? throw new ArgumentException("Season not found");
|
||||||
|
CurrencySymbol = Season.Currency.Symbol ?? Season.Currency.Code;
|
||||||
|
PriceInput.Unit = $"{CurrencySymbol}/kg";
|
||||||
|
GebundenFlatBonus.Unit = $"{CurrencySymbol}/kg";
|
||||||
PaymentVar = ctx.PaymentVariants.Find(year, avnr) ?? throw new ArgumentException("PaymentVar not found");
|
PaymentVar = ctx.PaymentVariants.Find(year, avnr) ?? throw new ArgumentException("PaymentVar not found");
|
||||||
Title = $"{PaymentVar?.Name} - Lese {year} - Elwig";
|
Title = $"{PaymentVar?.Name} - Lese {year} - Elwig";
|
||||||
LockContext = true;
|
LockContext = true;
|
||||||
@ -99,6 +103,9 @@ namespace Elwig.Windows {
|
|||||||
private async Task RefreshGraphList(AppDbContext ctx) {
|
private async Task RefreshGraphList(AppDbContext ctx) {
|
||||||
PaymentVar = await ctx.PaymentVariants.FindAsync(Year, AvNr) ?? throw new ArgumentException("PaymentVar not found");
|
PaymentVar = await ctx.PaymentVariants.FindAsync(Year, AvNr) ?? throw new ArgumentException("PaymentVar not found");
|
||||||
Season = await ctx.Seasons.FindAsync(Year) ?? throw new ArgumentException("Season not found");
|
Season = await ctx.Seasons.FindAsync(Year) ?? throw new ArgumentException("Season not found");
|
||||||
|
CurrencySymbol = Season.Currency.Symbol ?? Season.Currency.Code;
|
||||||
|
PriceInput.Unit = $"{CurrencySymbol}/kg";
|
||||||
|
GebundenFlatBonus.Unit = $"{CurrencySymbol}/kg";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var data = EditBillingData.FromJson(PaymentVar.Data, Utils.GetVaributes(ctx, Year));
|
var data = EditBillingData.FromJson(PaymentVar.Data, Utils.GetVaributes(ctx, Year));
|
||||||
@ -146,6 +153,8 @@ namespace Elwig.Windows {
|
|||||||
if (SelectedGraphEntry != null) {
|
if (SelectedGraphEntry != null) {
|
||||||
CopyButton.IsEnabled = true;
|
CopyButton.IsEnabled = true;
|
||||||
DeleteButton.IsEnabled = true;
|
DeleteButton.IsEnabled = true;
|
||||||
|
EnableTextBox(OechsleInput);
|
||||||
|
GebInput.IsEnabled = SelectedGraphEntry?.GebundenGraph != null;
|
||||||
GebundenTypeFixed.IsEnabled = true;
|
GebundenTypeFixed.IsEnabled = true;
|
||||||
GebundenTypeGraph.IsEnabled = true;
|
GebundenTypeGraph.IsEnabled = true;
|
||||||
GebundenTypeNone.IsEnabled = true;
|
GebundenTypeNone.IsEnabled = true;
|
||||||
@ -156,15 +165,15 @@ namespace Elwig.Windows {
|
|||||||
} else {
|
} else {
|
||||||
CopyButton.IsEnabled = false;
|
CopyButton.IsEnabled = false;
|
||||||
DeleteButton.IsEnabled = false;
|
DeleteButton.IsEnabled = false;
|
||||||
DisableUnitTextBox(OechsleInput);
|
DisableTextBox(OechsleInput);
|
||||||
|
GebInput.IsEnabled = false;
|
||||||
DisableOptionButtons();
|
DisableOptionButtons();
|
||||||
}
|
}
|
||||||
if (!PaymentVar.TestVariant) {
|
if (!PaymentVar.TestVariant) {
|
||||||
AddButton.IsEnabled = false;
|
AddButton.IsEnabled = false;
|
||||||
CopyButton.IsEnabled = false;
|
CopyButton.IsEnabled = false;
|
||||||
DeleteButton.IsEnabled = false;
|
DeleteButton.IsEnabled = false;
|
||||||
DisableUnitTextBox(OechsleInput);
|
DisableTextBox(PriceInput);
|
||||||
DisableUnitTextBox(PriceInput);
|
|
||||||
GebundenTypeFixed.IsEnabled = false;
|
GebundenTypeFixed.IsEnabled = false;
|
||||||
GebundenTypeGraph.IsEnabled = false;
|
GebundenTypeGraph.IsEnabled = false;
|
||||||
GebundenTypeNone.IsEnabled = false;
|
GebundenTypeNone.IsEnabled = false;
|
||||||
@ -388,26 +397,23 @@ namespace Elwig.Windows {
|
|||||||
OechslePricePlot.Plot.Legend.ManualItems.Clear();
|
OechslePricePlot.Plot.Legend.ManualItems.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OechsleInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
private void UpdateSelectedPoint() {
|
||||||
if (ActiveGraph == null || SelectedGraphEntry == null) {
|
if (ActiveGraph == null || SelectedGraphEntry == null)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
bool success = int.TryParse(OechsleInput.Text, out int oechsle);
|
|
||||||
|
|
||||||
SecondaryMarkedPoint = -1;
|
SecondaryMarkedPoint = -1;
|
||||||
ChangeMarker(SecondaryMarkedPointPlot, false);
|
ChangeMarker(SecondaryMarkedPointPlot, false);
|
||||||
|
|
||||||
if (success) {
|
if (int.TryParse(OechsleInput.Text, out int oe)) {
|
||||||
if (oechsle >= ActiveGraph.MinX && oechsle <= ActiveGraph.MaxX) {
|
if (oe >= ActiveGraph.MinX && oe <= ActiveGraph.MaxX) {
|
||||||
PrimaryMarkedPoint = oechsle - ActiveGraph.MinX;
|
PrimaryMarkedPoint = oe - ActiveGraph.MinX;
|
||||||
ChangeMarker(PrimaryMarkedPointPlot, true, ActiveGraph.GetOechsleAt(PrimaryMarkedPoint), ActiveGraph.GetPriceAt(PrimaryMarkedPoint));
|
ChangeMarker(PrimaryMarkedPointPlot, true, ActiveGraph.GetOechsleAt(PrimaryMarkedPoint), ActiveGraph.GetPriceAt(PrimaryMarkedPoint));
|
||||||
|
|
||||||
PriceInput.Text = Math.Round(ActiveGraph.GetPriceAt(PrimaryMarkedPoint), Season.Precision).ToString();
|
PriceInput.Text = Math.Round(ActiveGraph.GetPriceAt(PrimaryMarkedPoint), Season.Precision).ToString();
|
||||||
|
|
||||||
EnableActionButtons();
|
EnableActionButtons();
|
||||||
OechslePricePlot.Refresh();
|
OechslePricePlot.Refresh();
|
||||||
EnableUnitTextBox(PriceInput);
|
EnableTextBox(PriceInput);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -416,9 +422,21 @@ namespace Elwig.Windows {
|
|||||||
ChangeMarker(PrimaryMarkedPointPlot, false);
|
ChangeMarker(PrimaryMarkedPointPlot, false);
|
||||||
DisableActionButtons();
|
DisableActionButtons();
|
||||||
PriceInput.Text = "";
|
PriceInput.Text = "";
|
||||||
DisableUnitTextBox(PriceInput);
|
DisableTextBox(PriceInput);
|
||||||
OechslePricePlot.Refresh();
|
OechslePricePlot.Refresh();
|
||||||
DisableUnitTextBox(PriceInput);
|
DisableTextBox(PriceInput);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OechsleInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||||
|
UpdateSelectedPoint();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GebInput_Changed(object sender, RoutedEventArgs evt) {
|
||||||
|
if (Updating)
|
||||||
|
return;
|
||||||
|
var sel = GebInput.IsChecked == true ? SelectedGraphEntry?.GebundenGraph : SelectedGraphEntry?.DataGraph;
|
||||||
|
if (sel != ActiveGraph) ChangeActiveGraph(sel);
|
||||||
|
UpdateSelectedPoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PriceInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
private void PriceInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||||
@ -479,31 +497,34 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void OechslePricePlot_MouseDown(object sender, MouseEventArgs e) {
|
private void OechslePricePlot_MouseDown(object sender, MouseEventArgs e) {
|
||||||
if (GraphList.SelectedItem == null) {
|
if (GraphList.SelectedItem == null)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (HoverActive) {
|
if (HoverActive) {
|
||||||
if (PaymentVar.TestVariant && Keyboard.IsKeyDown(System.Windows.Input.Key.LeftCtrl)) {
|
if (PaymentVar.TestVariant && Keyboard.IsKeyDown(System.Windows.Input.Key.LeftCtrl)) {
|
||||||
if (PrimaryMarkedPoint == -1 || ActiveGraph == null || ActiveGraph != Highlighted.Graph) {
|
if (SecondaryMarkedPoint == -1 || ActiveGraph == null || ActiveGraph != Highlighted.Graph)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
SecondaryMarkedPoint = Highlighted.Index;
|
SecondaryMarkedPoint = Highlighted.Index;
|
||||||
|
|
||||||
ChangeMarker(SecondaryMarkedPointPlot, true, ActiveGraph.GetOechsleAt(SecondaryMarkedPoint), ActiveGraph.GetPriceAt(SecondaryMarkedPoint));
|
ChangeMarker(SecondaryMarkedPointPlot, true, ActiveGraph.GetOechsleAt(SecondaryMarkedPoint), ActiveGraph.GetPriceAt(SecondaryMarkedPoint));
|
||||||
|
|
||||||
InterpolateButton.IsEnabled = true;
|
InterpolateButton.IsEnabled = true;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Updating = true;
|
||||||
PrimaryMarkedPoint = Highlighted.Index;
|
PrimaryMarkedPoint = Highlighted.Index;
|
||||||
if (ActiveGraph != Highlighted.Graph) ChangeActiveGraph(Highlighted.Graph);
|
if (ActiveGraph != Highlighted.Graph)
|
||||||
|
ChangeActiveGraph(Highlighted.Graph);
|
||||||
|
Updating = false;
|
||||||
|
if (PrimaryMarkedPoint == -1 || ActiveGraph == null)
|
||||||
|
return;
|
||||||
|
|
||||||
ChangeMarker(PrimaryMarkedPointPlot, true, ActiveGraph!.GetOechsleAt(PrimaryMarkedPoint), ActiveGraph.GetPriceAt(PrimaryMarkedPoint));
|
ChangeMarker(PrimaryMarkedPointPlot, true, ActiveGraph.GetOechsleAt(PrimaryMarkedPoint), ActiveGraph.GetPriceAt(PrimaryMarkedPoint));
|
||||||
|
|
||||||
|
Updating = true;
|
||||||
OechsleInput.Text = Highlighted.Graph!.GetOechsleAt(Highlighted.Index).ToString();
|
OechsleInput.Text = Highlighted.Graph!.GetOechsleAt(Highlighted.Index).ToString();
|
||||||
|
GebInput.IsChecked = Highlighted.Graph == SelectedGraphEntry?.GebundenGraph;
|
||||||
PriceInput.Text = Math.Round(Highlighted.Graph.GetPriceAt(Highlighted.Index), Season.Precision).ToString();
|
PriceInput.Text = Math.Round(Highlighted.Graph.GetPriceAt(Highlighted.Index), Season.Precision).ToString();
|
||||||
|
Updating = false;
|
||||||
|
|
||||||
EnableActionButtons();
|
EnableActionButtons();
|
||||||
} else {
|
} else {
|
||||||
@ -516,8 +537,9 @@ namespace Elwig.Windows {
|
|||||||
ChangeMarker(SecondaryMarkedPointPlot, false);
|
ChangeMarker(SecondaryMarkedPointPlot, false);
|
||||||
|
|
||||||
OechsleInput.Text = "";
|
OechsleInput.Text = "";
|
||||||
|
GebInput.IsChecked = false;
|
||||||
PriceInput.Text = "";
|
PriceInput.Text = "";
|
||||||
DisableUnitTextBox(PriceInput);
|
DisableTextBox(PriceInput);
|
||||||
|
|
||||||
DisableActionButtons();
|
DisableActionButtons();
|
||||||
}
|
}
|
||||||
@ -531,28 +553,39 @@ namespace Elwig.Windows {
|
|||||||
MouseChange(e);
|
MouseChange(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Coordinates GetMouseCoordinates(Point p) {
|
||||||
|
Pixel px = new(p.X, p.Y);
|
||||||
|
var source = PresentationSource.FromVisual(this);
|
||||||
|
if (source?.CompositionTarget != null) {
|
||||||
|
var matrix = source.CompositionTarget.TransformToDevice;
|
||||||
|
px.X *= (float)matrix.M11;
|
||||||
|
px.Y *= (float)matrix.M22;
|
||||||
|
}
|
||||||
|
return OechslePricePlot.Plot.GetCoordinates(px);
|
||||||
|
}
|
||||||
|
|
||||||
private void MouseChange(MouseEventArgs e) {
|
private void MouseChange(MouseEventArgs e) {
|
||||||
if (GraphList.SelectedItem == null) {
|
if (GraphList.SelectedItem == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
(double x, double y, int index)? mouseOnData = MouseOnPlot(DataPlot, e.GetPosition(OechslePricePlot));
|
var mouseOnData = MouseOnPlot(DataPlot, GetMouseCoordinates(e.GetPosition(OechslePricePlot)));
|
||||||
(double x, double y, int index)? mouseOnGebunden = MouseOnPlot(GebundenPlot, e.GetPosition(OechslePricePlot));
|
var mouseOnGebunden = MouseOnPlot(GebundenPlot, GetMouseCoordinates(e.GetPosition(OechslePricePlot)));
|
||||||
|
|
||||||
Highlighted = LastHighlighted;
|
Highlighted = LastHighlighted;
|
||||||
|
|
||||||
if (mouseOnData != null) {
|
if (mouseOnData != null) {
|
||||||
ChangeMarker(HighlightedPointPlot, true, mouseOnData.Value.x, mouseOnData.Value.y);
|
ChangeMarker(HighlightedPointPlot, true, mouseOnData.Value.X, mouseOnData.Value.Y);
|
||||||
HighlightedPointPlot.IsVisible = true;
|
HighlightedPointPlot.IsVisible = true;
|
||||||
HoverChanged = true ^ HoverActive;
|
HoverChanged = true ^ HoverActive;
|
||||||
HoverActive = true;
|
HoverActive = true;
|
||||||
HandleTooltip(mouseOnData.Value.x, mouseOnData.Value.y, mouseOnData.Value.index, SelectedGraphEntry!.DataGraph, e.GetPosition(OechslePricePlot), e is MouseWheelEventArgs);
|
HandleTooltip(mouseOnData.Value.X, mouseOnData.Value.Y, mouseOnData.Value.Index, SelectedGraphEntry!.DataGraph, e.GetPosition(OechslePricePlot), e is MouseWheelEventArgs);
|
||||||
} else if (mouseOnGebunden != null) {
|
} else if (mouseOnGebunden != null) {
|
||||||
ChangeMarker(HighlightedPointPlot, true, mouseOnGebunden.Value.x, mouseOnGebunden.Value.y);
|
ChangeMarker(HighlightedPointPlot, true, mouseOnGebunden.Value.X, mouseOnGebunden.Value.Y);
|
||||||
HighlightedPointPlot.IsVisible = true;
|
HighlightedPointPlot.IsVisible = true;
|
||||||
HoverChanged = true ^ HoverActive;
|
HoverChanged = true ^ HoverActive;
|
||||||
HoverActive = true;
|
HoverActive = true;
|
||||||
HandleTooltip(mouseOnGebunden.Value.x, mouseOnGebunden.Value.y, mouseOnGebunden.Value.index, SelectedGraphEntry!.GebundenGraph!, e.GetPosition(OechslePricePlot), e is MouseWheelEventArgs);
|
HandleTooltip(mouseOnGebunden.Value.X, mouseOnGebunden.Value.Y, mouseOnGebunden.Value.Index, SelectedGraphEntry!.GebundenGraph!, e.GetPosition(OechslePricePlot), e is MouseWheelEventArgs);
|
||||||
} else {
|
} else {
|
||||||
ChangeMarker(HighlightedPointPlot, false);
|
ChangeMarker(HighlightedPointPlot, false);
|
||||||
HoverChanged = false ^ HoverActive;
|
HoverChanged = false ^ HoverActive;
|
||||||
@ -562,30 +595,20 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private (double, double, int)? MouseOnPlot(Scatter? plot, Point p) {
|
private (double X, double Y, int Index)? MouseOnPlot(Scatter? plot, Coordinates c) {
|
||||||
if (plot == null) {
|
if (plot == null)
|
||||||
return null;
|
return null;
|
||||||
}
|
|
||||||
|
|
||||||
OechslePricePlot.Refresh();
|
OechslePricePlot.Refresh();
|
||||||
Pixel mousePixel = new(p.X, p.Y);
|
DataPoint nearestPoint = plot.Data.GetNearest(c, OechslePricePlot.Plot.LastRender, 5);
|
||||||
Coordinates mouseLocation = OechslePricePlot.Plot.GetCoordinates(mousePixel);
|
return nearestPoint.IsReal ? (nearestPoint.X, nearestPoint.Y, nearestPoint.Index) : null;
|
||||||
DataPoint nearestPoint = plot.Data.GetNearest(mouseLocation, OechslePricePlot.Plot.LastRender, 3);
|
|
||||||
|
|
||||||
if (nearestPoint.IsReal) {
|
|
||||||
return (nearestPoint.X, nearestPoint.Y, nearestPoint.Index);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleTooltip(double pointX, double pointY, int pointIndex, Graph g, Point p, bool force) {
|
private void HandleTooltip(double pointX, double pointY, int pointIndex, Graph g, Point p, bool force) {
|
||||||
if (force || LastHighlighted != Highlighted || HoverChanged) {
|
if (force || LastHighlighted != Highlighted || HoverChanged) {
|
||||||
OechslePricePlot.Plot.PlottableList.Remove(TooltipPlot);
|
OechslePricePlot.Plot.PlottableList.Remove(TooltipPlot);
|
||||||
if (TooltipInput.IsChecked == true) {
|
if (TooltipInput.IsChecked == true) {
|
||||||
Pixel mousePixel = new(p.X, p.Y - 30);
|
Coordinates mouseLocation = GetMouseCoordinates(new(p.X, p.Y - 30));
|
||||||
Coordinates mouseLocation = OechslePricePlot.Plot.GetCoordinates(mousePixel);
|
TooltipPlot = OechslePricePlot.Plot.Add.Text($"Oechsle: {pointX:N2}, Preis: {Math.Round(pointY, Season.Precision)} {CurrencySymbol}/kg", mouseLocation.X, mouseLocation.Y);
|
||||||
TooltipPlot = OechslePricePlot.Plot.Add.Text($"Oechsle: {pointX:N2}, Preis: {Math.Round(pointY, Season.Precision)}€/kg", mouseLocation.X, mouseLocation.Y);
|
|
||||||
TooltipPlot.LabelFontSize = 12;
|
TooltipPlot.LabelFontSize = 12;
|
||||||
TooltipPlot.LabelBold = true;
|
TooltipPlot.LabelBold = true;
|
||||||
TooltipPlot.LabelBorderColor = Colors.Black;
|
TooltipPlot.LabelBorderColor = Colors.Black;
|
||||||
@ -658,31 +681,37 @@ namespace Elwig.Windows {
|
|||||||
SetHasChanged(false);
|
SetHasChanged(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EnableUnitTextBox(UnitTextBox u) {
|
private void EnableTextBox(TextBox u) {
|
||||||
if (PaymentVar.TestVariant) {
|
if (PaymentVar.TestVariant || u == OechsleInput) {
|
||||||
u.IsEnabled = true;
|
u.IsEnabled = true;
|
||||||
u.IsReadOnly = false;
|
u.IsReadOnly = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DisableUnitTextBox(UnitTextBox u) {
|
private void DisableTextBox(TextBox u) {
|
||||||
u.IsEnabled = false;
|
u.IsEnabled = false;
|
||||||
u.IsReadOnly = true;
|
u.IsReadOnly = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ChangeActiveGraph(Graph? g) {
|
private void ChangeActiveGraph(Graph? g) {
|
||||||
if (g != null && g == SelectedGraphEntry?.DataGraph) {
|
if (g != null && g == SelectedGraphEntry?.DataGraph) {
|
||||||
EnableUnitTextBox(OechsleInput);
|
EnableTextBox(OechsleInput);
|
||||||
if (SelectedGraphEntry?.GebundenGraph != null) ChangeLineWidth(DataPlot, 4);
|
if (SelectedGraphEntry?.GebundenGraph != null) ChangeLineWidth(DataPlot, 4);
|
||||||
ChangeLineWidth(GebundenPlot, 1);
|
ChangeLineWidth(GebundenPlot, 1);
|
||||||
|
GebInput.IsEnabled = SelectedGraphEntry?.GebundenGraph != null;
|
||||||
|
GebInput.IsChecked = false;
|
||||||
} else if (g != null && g == SelectedGraphEntry?.GebundenGraph) {
|
} else if (g != null && g == SelectedGraphEntry?.GebundenGraph) {
|
||||||
EnableUnitTextBox(OechsleInput);
|
EnableTextBox(OechsleInput);
|
||||||
ChangeLineWidth(GebundenPlot, 4);
|
ChangeLineWidth(GebundenPlot, 4);
|
||||||
ChangeLineWidth(DataPlot, 1);
|
ChangeLineWidth(DataPlot, 1);
|
||||||
|
GebInput.IsEnabled = SelectedGraphEntry?.GebundenGraph != null;
|
||||||
|
GebInput.IsChecked = true;
|
||||||
} else {
|
} else {
|
||||||
DisableUnitTextBox(OechsleInput);
|
DisableTextBox(OechsleInput);
|
||||||
DisableUnitTextBox(PriceInput);
|
DisableTextBox(PriceInput);
|
||||||
OechsleInput.Text = "";
|
OechsleInput.Text = "";
|
||||||
|
GebInput.IsEnabled = false;
|
||||||
|
GebInput.IsChecked = false;
|
||||||
PriceInput.Text = "";
|
PriceInput.Text = "";
|
||||||
ChangeLineWidth(DataPlot, 1);
|
ChangeLineWidth(DataPlot, 1);
|
||||||
ChangeLineWidth(GebundenPlot, 1);
|
ChangeLineWidth(GebundenPlot, 1);
|
||||||
@ -700,14 +729,6 @@ namespace Elwig.Windows {
|
|||||||
RefreshInputs();
|
RefreshInputs();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PriceInput_LostFocus(object sender, RoutedEventArgs e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OechsleInput_LostFocus(object sender, RoutedEventArgs e) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void GebundenFlatBonus_TextChanged(object sender, TextChangedEventArgs e) {
|
private void GebundenFlatBonus_TextChanged(object sender, TextChangedEventArgs e) {
|
||||||
if (FillingInputs) return;
|
if (FillingInputs) return;
|
||||||
var r = Validator.CheckDecimal(GebundenFlatBonus, true, 2, Season.Precision);
|
var r = Validator.CheckDecimal(GebundenFlatBonus, true, 2, Season.Precision);
|
||||||
@ -778,19 +799,19 @@ namespace Elwig.Windows {
|
|||||||
private void GebundenType_Checked(object sender, RoutedEventArgs e) {
|
private void GebundenType_Checked(object sender, RoutedEventArgs e) {
|
||||||
if (FillingInputs) return;
|
if (FillingInputs) return;
|
||||||
if (SelectedGraphEntry == null) {
|
if (SelectedGraphEntry == null) {
|
||||||
DisableUnitTextBox(GebundenFlatBonus);
|
DisableTextBox(GebundenFlatBonus);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (GebundenTypeNone.IsChecked == true) {
|
if (GebundenTypeNone.IsChecked == true) {
|
||||||
SelectedGraphEntry.RemoveGebundenGraph();
|
SelectedGraphEntry.RemoveGebundenGraph();
|
||||||
DisableUnitTextBox(GebundenFlatBonus);
|
DisableTextBox(GebundenFlatBonus);
|
||||||
} else if (GebundenTypeFixed.IsChecked == true) {
|
} else if (GebundenTypeFixed.IsChecked == true) {
|
||||||
SelectedGraphEntry.GebundenFlatBonus = double.TryParse(GebundenFlatBonus.Text, out var val) ? val : 0.1;
|
SelectedGraphEntry.GebundenFlatBonus = double.TryParse(GebundenFlatBonus.Text, out var val) ? val : 0.1;
|
||||||
SelectedGraphEntry.AddGebundenGraph();
|
SelectedGraphEntry.AddGebundenGraph();
|
||||||
EnableUnitTextBox(GebundenFlatBonus);
|
EnableTextBox(GebundenFlatBonus);
|
||||||
} else if (GebundenTypeGraph.IsChecked == true) {
|
} else if (GebundenTypeGraph.IsChecked == true) {
|
||||||
SelectedGraphEntry.AddGebundenGraph();
|
SelectedGraphEntry.AddGebundenGraph();
|
||||||
DisableUnitTextBox(GebundenFlatBonus);
|
DisableTextBox(GebundenFlatBonus);
|
||||||
}
|
}
|
||||||
SetHasChanged();
|
SetHasChanged();
|
||||||
RefreshInputs();
|
RefreshInputs();
|
||||||
@ -801,11 +822,11 @@ namespace Elwig.Windows {
|
|||||||
if (SelectedGraphEntry?.GebundenFlatBonus is double bonus) {
|
if (SelectedGraphEntry?.GebundenFlatBonus is double bonus) {
|
||||||
GebundenTypeFixed.IsChecked = true;
|
GebundenTypeFixed.IsChecked = true;
|
||||||
GebundenFlatBonus.Text = $"{bonus}";
|
GebundenFlatBonus.Text = $"{bonus}";
|
||||||
EnableUnitTextBox(GebundenFlatBonus);
|
EnableTextBox(GebundenFlatBonus);
|
||||||
} else if (SelectedGraphEntry?.GebundenGraph != null) {
|
} else if (SelectedGraphEntry?.GebundenGraph != null) {
|
||||||
GebundenTypeGraph.IsChecked = true;
|
GebundenTypeGraph.IsChecked = true;
|
||||||
GebundenFlatBonus.Text = "";
|
GebundenFlatBonus.Text = "";
|
||||||
DisableUnitTextBox(GebundenFlatBonus);
|
DisableTextBox(GebundenFlatBonus);
|
||||||
}
|
}
|
||||||
FillingInputs = false;
|
FillingInputs = false;
|
||||||
}
|
}
|
||||||
|
@ -690,7 +690,7 @@ namespace Elwig.Windows {
|
|||||||
private async void NewDeliveryPartButton_Click(object sender, RoutedEventArgs evt) {
|
private async void NewDeliveryPartButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
FinishButton.IsEnabled = false;
|
FinishButton.IsEnabled = false;
|
||||||
NewDeliveryPartButton.IsEnabled = false;
|
NewDeliveryPartButton.IsEnabled = false;
|
||||||
NewDeliveryPartButton.Cursor = Cursors.Wait;
|
Mouse.OverrideCursor = Cursors.AppStarting;
|
||||||
DeliveryPartList.IsEnabled = false;
|
DeliveryPartList.IsEnabled = false;
|
||||||
var p = await ViewModel.UpdateDeliveryPart(
|
var p = await ViewModel.UpdateDeliveryPart(
|
||||||
(DeliveryList.SelectedItem as Delivery)?.Year,
|
(DeliveryList.SelectedItem as Delivery)?.Year,
|
||||||
@ -703,9 +703,10 @@ namespace Elwig.Windows {
|
|||||||
EmptyScale();
|
EmptyScale();
|
||||||
await RefreshList();
|
await RefreshList();
|
||||||
await RefreshDeliveryParts();
|
await RefreshDeliveryParts();
|
||||||
NewDeliveryPartButton.Cursor = null;
|
Mouse.OverrideCursor = null;
|
||||||
ControlUtils.SelectItem(DeliveryList, p?.Delivery);
|
ControlUtils.SelectItem(DeliveryList, p?.Delivery);
|
||||||
DeliveryPartList.SelectedItem = null;
|
DeliveryPartList.SelectedItem = null;
|
||||||
|
DeliveryPartList.ScrollIntoView(DeliveryPartList.ItemsSource.Cast<object>().Last());
|
||||||
RefreshInputs();
|
RefreshInputs();
|
||||||
InitialInputs();
|
InitialInputs();
|
||||||
}
|
}
|
||||||
@ -713,7 +714,7 @@ namespace Elwig.Windows {
|
|||||||
private async void FinishButton_Click(object sender, RoutedEventArgs evt) {
|
private async void FinishButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
FinishButton.IsEnabled = false;
|
FinishButton.IsEnabled = false;
|
||||||
NewDeliveryPartButton.IsEnabled = false;
|
NewDeliveryPartButton.IsEnabled = false;
|
||||||
FinishButton.Cursor = Cursors.Wait;
|
Mouse.OverrideCursor = Cursors.AppStarting;
|
||||||
DeliveryPartList.IsEnabled = false;
|
DeliveryPartList.IsEnabled = false;
|
||||||
var p = await ViewModel.UpdateDeliveryPart(
|
var p = await ViewModel.UpdateDeliveryPart(
|
||||||
(DeliveryList.SelectedItem as Delivery)?.Year,
|
(DeliveryList.SelectedItem as Delivery)?.Year,
|
||||||
@ -727,7 +728,6 @@ namespace Elwig.Windows {
|
|||||||
await RefreshList();
|
await RefreshList();
|
||||||
await RefreshDeliveryParts();
|
await RefreshDeliveryParts();
|
||||||
if (p?.Delivery != null) {
|
if (p?.Delivery != null) {
|
||||||
Mouse.OverrideCursor = Cursors.AppStarting;
|
|
||||||
try {
|
try {
|
||||||
using var ctx = new AppDbContext();
|
using var ctx = new AppDbContext();
|
||||||
using var doc = new DeliveryNote((await ctx.Deliveries.FindAsync(p.Year, p.DId))!, ctx);
|
using var doc = new DeliveryNote((await ctx.Deliveries.FindAsync(p.Year, p.DId))!, ctx);
|
||||||
@ -740,9 +740,8 @@ namespace Elwig.Windows {
|
|||||||
} catch (Exception exc) {
|
} catch (Exception exc) {
|
||||||
MessageBox.Show(exc.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
MessageBox.Show(exc.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
}
|
}
|
||||||
Mouse.OverrideCursor = null;
|
|
||||||
}
|
}
|
||||||
FinishButton.Cursor = null;
|
Mouse.OverrideCursor = null;
|
||||||
DeliveryList.SelectedItem = null;
|
DeliveryList.SelectedItem = null;
|
||||||
await RenewContext();
|
await RenewContext();
|
||||||
RefreshInputs();
|
RefreshInputs();
|
||||||
@ -937,7 +936,7 @@ namespace Elwig.Windows {
|
|||||||
|
|
||||||
private async void SaveButton_Click(object? sender, RoutedEventArgs? evt) {
|
private async void SaveButton_Click(object? sender, RoutedEventArgs? evt) {
|
||||||
SaveButton.IsEnabled = false;
|
SaveButton.IsEnabled = false;
|
||||||
SaveButton.Cursor = Cursors.Wait;
|
Mouse.OverrideCursor = Cursors.AppStarting;
|
||||||
|
|
||||||
IsEditing = false;
|
IsEditing = false;
|
||||||
IsCreating = false;
|
IsCreating = false;
|
||||||
@ -953,7 +952,7 @@ namespace Elwig.Windows {
|
|||||||
!InputIsNotDefault(TimeInput)
|
!InputIsNotDefault(TimeInput)
|
||||||
);
|
);
|
||||||
|
|
||||||
SaveButton.Cursor = null;
|
Mouse.OverrideCursor = null;
|
||||||
|
|
||||||
HideSaveResetCancelButtons();
|
HideSaveResetCancelButtons();
|
||||||
ShowNewEditDeleteButtons();
|
ShowNewEditDeleteButtons();
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
xmlns:local="clr-namespace:Elwig.Windows"
|
xmlns:local="clr-namespace:Elwig.Windows"
|
||||||
xmlns:vm="clr-namespace:Elwig.ViewModels"
|
xmlns:vm="clr-namespace:Elwig.ViewModels"
|
||||||
xmlns:ctrl="clr-namespace:Elwig.Controls"
|
xmlns:ctrl="clr-namespace:Elwig.Controls"
|
||||||
Title="Traubenanmeldungen - Elwig" Height="700" Width="900" MinWidth="600" MinHeight="400"
|
Title="Traubenanmeldungen - Elwig" Height="700" Width="940" MinWidth="600" MinHeight="400"
|
||||||
Loaded="Window_Loaded">
|
Loaded="Window_Loaded">
|
||||||
<Window.DataContext>
|
<Window.DataContext>
|
||||||
<vm:DeliveryAncmtAdminViewModel/>
|
<vm:DeliveryAncmtAdminViewModel/>
|
||||||
@ -61,7 +61,7 @@
|
|||||||
<RowDefinition Height="24"/>
|
<RowDefinition Height="24"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="1*" MinWidth="250"/>
|
<ColumnDefinition Width="1.25*" MinWidth="250"/>
|
||||||
<ColumnDefinition Width="5"/>
|
<ColumnDefinition Width="5"/>
|
||||||
<ColumnDefinition Width="1*" MinWidth="300"/>
|
<ColumnDefinition Width="1*" MinWidth="300"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
@ -123,6 +123,7 @@
|
|||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<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"/>
|
||||||
@ -267,6 +268,7 @@
|
|||||||
<ComboBox.ItemTemplate>
|
<ComboBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<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}"/>
|
||||||
@ -305,17 +307,39 @@
|
|||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="150"/>
|
<ColumnDefinition Width="1*" MinWidth="120"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="200"/>
|
<ColumnDefinition Width="1*" MinWidth="150"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="2.25*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="2*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
</Grid>
|
</Grid>
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</StatusBar.ItemsPanel>
|
</StatusBar.ItemsPanel>
|
||||||
<StatusBarItem>
|
<StatusBarItem>
|
||||||
|
<TextBlock>
|
||||||
|
Anmeldungen: <Run Text="{Binding StatusAncmts}"/>
|
||||||
|
</TextBlock>
|
||||||
|
</StatusBarItem>
|
||||||
|
<Separator Grid.Column="1"/>
|
||||||
|
<StatusBarItem Grid.Column="2">
|
||||||
|
<TextBlock>
|
||||||
|
Gewicht: <Run Text="{Binding StatusWeight}"/>
|
||||||
|
</TextBlock>
|
||||||
|
</StatusBarItem>
|
||||||
|
<Separator Grid.Column="3"/>
|
||||||
|
<StatusBarItem Grid.Column="4">
|
||||||
|
<TextBlock>
|
||||||
|
Anmldg. erstellt: <Run Text="{Binding StatusAncmtCreated}"/>
|
||||||
|
</TextBlock>
|
||||||
|
</StatusBarItem>
|
||||||
|
<Separator Grid.Column="5"/>
|
||||||
|
<StatusBarItem Grid.Column="6">
|
||||||
|
<TextBlock>
|
||||||
|
Anmldg. geändert: <Run Text="{Binding StatusAncmtModified}"/>
|
||||||
|
</TextBlock>
|
||||||
</StatusBarItem>
|
</StatusBarItem>
|
||||||
</StatusBar>
|
</StatusBar>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
@ -31,6 +31,8 @@ namespace Elwig.Windows {
|
|||||||
MgNrInput, MemberInput, DeliveryScheduleInput, SortIdInput, WineVarietyInput, WeightInput,
|
MgNrInput, MemberInput, DeliveryScheduleInput, SortIdInput, WineVarietyInput, WeightInput,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
DoShowWarningWindows = false;
|
||||||
|
|
||||||
InitializeDelayTimer(SearchInput, SearchInput_TextChanged);
|
InitializeDelayTimer(SearchInput, SearchInput_TextChanged);
|
||||||
SearchInput.TextChanged -= SearchInput_TextChanged;
|
SearchInput.TextChanged -= SearchInput_TextChanged;
|
||||||
ViewModel.FilterSeason = Utils.CurrentLastSeason;
|
ViewModel.FilterSeason = Utils.CurrentLastSeason;
|
||||||
@ -51,7 +53,7 @@ namespace Elwig.Windows {
|
|||||||
WeightInput.Focus();
|
WeightInput.Focus();
|
||||||
WeightInput.SelectAll();
|
WeightInput.SelectAll();
|
||||||
} else if (ctrl == WeightInput) {
|
} else if (ctrl == WeightInput) {
|
||||||
SaveButton_Click(null, null);
|
ShortcutSave();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,6 +129,9 @@ namespace Elwig.Windows {
|
|||||||
DeliveryAncmtList_SelectionChanged, ViewModel.TextFilter.Count > 0 ? ControlUtils.RenewSourceDefault.IfOnly : ControlUtils.RenewSourceDefault.None, !updateSort);
|
DeliveryAncmtList_SelectionChanged, ViewModel.TextFilter.Count > 0 ? ControlUtils.RenewSourceDefault.IfOnly : ControlUtils.RenewSourceDefault.None, !updateSort);
|
||||||
if (updateSort && DeliveryAncmtList.SelectedItem != null)
|
if (updateSort && DeliveryAncmtList.SelectedItem != null)
|
||||||
DeliveryAncmtList.ScrollIntoView(DeliveryAncmtList.SelectedItem);
|
DeliveryAncmtList.ScrollIntoView(DeliveryAncmtList.SelectedItem);
|
||||||
|
|
||||||
|
ViewModel.StatusAncmts = $"{deliveryAncmts.Count:N0}";
|
||||||
|
ViewModel.StatusWeight = $"{deliveryAncmts.Sum(a => a.Weight):N0} kg";
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task RefreshInputs(bool validate = false) {
|
private async Task RefreshInputs(bool validate = false) {
|
||||||
|
@ -200,7 +200,7 @@
|
|||||||
<Label Content="Datum/Zwst.:" Margin="10,10,0,10"/>
|
<Label Content="Datum/Zwst.:" Margin="10,10,0,10"/>
|
||||||
<TextBox x:Name="DateInput" Text="{Binding DateString, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
<TextBox x:Name="DateInput" Text="{Binding DateString, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||||
Margin="0,10,10,10" Width="77" Grid.Column="1" HorizontalAlignment="Left" TextAlignment="Right"
|
Margin="0,10,10,10" Width="77" Grid.Column="1" HorizontalAlignment="Left" TextAlignment="Right"
|
||||||
TextChanged="DateInput_TextChanged" LostFocus="DateInput_LostFocus"/>
|
TextChanged="ScheduleDateInput_TextChanged" LostFocus="DateInput_LostFocus"/>
|
||||||
<ComboBox x:Name="BranchInput" SelectedItem="{Binding Branch, Mode=TwoWay}" ItemsSource="{Binding BranchSource, Mode=TwoWay}"
|
<ComboBox x:Name="BranchInput" SelectedItem="{Binding Branch, Mode=TwoWay}" ItemsSource="{Binding BranchSource, Mode=TwoWay}"
|
||||||
DisplayMemberPath="Name" TextSearch.TextPath="Name"
|
DisplayMemberPath="Name" TextSearch.TextPath="Name"
|
||||||
Margin="82,10,10,10" Width="150" Grid.Column="1" HorizontalAlignment="Left"/>
|
Margin="82,10,10,10" Width="150" Grid.Column="1" HorizontalAlignment="Left"/>
|
||||||
|
@ -297,8 +297,8 @@ namespace Elwig.Windows {
|
|||||||
ViewModel.ControlButtonsVisibility = Visibility.Hidden;
|
ViewModel.ControlButtonsVisibility = Visibility.Hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
private new void DateInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
private void ScheduleDateInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||||
base.DateInput_TextChanged(sender, evt);
|
DateInput_TextChanged(sender, evt);
|
||||||
if (ViewModel.Date is DateOnly date) {
|
if (ViewModel.Date is DateOnly date) {
|
||||||
ViewModel.AncmtToDate = date.AddDays(-2);
|
ViewModel.AncmtToDate = date.AddDays(-2);
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,9 @@
|
|||||||
<MenuItem Header="Abfragen stellen" Click="Menu_Database_Query_Click"/>
|
<MenuItem Header="Abfragen stellen" Click="Menu_Database_Query_Click"/>
|
||||||
<MenuItem Header="Speicherort öffnen..." Click="Menu_Database_Open_Click"/>
|
<MenuItem Header="Speicherort öffnen..." Click="Menu_Database_Open_Click"/>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
<MenuItem Header="Waage">
|
||||||
|
<MenuItem Header="Datum und Uhrzeit setzen" Click="Menu_Scale_SetDateTime_Click"/>
|
||||||
|
</MenuItem>
|
||||||
<MenuItem x:Name="HelpMenu" Header="Hilfe">
|
<MenuItem x:Name="HelpMenu" Header="Hilfe">
|
||||||
<MenuItem Header="Über"/>
|
<MenuItem Header="Über"/>
|
||||||
<MenuItem x:Name="Menu_Help_Update" Header="Nach Updates suchen" Click="Menu_Help_Update_Click"/>
|
<MenuItem x:Name="Menu_Help_Update" Header="Nach Updates suchen" Click="Menu_Help_Update_Click"/>
|
||||||
|
@ -90,6 +90,21 @@ namespace Elwig.Windows {
|
|||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void Menu_Scale_SetDateTime_Click(object sender, RoutedEventArgs evt) {
|
||||||
|
if (App.CommandScales.Count == 0) {
|
||||||
|
MessageBox.Show("Es sind keine geeigneten Waagen verfügbar!", "Datum und Uhrzeit setzen", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
foreach (var s in App.CommandScales) {
|
||||||
|
try {
|
||||||
|
await s.SetDateAndTime(DateTime.Now);
|
||||||
|
} catch (Exception exc) {
|
||||||
|
MessageBox.Show(exc.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MessageBox.Show("Datum und Uhrzeit auf entsprechenden Waagen gesetzt!", "Datum und Uhrzeit setzen", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
|
}
|
||||||
|
|
||||||
private void Menu_Database_Query_Click(object sender, RoutedEventArgs evt) {
|
private void Menu_Database_Query_Click(object sender, RoutedEventArgs evt) {
|
||||||
var w = new QueryWindow();
|
var w = new QueryWindow();
|
||||||
w.Show();
|
w.Show();
|
||||||
|
@ -150,6 +150,9 @@ namespace Elwig.Windows {
|
|||||||
MemberList_SelectionChanged, ViewModel.TextFilter.Count > 0 ? ControlUtils.RenewSourceDefault.IfOnly : ControlUtils.RenewSourceDefault.None, !updateSort);
|
MemberList_SelectionChanged, ViewModel.TextFilter.Count > 0 ? ControlUtils.RenewSourceDefault.IfOnly : ControlUtils.RenewSourceDefault.None, !updateSort);
|
||||||
if (updateSort && MemberList.SelectedItem != null)
|
if (updateSort && MemberList.SelectedItem != null)
|
||||||
MemberList.ScrollIntoView(MemberList.SelectedItem);
|
MemberList.ScrollIntoView(MemberList.SelectedItem);
|
||||||
|
|
||||||
|
ViewModel.StatusMembers = $"{members.Count:N0} ({await ctx.Members.CountAsync():N0})";
|
||||||
|
ViewModel.StatusBusinessShares = $"{members.Sum(m => m.BusinessShares):N0} ({await ctx.Members.SumAsync(m => m.BusinessShares):N0})";
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task RefreshInputs(bool validate = false) {
|
private async Task RefreshInputs(bool validate = false) {
|
||||||
@ -237,7 +240,6 @@ namespace Elwig.Windows {
|
|||||||
var mM = Math.Max(mA.Length, Math.Max(mI.Length, mT.Length));
|
var mM = Math.Max(mA.Length, Math.Max(mI.Length, mT.Length));
|
||||||
var mS = mM > 3;
|
var mS = mM > 3;
|
||||||
if (mS) mM--;
|
if (mS) mM--;
|
||||||
ViewModel.StatusMembers = $"{mA} ({mT})";
|
|
||||||
ViewModel.StatusMembersToolTip =
|
ViewModel.StatusMembersToolTip =
|
||||||
$"{new string(s1, Math.Max(0, mM - mA.Length))}{(mS && mA.Length < 4 ? s2 : "")}{mA} aktive Mitglieder\n" +
|
$"{new string(s1, Math.Max(0, mM - mA.Length))}{(mS && mA.Length < 4 ? s2 : "")}{mA} aktive Mitglieder\n" +
|
||||||
$"{new string(s1, Math.Max(0, mM - mI.Length))}{(mS && mI.Length < 4 ? s2 : "")}{mI} nicht aktive Mitglieder\n" +
|
$"{new string(s1, Math.Max(0, mM - mI.Length))}{(mS && mI.Length < 4 ? s2 : "")}{mI} nicht aktive Mitglieder\n" +
|
||||||
@ -249,7 +251,6 @@ namespace Elwig.Windows {
|
|||||||
var bM = Math.Max(bA.Length, Math.Max(bI.Length, bT.Length));
|
var bM = Math.Max(bA.Length, Math.Max(bI.Length, bT.Length));
|
||||||
var bS = bM > 3;
|
var bS = bM > 3;
|
||||||
if (bS) bM--;
|
if (bS) bM--;
|
||||||
ViewModel.StatusBusinessShares = $"{bA} ({bT})";
|
|
||||||
ViewModel.StatusBusinessSharesToolTip =
|
ViewModel.StatusBusinessSharesToolTip =
|
||||||
$"{new string(s1, Math.Max(0, bM - bA.Length))}{(bS && bA.Length < 4 ? s2 : "")}{bA} Geschäftsanteile von aktiven Mitgliedern\n" +
|
$"{new string(s1, Math.Max(0, bM - bA.Length))}{(bS && bA.Length < 4 ? s2 : "")}{bA} Geschäftsanteile von aktiven Mitgliedern\n" +
|
||||||
$"{new string(s1, Math.Max(0, bM - bI.Length))}{(bS && bI.Length < 4 ? s2 : "")}{bI} Geschäftsanteile von nicht aktiven Mitgliedern\n" +
|
$"{new string(s1, Math.Max(0, bM - bI.Length))}{(bS && bI.Length < 4 ? s2 : "")}{bI} Geschäftsanteile von nicht aktiven Mitgliedern\n" +
|
||||||
@ -746,6 +747,7 @@ namespace Elwig.Windows {
|
|||||||
if (d.ShowDialog() != true)
|
if (d.ShowDialog() != true)
|
||||||
return;
|
return;
|
||||||
ViewModel.TransferPredecessorAreaComs = d.SuccessorSeason;
|
ViewModel.TransferPredecessorAreaComs = d.SuccessorSeason;
|
||||||
|
ViewModel.MaintainAreaComYearTo = d.MaintainYearTo;
|
||||||
if (IsEditing)
|
if (IsEditing)
|
||||||
SetOriginalValue(PredecessorMgNrInput, -1); // hack to allow user to save
|
SetOriginalValue(PredecessorMgNrInput, -1); // hack to allow user to save
|
||||||
UpdateButtons();
|
UpdateButtons();
|
||||||
@ -767,6 +769,7 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void ContactEmailInput_Changed(object sender, RoutedEventArgs evt) {
|
private void ContactEmailInput_Changed(object sender, RoutedEventArgs evt) {
|
||||||
|
CheckBox_Changed(sender, evt);
|
||||||
EmailAddressInput_TextChanged(EmailAddress1Input, new TextChangedEventArgs(evt.RoutedEvent, UndoAction.None));
|
EmailAddressInput_TextChanged(EmailAddress1Input, new TextChangedEventArgs(evt.RoutedEvent, UndoAction.None));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ namespace Tests.DocumentTests {
|
|||||||
[Test]
|
[Test]
|
||||||
public async Task Test_01_TwoMembers() {
|
public async Task Test_01_TwoMembers() {
|
||||||
using var ctx = new AppDbContext();
|
using var ctx = new AppDbContext();
|
||||||
var data = await MemberListData.FromQuery(ctx.Members, []);
|
var data = await MemberListData.FromQuery(ctx.Members, [], []);
|
||||||
using var doc = new MemberList("Alle Mitglieder", data);
|
using var doc = new MemberList("Alle Mitglieder", data);
|
||||||
var text = await Utils.GeneratePdfText(doc, true);
|
var text = await Utils.GeneratePdfText(doc, true);
|
||||||
var table = Utils.ExtractTable(text);
|
var table = Utils.ExtractTable(text);
|
||||||
|
Reference in New Issue
Block a user