Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
cadb5515ea | |||
d8a10152b3 | |||
f09c43c1bd | |||
5c08f61963 |
17
CHANGELOG.md
17
CHANGELOG.md
@ -3,6 +3,23 @@ Changelog
|
||||
=========
|
||||
|
||||
|
||||
[v0.11.0][v0.11.0] (2024-09-16) {#v0.11.0}
|
||||
------------------------------------------
|
||||
|
||||
### Neue Funktionen {#v0.11.0-features}
|
||||
|
||||
* Im Rundschreiben-Fenster (`MailWindow`) können jetzt auch Funktionäre, Bio-Betriebe oder angemeldete Mitglieder für einen Leseplan adressiert werden. (5c08f61963)
|
||||
* Im Leseplan-Fenster (`DeliveryScheduleAdminWindow`) können nun auch Attribut, Bewirtschaftungsart, und ob der Leseplan abgesagt ist angegeben werden. (d8a10152b3)
|
||||
|
||||
### Sonstiges {#v0.11.0-misc}
|
||||
|
||||
* `App.HintContextChange()` ist synchron und fügt Arbeitsaufträge dem Dispatcher hinzu. (f09c43c1bd)
|
||||
|
||||
[v0.11.0]: https://git.necronda.net/winzer/elwig/releases/tag/v0.11.0
|
||||
|
||||
|
||||
|
||||
|
||||
[v0.10.8][v0.10.8] (2024-09-05) {#v0.10.8}
|
||||
------------------------------------------
|
||||
|
||||
|
@ -79,7 +79,7 @@ namespace Elwig {
|
||||
}
|
||||
|
||||
private static void OnContextChanged() {
|
||||
MainDispatcher.BeginInvoke(async () => await HintContextChange());
|
||||
MainDispatcher.BeginInvoke(HintContextChange);
|
||||
}
|
||||
|
||||
private static void OverrideCulture() {
|
||||
@ -201,13 +201,13 @@ namespace Elwig {
|
||||
BranchMobileNr = entry.Item8;
|
||||
}
|
||||
|
||||
public static async Task HintContextChange() {
|
||||
public static void HintContextChange() {
|
||||
var ch = CurrentLastWrite;
|
||||
if (ch > CurrentApp.LastChanged)
|
||||
CurrentApp.LastChanged = ch;
|
||||
foreach (Window w in CurrentApp.Windows) {
|
||||
if (w is not ContextWindow c) continue;
|
||||
await c.HintContextChange();
|
||||
MainDispatcher.BeginInvoke(c.HintContextChange);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<ApplicationIcon>Resources\Images\Elwig.ico</ApplicationIcon>
|
||||
<Version>0.10.8</Version>
|
||||
<Version>0.11.0</Version>
|
||||
<SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
|
@ -9,7 +9,7 @@ namespace Elwig.Helpers {
|
||||
public static class AppDbUpdater {
|
||||
|
||||
// Don't forget to update value in Tests/fetch-resources.bat!
|
||||
public static readonly int RequiredSchemaVersion = 28;
|
||||
public static readonly int RequiredSchemaVersion = 29;
|
||||
|
||||
private static int VersionOffset = 0;
|
||||
|
||||
|
@ -274,7 +274,7 @@ namespace Elwig.Helpers.Export {
|
||||
await ctx.SaveChangesAsync();
|
||||
await AddImportedFiles(Path.GetFileName(meta.FileName));
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
MessageBox.Show(
|
||||
$"Das importieren der Daten war erfolgreich!\n" +
|
||||
|
@ -29,6 +29,15 @@ namespace Elwig.Models.Entities {
|
||||
[Column("description")]
|
||||
public required string Description { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string Identifier => $"{Date:dd.MM.} - {ZwstId} - {Description}";
|
||||
|
||||
[Column("attrid")]
|
||||
public string? AttrId { get; set; }
|
||||
|
||||
[Column("cultid")]
|
||||
public string? CultId { get; set; }
|
||||
|
||||
[Column("max_weight")]
|
||||
public int? MaxWeight { get; set; }
|
||||
[NotMapped]
|
||||
@ -36,6 +45,9 @@ namespace Elwig.Models.Entities {
|
||||
[NotMapped]
|
||||
public double? Percent => (double)AnnouncedWeight / MaxWeight * 100;
|
||||
|
||||
[Column("cancelled")]
|
||||
public bool IsCancelled { get; set; }
|
||||
|
||||
[Column("ancmt_from")]
|
||||
public long? AncmtFromUnix { get; set; }
|
||||
[NotMapped]
|
||||
@ -58,6 +70,12 @@ namespace Elwig.Models.Entities {
|
||||
[ForeignKey("ZwstId")]
|
||||
public virtual Branch Branch { get; private set; } = null!;
|
||||
|
||||
[ForeignKey("AttrId")]
|
||||
public virtual WineAttr? Attribute { get; private set; }
|
||||
|
||||
[ForeignKey("CultId")]
|
||||
public virtual WineCult? Cultivation { get; private set; }
|
||||
|
||||
[InverseProperty(nameof(DeliveryScheduleWineVar.Schedule))]
|
||||
public virtual ICollection<DeliveryScheduleWineVar> Varieties { get; private set; } = null!;
|
||||
|
||||
|
@ -167,6 +167,9 @@ namespace Elwig.Models.Entities {
|
||||
[InverseProperty(nameof(BillingAddr.Member))]
|
||||
public virtual BillingAddr? BillingAddress { get; private set; }
|
||||
|
||||
[InverseProperty(nameof(Delivery.Member))]
|
||||
public virtual ICollection<DeliveryAncmt> Announcements { get; private set; } = null!;
|
||||
|
||||
[InverseProperty(nameof(Delivery.Member))]
|
||||
public virtual ICollection<Delivery> Deliveries { get; private set; } = null!;
|
||||
|
||||
|
23
Elwig/Resources/Sql/28-29.sql
Normal file
23
Elwig/Resources/Sql/28-29.sql
Normal file
@ -0,0 +1,23 @@
|
||||
-- schema version 28 to 29
|
||||
|
||||
ALTER TABLE delivery_schedule ADD COLUMN attrid TEXT DEFAULT NULL;
|
||||
ALTER TABLE delivery_schedule ADD COLUMN cultid TEXT DEFAULT NULL;
|
||||
ALTER TABLE delivery_schedule ADD COLUMN cancelled INTEGER NOT NULL CHECK (cancelled IN (TRUE, FALSE)) DEFAULT FALSE;
|
||||
UPDATE delivery_schedule SET cultid = 'B' WHERE UPPER(description) LIKE '%BIO%';
|
||||
UPDATE delivery_schedule SET cancelled = TRUE WHERE zwstid = 'M' AND date IN ('2024-09-14', '2024-09-16');
|
||||
|
||||
PRAGMA writable_schema = ON;
|
||||
|
||||
UPDATE sqlite_schema SET sql = REPLACE(sql, '
|
||||
) STRICT', ',
|
||||
CONSTRAINT fk_delivery_schedule_wine_attribute FOREIGN KEY (attrid) REFERENCES wine_attribute (attrid)
|
||||
ON UPDATE CASCADE
|
||||
ON DELETE RESTRICT,
|
||||
CONSTRAINT fk_delivery_schedule_wine_cultivation FOREIGN KEY (cultid) REFERENCES wine_cultivation (cultid)
|
||||
ON UPDATE CASCADE
|
||||
ON DELETE RESTRICT
|
||||
) STRICT')
|
||||
WHERE type = 'table' AND name = 'delivery_schedule';
|
||||
|
||||
PRAGMA schema_version = 2801;
|
||||
PRAGMA writable_schema = OFF;
|
@ -136,7 +136,7 @@ namespace Elwig.Services {
|
||||
}
|
||||
}
|
||||
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
return newFbNr;
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ namespace Elwig.Services {
|
||||
}
|
||||
}
|
||||
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
return (year, dsnr, newMgNr, newSortId);
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ namespace Elwig.Services {
|
||||
vm.Branch = (Branch?)ControlUtils.GetItemFromSourceWithPk(vm.BranchSource, s.ZwstId);
|
||||
vm.Description = s.Description;
|
||||
vm.MaxWeight = s.MaxWeight;
|
||||
vm.IsCancelled = s.IsCancelled;
|
||||
vm.MainVarieties.Clear();
|
||||
foreach (var v in s.Varieties.Where(v => v.Priority == 1)) {
|
||||
vm.MainVarieties.Add((WineVar)ControlUtils.GetItemFromSourceWithPk(vm.MainVarietiesSource, v.SortId)!);
|
||||
@ -34,6 +35,8 @@ namespace Elwig.Services {
|
||||
foreach (var v in s.Varieties.Where(v => v.Priority != 1)) {
|
||||
vm.OtherVarieties.Add((WineVar)ControlUtils.GetItemFromSourceWithPk(vm.OtherVarietiesSource, v.SortId)!);
|
||||
}
|
||||
vm.Attribute = ControlUtils.GetItemFromSourceWithPk(vm.AttributeSource, s.AttrId) as WineAttr;
|
||||
vm.Cultivation = ControlUtils.GetItemFromSourceWithPk(vm.CultivationSource, s.CultId) as WineCult;
|
||||
vm.AncmtFrom = s.AncmtFrom;
|
||||
vm.AncmtTo = s.AncmtTo?.AddSeconds(-1);
|
||||
}
|
||||
@ -156,7 +159,10 @@ namespace Elwig.Services {
|
||||
DateString = $"{vm.Date:yyyy-MM-dd}",
|
||||
ZwstId = vm.Branch!.ZwstId,
|
||||
Description = vm.Description,
|
||||
AttrId = vm.Attribute?.AttrId,
|
||||
CultId = vm.Cultivation?.CultId,
|
||||
MaxWeight = vm.MaxWeight,
|
||||
IsCancelled = vm.IsCancelled,
|
||||
AncmtFrom = vm.AncmtFrom,
|
||||
AncmtTo = vm.AncmtTo?.AddMinutes(1),
|
||||
};
|
||||
@ -177,7 +183,7 @@ namespace Elwig.Services {
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -338,7 +338,7 @@ namespace Elwig.Services {
|
||||
var b = new Billing(year);
|
||||
await b.FinishSeason();
|
||||
await b.CalculateBuckets();
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
using var ctx = new AppDbContext();
|
||||
var data = await DeliveryConfirmationDeliveryData.ForMember(ctx.DeliveryParts, year, m);
|
||||
@ -626,7 +626,7 @@ namespace Elwig.Services {
|
||||
}
|
||||
}
|
||||
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
return newMgNr;
|
||||
}
|
||||
|
@ -47,12 +47,30 @@ namespace Elwig.ViewModels {
|
||||
get => int.TryParse(MaxWeightString, out var w) ? w : null;
|
||||
set => MaxWeightString = $"{value}";
|
||||
}
|
||||
[ObservableProperty]
|
||||
private bool _isCancelled;
|
||||
public ObservableCollection<WineVar> MainVarieties { get; set; } = [];
|
||||
[ObservableProperty]
|
||||
private IEnumerable<WineVar> _mainVarietiesSource = [];
|
||||
public ObservableCollection<WineVar> OtherVarieties { get; set; } = [];
|
||||
[ObservableProperty]
|
||||
private IEnumerable<WineVar> _otherVarietiesSource = [];
|
||||
[ObservableProperty]
|
||||
private IEnumerable<object> _attributeSource = [];
|
||||
[ObservableProperty]
|
||||
private object? _attributeObj;
|
||||
public WineAttr? Attribute {
|
||||
get => AttributeObj as WineAttr;
|
||||
set => AttributeObj = value ?? AttributeSource.FirstOrDefault();
|
||||
}
|
||||
[ObservableProperty]
|
||||
private IEnumerable<object> _cultivationSource = [];
|
||||
[ObservableProperty]
|
||||
private object? _cultivationObj;
|
||||
public WineCult? Cultivation {
|
||||
get => CultivationObj as WineCult;
|
||||
set => CultivationObj = value ?? CultivationSource.FirstOrDefault();
|
||||
}
|
||||
|
||||
[ObservableProperty]
|
||||
private string _ancmtFromDateString = "";
|
||||
|
@ -209,7 +209,7 @@ namespace Elwig.Windows {
|
||||
ctx.Remove(a);
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
} catch (Exception exc) {
|
||||
var str = "Der Eintrag konnte nicht in der Datenbank aktualisiert werden!\n\n" + exc.Message;
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
|
@ -196,7 +196,7 @@ namespace Elwig.Windows {
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
MessageBox.Show(str, "Saison anlegen", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
Mouse.OverrideCursor = null;
|
||||
SeasonList.SelectedIndex = 0;
|
||||
}
|
||||
@ -219,7 +219,7 @@ namespace Elwig.Windows {
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
MessageBox.Show(str, "Saison löschen", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
Mouse.OverrideCursor = null;
|
||||
}
|
||||
}
|
||||
|
@ -340,7 +340,7 @@ namespace Elwig.Windows {
|
||||
LockInputs();
|
||||
}
|
||||
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
}
|
||||
|
||||
private void FillInputs(ClientParameters p, Season? s) {
|
||||
|
@ -672,7 +672,7 @@ namespace Elwig.Windows {
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
LockContext = false;
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
} catch (Exception exc) {
|
||||
var str = "Der Eintrag konnte nicht in der Datenbank gespeichert werden!\n\n" + exc.Message;
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
|
@ -313,7 +313,7 @@ namespace Elwig.Windows {
|
||||
ctx.Remove(a);
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
} catch (Exception exc) {
|
||||
var str = "Der Eintrag konnte nicht in der Datenbank aktualisiert werden!\n\n" + exc.Message;
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
|
@ -195,29 +195,34 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="110"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Content="Datum/Zwst.:" Margin="10,10,0,10"/>
|
||||
<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" Grid.ColumnSpan="2" HorizontalAlignment="Left" TextAlignment="Right"
|
||||
TextChanged="ScheduleDateInput_TextChanged" LostFocus="DateInput_LostFocus"/>
|
||||
<ComboBox x:Name="BranchInput" SelectedItem="{Binding Branch, Mode=TwoWay}" ItemsSource="{Binding BranchSource, Mode=TwoWay}"
|
||||
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" Grid.ColumnSpan="2" HorizontalAlignment="Left"/>
|
||||
|
||||
<Label Content="Beschreibung:" Margin="10,40,0,10"/>
|
||||
<TextBox x:Name="DescriptionInput" Text="{Binding Description, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0,40,10,10" Grid.Column="1"
|
||||
Margin="0,40,10,10" Grid.Column="1" Grid.ColumnSpan="2"
|
||||
TextChanged="TextBox_TextChanged"/>
|
||||
|
||||
<Label Content="Max. Gewicht:" Margin="10,70,0,10"/>
|
||||
<ctrl:UnitTextBox x:Name="MaxWeightInput" Unit="kg" Text="{Binding MaxWeightString, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0,70,10,10" Grid.Column="1" Width="68" HorizontalAlignment="Left"
|
||||
Margin="0,70,10,10" Grid.Column="1" Grid.ColumnSpan="2" Width="68" HorizontalAlignment="Left"
|
||||
TextChanged="MaxWeightInput_TextChanged"/>
|
||||
|
||||
<CheckBox x:Name="CancelledInput" Content="Abgesagt" IsChecked="{Binding IsCancelled, Mode=TwoWay}"
|
||||
Grid.Column="1" Grid.ColumnSpan="2" Margin="80,75,0,0" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="CheckBox_Changed" Unchecked="CheckBox_Changed"/>
|
||||
|
||||
<Label Content="Sorten:" Margin="10,100,0,10"/>
|
||||
<ctrl:CheckComboBox x:Name="MainWineVarietiesInput" SelectedItems="{Binding MainVarieties}" ItemsSource="{Binding MainVarietiesSource, Mode=TwoWay}"
|
||||
Grid.Column="1" Margin="0,100,10,10"
|
||||
Grid.Column="1" Grid.ColumnSpan="2" Margin="0,100,10,10"
|
||||
Delimiter=", " AllItemsSelectedContent="Alle Sorten" ListDisplayMemberPath="SortId" TextSearch.TextPath="Name">
|
||||
<ctrl:CheckComboBox.ItemTemplateSelector>
|
||||
<ctrl:WineVarietyTemplateSelector/>
|
||||
@ -226,12 +231,20 @@
|
||||
|
||||
<Label Content="Weitere Sorten:" Margin="10,130,0,10"/>
|
||||
<ctrl:CheckComboBox x:Name="OtherWineVarietiesInput" SelectedItems="{Binding OtherVarieties}" ItemsSource="{Binding OtherVarietiesSource, Mode=TwoWay}"
|
||||
Grid.Column="1" Margin="0,130,10,10"
|
||||
Grid.Column="1" Grid.ColumnSpan="2" Margin="0,130,10,10"
|
||||
Delimiter=", " AllItemsSelectedContent="Alle Sorten" ListDisplayMemberPath="SortId" TextSearch.TextPath="Name">
|
||||
<ctrl:CheckComboBox.ItemTemplateSelector>
|
||||
<ctrl:WineVarietyTemplateSelector/>
|
||||
</ctrl:CheckComboBox.ItemTemplateSelector>
|
||||
</ctrl:CheckComboBox>
|
||||
|
||||
<Label Content="Attribut/Bewirt.:" Margin="10,160,0,10"/>
|
||||
<ComboBox x:Name="AttributeInput" SelectedItem="{Binding AttributeObj, Mode=TwoWay}" ItemsSource="{Binding AttributeSource, Mode=TwoWay}"
|
||||
Grid.Column="1" Margin="0,160,5,10"
|
||||
DisplayMemberPath="Name"/>
|
||||
<ComboBox x:Name="CultivationInput" SelectedItem="{Binding CultivationObj, Mode=TwoWay}" ItemsSource="{Binding CultivationSource, Mode=TwoWay}"
|
||||
Grid.Column="2" Margin="0,160,10,10"
|
||||
DisplayMemberPath="Name"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
|
@ -103,6 +103,12 @@ namespace Elwig.Windows {
|
||||
var varieties = await ctx.WineVarieties.OrderBy(v => v.Name).ToListAsync();
|
||||
ControlUtils.RenewItemsSource(MainWineVarietiesInput, varieties);
|
||||
ControlUtils.RenewItemsSource(OtherWineVarietiesInput, varieties);
|
||||
var attrList = await ctx.WineAttributes.OrderBy(a => a.Name).Cast<object>().ToListAsync();
|
||||
attrList.Insert(0, new NullItem("- Keine Angabe -"));
|
||||
ControlUtils.RenewItemsSource(AttributeInput, attrList, null, ControlUtils.RenewSourceDefault.First);
|
||||
var cultList = await ctx.WineCultivations.OrderBy(a => a.Name).Cast<object>().ToListAsync();
|
||||
cultList.Insert(0, new NullItem("- Kein Angabe -"));
|
||||
ControlUtils.RenewItemsSource(CultivationInput, cultList, null, ControlUtils.RenewSourceDefault.First);
|
||||
|
||||
await RefreshList();
|
||||
}
|
||||
@ -177,7 +183,7 @@ namespace Elwig.Windows {
|
||||
ctx.Remove(s);
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
} catch (Exception exc) {
|
||||
var str = "Der Eintrag konnte nicht in der Datenbank aktualisiert werden!\n\n" + exc.Message;
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
|
@ -108,36 +108,67 @@
|
||||
<RadioButton GroupName="Recipients" x:Name="RecipientsAreaComMembersInput" Content="Mitglieder mit Flächenbindung"
|
||||
Margin="10,30,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="RecipientsInput_Changed" Unchecked="RecipientsInput_Changed"/>
|
||||
<RadioButton GroupName="Recipients" x:Name="RecipientsDeliveryMembersInput" Content="Lieferanten der Saison"
|
||||
<RadioButton GroupName="Recipients" x:Name="RecipientsDeliveryAncmtMembersInput" Content="Mitglieder mit Anmeldung"
|
||||
Margin="10,50,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="RecipientsInput_Changed" Unchecked="RecipientsInput_Changed"/>
|
||||
<RadioButton GroupName="Recipients" x:Name="RecipientsNonDeliveryMembersInput" Content="Nicht-Lieferanten der Saison"
|
||||
<RadioButton GroupName="Recipients" x:Name="RecipientsDeliveryMembersInput" Content="Lieferanten der Saison"
|
||||
Margin="10,70,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="RecipientsInput_Changed" Unchecked="RecipientsInput_Changed"/>
|
||||
<RadioButton GroupName="Recipients" x:Name="RecipientsCustomInput" Content="Benutzerdefiniert"
|
||||
<RadioButton GroupName="Recipients" x:Name="RecipientsNonDeliveryMembersInput" Content="Nicht-Lieferanten der Saison"
|
||||
Margin="10,90,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="RecipientsInput_Changed" Unchecked="RecipientsInput_Changed"/>
|
||||
<RadioButton GroupName="Recipients" x:Name="RecipientsCustomInput" Content="Benutzerdefiniert"
|
||||
Margin="10,110,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="RecipientsInput_Changed" Unchecked="RecipientsInput_Changed"/>
|
||||
|
||||
<Label Content="Zwst.:" x:Name="MemberBranchLabel" Margin="10,120,0,10"/>
|
||||
<Label Content="Zwst.:" x:Name="MemberBranchLabel" Margin="10,140,0,10"/>
|
||||
<ctrl:CheckComboBox x:Name="MemberBranchInput" AllItemsSelectedContent="Alle Stammzweigstellen" Delimiter=", " DisplayMemberPath="Name"
|
||||
Margin="50,120,10,10" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="25"
|
||||
Margin="50,140,10,10" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="25"
|
||||
SelectionChanged="MemberInput_SelectionChanged"/>
|
||||
|
||||
<Label Content="Gem.:" x:Name="MemberKgLabel" Margin="10,150,0,10"/>
|
||||
<Label Content="Gem.:" x:Name="MemberKgLabel" Margin="10,170,0,10"/>
|
||||
<ctrl:CheckComboBox x:Name="MemberKgInput" AllItemsSelectedContent="Alle Stammgemeinden" Delimiter=", " DisplayMemberPath="Name"
|
||||
IsSelectAllActive="True" SelectAllContent="Alle Stammgemeinden"
|
||||
Margin="50,150,10,10" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="25"
|
||||
Margin="50,170,10,10" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="25"
|
||||
SelectionChanged="MemberInput_SelectionChanged"/>
|
||||
|
||||
<Label Content="Vtrg.:" x:Name="MemberAreaComLabel" Margin="10,180,0,10"/>
|
||||
<Label Content="Bio-Betrieb:" x:Name="MemberOrganicLabel" Margin="10,200,0,10"/>
|
||||
<RadioButton x:Name="MemberOrganicYesInput" Content="Ja" GroupName="MemberOrganic"
|
||||
Margin="80,205,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="MemberInput_Checked"/>
|
||||
<RadioButton x:Name="MemberOrganicNoInput" Content="Nein" GroupName="MemberOrganic"
|
||||
Margin="125,205,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="MemberInput_Checked"/>
|
||||
<RadioButton x:Name="MemberOrganicIndifferentInput" Content="Egal" GroupName="MemberOrganic"
|
||||
Margin="180,205,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="MemberInput_Checked"/>
|
||||
|
||||
<Label Content="Funktionär:" x:Name="MemberFunktionärLabel" Margin="10,230,0,10"/>
|
||||
<RadioButton x:Name="MemberFunktionärYesInput" Content="Ja" GroupName="MemberFunktionär"
|
||||
Margin="80,235,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="MemberInput_Checked"/>
|
||||
<RadioButton x:Name="MemberFunktionärNoInput" Content="Nein" GroupName="MemberFunktionär"
|
||||
Margin="125,235,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="MemberInput_Checked"/>
|
||||
<RadioButton x:Name="MemberFunktionärIndifferentInput" Content="Egal" GroupName="MemberFunktionär"
|
||||
Margin="180,235,10,10" VerticalAlignment="Top" HorizontalAlignment="Left"
|
||||
Checked="MemberInput_Checked"/>
|
||||
|
||||
<Label Content="Vtrg.:" x:Name="MemberAreaComLabel" Margin="10,260,0,10"/>
|
||||
<ctrl:CheckComboBox x:Name="MemberAreaComInput" AllItemsSelectedContent="Alle Vertragsarten" Delimiter=", " DisplayMemberPath="VtrgId"
|
||||
IsSelectAllActive="True" SelectAllContent="Alle Vertragsarten"
|
||||
Margin="50,180,10,10" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="25"
|
||||
Margin="50,260,10,10" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="25"
|
||||
SelectionChanged="MemberInput_SelectionChanged"/>
|
||||
|
||||
<Label Content="Tag:" x:Name="MemberDeliveryAncmtLabel" Margin="10,260,0,10"/>
|
||||
<ctrl:CheckComboBox x:Name="MemberDeliveryAncmtInput" AllItemsSelectedContent="Alle Lesepläne" Delimiter=", " DisplayMemberPath="Identifier"
|
||||
IsSelectAllActive="True" SelectAllContent="Alle Lesepläne"
|
||||
Margin="50,260,10,10" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="25"
|
||||
SelectionChanged="MemberInput_SelectionChanged"/>
|
||||
|
||||
<ctrl:CheckComboBox x:Name="MemberCustomInput" AllItemsSelectedContent="Alle Mitglieder" Delimiter=", " DisplayMemberPath="AdministrativeName"
|
||||
IsSelectAllActive="True" SelectAllContent="Alle Mitglieder"
|
||||
Margin="10,120,10,10" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="25"
|
||||
Margin="10,140,10,10" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="25"
|
||||
SelectionChanged="MemberInput_SelectionChanged"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
@ -116,6 +116,9 @@ namespace Elwig.Windows {
|
||||
CreditNoteFooterInput.Visibility = Visibility.Hidden;
|
||||
RecipientsActiveMembersInput.IsChecked = true;
|
||||
|
||||
MemberOrganicIndifferentInput.IsChecked = true;
|
||||
MemberFunktionärIndifferentInput.IsChecked = true;
|
||||
|
||||
DeliveryConfirmationFooterInput.Text = App.Client.TextDeliveryConfirmation;
|
||||
CreditNoteFooterInput.Text = App.Client.TextCreditNote;
|
||||
|
||||
@ -164,6 +167,17 @@ namespace Elwig.Windows {
|
||||
MemberAreaComInput.SelectAll();
|
||||
MemberAreaComInput.SelectionChanged += MemberInput_SelectionChanged;
|
||||
}
|
||||
ControlUtils.RenewItemsSource(MemberDeliveryAncmtInput, await ctx.DeliverySchedules
|
||||
.Where(s => s.Year == Year)
|
||||
.OrderBy(s => s.DateString)
|
||||
.ThenBy(s => s.Branch.Name)
|
||||
.ThenBy(s => s.Description)
|
||||
.ToListAsync(), MemberInput_SelectionChanged);
|
||||
if (MemberDeliveryAncmtInput.SelectedItems.Count == 0) {
|
||||
MemberDeliveryAncmtInput.SelectionChanged -= MemberInput_SelectionChanged;
|
||||
MemberDeliveryAncmtInput.SelectAll();
|
||||
MemberDeliveryAncmtInput.SelectionChanged += MemberInput_SelectionChanged;
|
||||
}
|
||||
ControlUtils.RenewItemsSource(MemberCustomInput, await ctx.Members
|
||||
.Where(m => m.IsActive)
|
||||
.OrderBy(m => m.Name)
|
||||
@ -291,8 +305,18 @@ namespace Elwig.Windows {
|
||||
MemberBranchInput.Visibility = vis;
|
||||
MemberKgLabel.Visibility = vis;
|
||||
MemberKgInput.Visibility = vis;
|
||||
MemberOrganicLabel.Visibility = vis;
|
||||
MemberOrganicYesInput.Visibility = vis;
|
||||
MemberOrganicNoInput.Visibility = vis;
|
||||
MemberOrganicIndifferentInput.Visibility = vis;
|
||||
MemberFunktionärLabel.Visibility = vis;
|
||||
MemberFunktionärYesInput.Visibility = vis;
|
||||
MemberFunktionärNoInput.Visibility = vis;
|
||||
MemberFunktionärIndifferentInput.Visibility = vis;
|
||||
MemberAreaComInput.Visibility = RecipientsAreaComMembersInput.IsChecked == true ? Visibility.Visible : Visibility.Hidden;
|
||||
MemberAreaComLabel.Visibility = RecipientsAreaComMembersInput.IsChecked == true ? Visibility.Visible : Visibility.Hidden;
|
||||
MemberDeliveryAncmtInput.Visibility = RecipientsDeliveryAncmtMembersInput.IsChecked == true ? Visibility.Visible : Visibility.Hidden;
|
||||
MemberDeliveryAncmtLabel.Visibility = RecipientsDeliveryAncmtMembersInput.IsChecked == true ? Visibility.Visible : Visibility.Hidden;
|
||||
MemberCustomInput.Visibility = RecipientsCustomInput.IsChecked == true ? Visibility.Visible : Visibility.Hidden;
|
||||
using var ctx = new AppDbContext();
|
||||
await UpdateRecipients(ctx);
|
||||
@ -303,6 +327,11 @@ namespace Elwig.Windows {
|
||||
await UpdateRecipients(ctx);
|
||||
}
|
||||
|
||||
private async void MemberInput_Checked(object sender, RoutedEventArgs evt) {
|
||||
using var ctx = new AppDbContext();
|
||||
await UpdateRecipients(ctx);
|
||||
}
|
||||
|
||||
private void Date_TextChanged(object sender, RoutedEventArgs evt) {
|
||||
Validator.CheckDate((TextBox)sender, true);
|
||||
}
|
||||
@ -325,10 +354,23 @@ namespace Elwig.Windows {
|
||||
var kgs = MemberKgInput.SelectedItems.Cast<AT_Kg>().Select(k => k.KgNr).ToList();
|
||||
query = query.Where(m => kgs.Contains((int)m.DefaultKgNr!));
|
||||
}
|
||||
if (MemberOrganicYesInput.IsChecked == true) {
|
||||
query = query.Where(m => m.IsOrganic);
|
||||
} else if (MemberOrganicNoInput.IsChecked == true) {
|
||||
query = query.Where(m => !m.IsOrganic);
|
||||
}
|
||||
if (MemberFunktionärYesInput.IsChecked == true) {
|
||||
query = query.Where(m => m.IsFunktionär);
|
||||
} else if (MemberFunktionärNoInput.IsChecked == true) {
|
||||
query = query.Where(m => !m.IsFunktionär);
|
||||
}
|
||||
|
||||
if (RecipientsAreaComMembersInput.IsChecked == true) {
|
||||
var vtrg = MemberAreaComInput.SelectedItems.Cast<AreaComType>().Select(a => a.VtrgId).ToList();
|
||||
query = query.Where(m => m.IsActive && m.AreaCommitments.AsQueryable().Where(Utils.ActiveAreaCommitments(Year)).Any(c => vtrg.Contains(c.VtrgId)));
|
||||
} else if (RecipientsDeliveryAncmtMembersInput.IsChecked == true) {
|
||||
var dsnrs = MemberDeliveryAncmtInput.SelectedItems.Cast<DeliverySchedule>().Select(s => s.DsNr).ToList();
|
||||
query = query.Where(m => m.Announcements.Any(a => a.Year == Year && dsnrs.Contains(a.DsNr)));
|
||||
} else if (RecipientsDeliveryMembersInput.IsChecked == true) {
|
||||
query = query.Where(m => m.Deliveries.Any(d => d.Year == Year));
|
||||
} else if (RecipientsNonDeliveryMembersInput.IsChecked == true) {
|
||||
@ -473,7 +515,7 @@ namespace Elwig.Windows {
|
||||
var b = new Billing(year);
|
||||
await b.FinishSeason();
|
||||
await b.CalculateBuckets();
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
dcData[year] = await DeliveryConfirmationDeliveryData.ForSeason(ctx.DeliveryParts, year);
|
||||
} catch (Exception exc) {
|
||||
|
@ -287,7 +287,7 @@ namespace Elwig.Windows {
|
||||
var b = new Billing(year);
|
||||
await b.FinishSeason();
|
||||
await b.CalculateBuckets();
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
using var ctx = new AppDbContext();
|
||||
var tbl1 = await OverUnderDeliveryData.ForSeason(ctx.OverUnderDeliveryRows, year);
|
||||
@ -326,7 +326,7 @@ namespace Elwig.Windows {
|
||||
var b = new Billing(year);
|
||||
await b.FinishSeason();
|
||||
await b.CalculateBuckets();
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
using var ctx = new AppDbContext();
|
||||
using var ods = new OdsFile(d.FileName);
|
||||
|
@ -374,7 +374,7 @@ namespace Elwig.Windows {
|
||||
ctx.Remove(l);
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
} catch (Exception exc) {
|
||||
var str = "Der Eintrag konnte nicht in der Datenbank aktualisiert werden!\n\n" + exc.Message;
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
|
@ -191,7 +191,7 @@ namespace Elwig.Windows {
|
||||
}
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
ControlUtils.SelectItemWithPk(WbGlKgs, k.KgNr);
|
||||
} catch (Exception exc) {
|
||||
var str = "Der Eintrag konnte nicht in der Datenbank aktualisiert werden!\n\n" + exc.Message;
|
||||
@ -211,7 +211,7 @@ namespace Elwig.Windows {
|
||||
ctx.Remove(k.WbKg);
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
ControlUtils.SelectItemWithPk(WbKgs, k.KgNr);
|
||||
} catch (Exception exc) {
|
||||
await HintContextChange();
|
||||
|
@ -173,7 +173,7 @@ namespace Elwig.Windows {
|
||||
|
||||
var b = new Billing(Year);
|
||||
await b.AutoAdjustBusinessShares(new DateOnly(Year, 11, 30), kg ?? default, bs ?? default, kgPerBs ?? default, percent / 100.0 ?? default, minBs ?? default);
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
} catch (Exception exc) {
|
||||
var str = "Der Eintrag konnte nicht in der Datenbank aktualisiert werden!\n\n" + exc.Message;
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
@ -187,7 +187,7 @@ namespace Elwig.Windows {
|
||||
try {
|
||||
var b = new Billing(Year);
|
||||
await b.UnAdjustBusinessShares();
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
} catch (Exception exc) {
|
||||
var str = "Der Eintrag konnte nicht in der Datenbank aktualisiert werden!\n\n" + exc.Message;
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
@ -309,7 +309,7 @@ namespace Elwig.Windows {
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
MessageBox.Show(str, "Benutzerdefinierten Zu-/Abschlag speichern", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
Mouse.OverrideCursor = null;
|
||||
}
|
||||
}
|
||||
|
@ -240,7 +240,7 @@ namespace Elwig.Windows {
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
ControlUtils.SelectItem(PaymentVariantList, v);
|
||||
} catch (Exception exc) {
|
||||
@ -268,7 +268,7 @@ namespace Elwig.Windows {
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
|
||||
ControlUtils.SelectItem(PaymentVariantList, n);
|
||||
} catch (Exception exc) {
|
||||
@ -285,7 +285,7 @@ namespace Elwig.Windows {
|
||||
ctx.Remove(v);
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
} catch (Exception exc) {
|
||||
var str = "Der Eintrag konnte nicht in der Datenbank aktualisiert werden!\n\n" + exc.Message;
|
||||
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||
@ -304,7 +304,7 @@ namespace Elwig.Windows {
|
||||
} catch (Exception exc) {
|
||||
MessageBox.Show(exc.Message, "Berechnungsfehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
Mouse.OverrideCursor = null;
|
||||
CalculateButton.IsEnabled = true;
|
||||
}
|
||||
@ -399,7 +399,7 @@ namespace Elwig.Windows {
|
||||
}
|
||||
Mouse.OverrideCursor = null;
|
||||
RevertButton.IsEnabled = true;
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
}
|
||||
|
||||
private async void RevertButton_Click(object sender, RoutedEventArgs evt) {
|
||||
@ -415,7 +415,7 @@ namespace Elwig.Windows {
|
||||
Mouse.OverrideCursor = Cursors.AppStarting;
|
||||
var b = new BillingVariant(v.Year, v.AvNr);
|
||||
await b.Revert();
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
Mouse.OverrideCursor = null;
|
||||
CommitButton.IsEnabled = true;
|
||||
}
|
||||
@ -507,7 +507,7 @@ namespace Elwig.Windows {
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
|
||||
await App.HintContextChange();
|
||||
App.HintContextChange();
|
||||
CommentInput_TextChanged(null, null);
|
||||
ConsiderModifiersInput_Changed(null, null);
|
||||
ConsiderPenaltiesInput_Changed(null, null);
|
||||
|
@ -1 +1 @@
|
||||
curl --fail -s -L "https://elwig.at/files/create.sql?v=28" -u "elwig:ganzGeheim123!" -o "Resources\Sql\Create.sql"
|
||||
curl --fail -s -L "https://elwig.at/files/create.sql?v=29" -u "elwig:ganzGeheim123!" -o "Resources\Sql\Create.sql"
|
||||
|
Reference in New Issue
Block a user