Compare commits
4
Commits
main
...
54d5f1e6ac
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54d5f1e6ac | ||
|
|
f3f8299f5b | ||
|
|
3541f36831 | ||
|
|
569913fe8f |
No files matched your search
@@ -69,7 +69,7 @@ namespace Elwig.Documents {
|
||||
.SetBorder(new SolidBorder(new DeviceRgb(0x80, 0x80, 0x80), BorderThickness))
|
||||
.AddCell(NewAsideCell("Mitglied", 26))
|
||||
.AddCell(NewAsideCell("Mitglieds-Nr.:", 9, isName: true)).AddCell(NewAsideCell($"{Member.MgNr}", 17))
|
||||
.AddCell(NewAsideCell("Betriebs-Nr.:", 9, isName: true)).AddCell(NewAsideCell(Member.LfbisNr ?? "", 17))
|
||||
.AddCell(NewAsideCell("Betriebs-Nr.:", 9, isName: true)).AddCell(NewAsideCell((Member.LfbisNr ?? "-") + (Member.OrganicAuthorityCode != null ? $" ({Member.OrganicAuthorityCode})" : ""), 17))
|
||||
.AddCell(NewAsideCell("UID:", 9, isName: true)).AddCell(NewAsideCell(uid, 17));
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace Elwig.Documents {
|
||||
.Item(c.Address).Item($"{c.Plz} {c.Ort}").Item("Österreich").Item("Tel.", c.PhoneNr).Item("Fax", c.FaxNr).NextLine()
|
||||
.Item(c.EmailAddress != null ? link1 : null)
|
||||
.Item(c.Website != null ? link2 : null)
|
||||
.Item("Betriebs-Nr.", c.LfbisNr).Item("Bio-KSt.", c.OrganicAuthority).NextLine()
|
||||
.Item("Betriebs-Nr.", c.LfbisNr).Item("Bio-KSt.", c.OrganicAuthorityCode).NextLine()
|
||||
.Item("UID", c.UstIdNr).Item("BIC", c.Bic).Item("IBAN", c.Iban)
|
||||
.ToLeafElements());
|
||||
}
|
||||
|
||||
@@ -153,6 +153,9 @@ namespace Elwig.Documents {
|
||||
if (part.Cultivation != null) {
|
||||
var cult = new KernedParagraph(8);
|
||||
cult.Add(Italic("Bewirtschaftung:")).Add(Normal(" " + part.Cultivation.Name + (part.Cultivation.Description != null ? $" ({part.Cultivation.Description})" : "")));
|
||||
if (part.Cultivation.IsOrganic) {
|
||||
cult.Add(" \u2013 ").Add(Italic("Kontrollstelle:")).Add(Normal($" {Member.OrganicAuthorityCode ?? "?"}"));
|
||||
}
|
||||
sub.AddCell(NewTd())
|
||||
.AddCell(NewTd(cult, colspan: 5))
|
||||
.AddCell(NewTd(colspan: 3));
|
||||
|
||||
@@ -161,7 +161,8 @@ namespace Elwig.Documents {
|
||||
.AddCell(NewDataTh("Buchführend:", colspan: 2)).AddCell(NewTd(new KernedParagraph(Member.IsBuchführend ? "Ja " : "Nein ", 10)
|
||||
.Add(Normal($"({(Member.IsBuchführend ? season.VatNormal : season.VatFlatrate) * 100:N0}% USt.)", 8)), colspan: 2))
|
||||
.AddCell(NewDataTh("(Katastralgemeinde mit dem größten Anteil an Weinbauflächen)", 8, colspan: 2))
|
||||
.AddCell(NewDataTh("Bio:", colspan: 2)).AddCell(NewTd(Member.IsOrganic ? "Ja" : "Nein", colspan: 2))
|
||||
.AddCell(NewDataTh("Bio:", colspan: 2)).AddCell(NewTd(new KernedParagraph(Member.IsOrganic ? "Ja" : "Nein", 10)
|
||||
.Add(Normal(Member.OrganicAuthorityCode != null || Member.OrganicOperatorId != null ? $" ({Member.OrganicAuthorityCode}{(Member.OrganicAuthorityCode != null && Member.OrganicOperatorId != null ? ", " : "")}{Member.OrganicOperatorId})" : "", 8)), colspan: 2))
|
||||
.AddCell(NewDataHdr("Genossenschaft", colspan: 6))
|
||||
.AddCell(NewDataTh("Status:")).AddCell(NewTd(new KernedParagraph(Member.IsActive ? "Aktiv " : "Nicht aktiv ", 10)
|
||||
.Add(Normal("(" + (Member.ExitDate != null ? $"{Member.EntryDate:dd.MM.yyyy}\u2013{Member.ExitDate:dd.MM.yyyy}" : $"seit {Member.EntryDate:dd.MM.yyyy}") + ")", 8))))
|
||||
|
||||
@@ -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 = 41;
|
||||
public static readonly int RequiredSchemaVersion = 42;
|
||||
|
||||
private static int VersionOffset = 0;
|
||||
|
||||
|
||||
@@ -49,7 +49,8 @@ namespace Elwig.Helpers {
|
||||
public string? Bic;
|
||||
public string? UstIdNr;
|
||||
public string? LfbisNr;
|
||||
public string? OrganicAuthority;
|
||||
public string? OrganicOperatorId;
|
||||
public string? OrganicAuthorityCode;
|
||||
|
||||
public string? PhoneNr;
|
||||
public string? FaxNr;
|
||||
@@ -114,7 +115,8 @@ namespace Elwig.Helpers {
|
||||
UstIdNr = parameters.GetValueOrDefault("CLIENT_USTIDNR");
|
||||
Bic = parameters.GetValueOrDefault("CLIENT_BIC");
|
||||
Iban = parameters.GetValueOrDefault("CLIENT_IBAN");
|
||||
OrganicAuthority = parameters.GetValueOrDefault("CLIENT_ORGANIC_AUTHORITY");
|
||||
OrganicOperatorId = parameters.GetValueOrDefault("CLIENT_ORGANIC_OPERATORID");
|
||||
OrganicAuthorityCode = parameters.GetValueOrDefault("CLIENT_ORGANIC_AUTHORITYCODE");
|
||||
|
||||
EnableMemberHistory = (parameters.GetValueOrDefault("ENABLE_MEMBERHISTORY")?.ToUpper()) switch {
|
||||
"1" or "TRUE" or "YES" or "JA" => true,
|
||||
@@ -273,7 +275,8 @@ namespace Elwig.Helpers {
|
||||
("CLIENT_USTIDNR", UstIdNr),
|
||||
("CLIENT_BIC", Bic),
|
||||
("CLIENT_IBAN", Iban),
|
||||
("CLIENT_ORGANIC_AUTHORITY", OrganicAuthority),
|
||||
("CLIENT_ORGANIC_OPERATORID", OrganicOperatorId),
|
||||
("CLIENT_ORGANIC_AUTHORITYCODE", OrganicAuthorityCode),
|
||||
("ENABLE_MEMBERHISTORY", EnableMemberHistory ? "YES" : "NO"),
|
||||
("MODE_BUSINESSSHARES", businessShares),
|
||||
("MODE_DELIVERYNOTE_STATS", deliveryNoteStats),
|
||||
|
||||
@@ -638,6 +638,8 @@ namespace Elwig.Helpers.Export {
|
||||
["zwstid"] = m.ZwstId,
|
||||
["lfbis_nr"] = m.LfbisNr,
|
||||
["ustid_nr"] = m.UstIdNr,
|
||||
["ooc_id"] = m.OrganicOperatorId,
|
||||
["org_auth_code"] = m.OrganicAuthorityCode,
|
||||
["juridical_pers"] = m.IsJuridicalPerson,
|
||||
["volllieferant"] = m.IsVollLieferant,
|
||||
["buchführend"] = m.IsBuchführend,
|
||||
@@ -710,6 +712,8 @@ namespace Elwig.Helpers.Export {
|
||||
ZwstId = json["zwstid"]?.AsValue().GetValue<string>(),
|
||||
LfbisNr = json["lfbis_nr"]?.AsValue().GetValue<string>(),
|
||||
UstIdNr = json["ustid_nr"]?.AsValue().GetValue<string>(),
|
||||
OrganicOperatorId = json["ooc_id"]?.AsValue().GetValue<string>(),
|
||||
OrganicAuthorityCode = json["org_auth_code"]?.AsValue().GetValue<string>(),
|
||||
IsJuridicalPerson = json["juridical_pers"]?.AsValue().GetValue<bool>() ?? false,
|
||||
IsVollLieferant = json["volllieferant"]?.AsValue().GetValue<bool>() ?? false,
|
||||
IsBuchführend = json["buchführend"]?.AsValue().GetValue<bool>() ?? false,
|
||||
|
||||
@@ -623,6 +623,37 @@ namespace Elwig.Helpers {
|
||||
return new(true, null);
|
||||
}
|
||||
|
||||
public static ValidationResult CheckOrganicOperatorId(TextBox input, bool required) {
|
||||
string text = "";
|
||||
int pos = input.CaretIndex;
|
||||
for (int i = 0, v = 0; i < input.Text.Length; i++) {
|
||||
char ch = input.Text[i];
|
||||
if (char.IsAsciiDigit(ch)) {
|
||||
if (v == 3 && text[^1] != '-')
|
||||
text += "-";
|
||||
v++;
|
||||
text += ch;
|
||||
}
|
||||
|
||||
if (i == input.CaretIndex - 1) {
|
||||
pos = text.Length;
|
||||
} else if (v >= 10) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
input.Text = text;
|
||||
input.CaretIndex = pos;
|
||||
|
||||
if (text.Length == 0) {
|
||||
return required ? new(false, "OOC-ID ist nicht optional") : new(true, null);
|
||||
} else if (!text.StartsWith("040-") || text.Length != 11) {
|
||||
return new(false, "OOC-ID ist ungültig");
|
||||
}
|
||||
|
||||
return new(true, null);
|
||||
}
|
||||
|
||||
public static ValidationResult CheckOrganicAuthorityCode(TextBox input, bool required) {
|
||||
string text = "";
|
||||
int pos = input.CaretIndex;
|
||||
@@ -631,15 +662,18 @@ namespace Elwig.Helpers {
|
||||
if (v < 2 && char.IsAsciiLetter(ch)) {
|
||||
v++;
|
||||
text += ch;
|
||||
} else if ((v == 2 || v == 6) && ch == '-') {
|
||||
v++;
|
||||
} else if ((v == 2 || v == 5) && ch == '-' && text[^1] != '-') {
|
||||
text += ch;
|
||||
} else if (v >= 2 && char.IsLetterOrDigit(ch)) {
|
||||
} else if (v >= 2 && v <= 4 && char.IsLetter(ch)) {
|
||||
if (v == 2 && text[^1] != '-')
|
||||
text += "-";
|
||||
if (text.StartsWith("AT")) {
|
||||
if (v == 3 && ch == 'B' || v == 4 && ch == 'I' || v == 5 && ch == 'O') {
|
||||
if (v == 2 && ch == 'B' || v == 3 && ch == 'I' || v == 4 && ch == 'O') {
|
||||
v++;
|
||||
text += ch;
|
||||
} else if (v > 6 && char.IsAsciiDigit(ch)) {
|
||||
}
|
||||
} else if (text.StartsWith("DE")) {
|
||||
if (v == 2 && ch == 'Ö' || v == 3 && ch == 'K' || v == 4 && ch == 'O') {
|
||||
v++;
|
||||
text += ch;
|
||||
}
|
||||
@@ -647,11 +681,16 @@ namespace Elwig.Helpers {
|
||||
v++;
|
||||
text += ch;
|
||||
}
|
||||
} else if (v >= 5 && v <= 7 && char.IsAsciiDigit(ch)) {
|
||||
if (v == 5 && text[^1] != '-')
|
||||
text += "-";
|
||||
v++;
|
||||
text += ch;
|
||||
}
|
||||
|
||||
if (i == input.CaretIndex - 1) {
|
||||
pos = text.Length;
|
||||
} else if (text.StartsWith("AT") && v >= 10) {
|
||||
} else if ((text.StartsWith("AT") || text.StartsWith("DE")) && v >= 10) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -662,7 +701,7 @@ namespace Elwig.Helpers {
|
||||
if (text.Length == 0)
|
||||
return required ? new(false, "Bio-Kontrollstellen-Code ist nicht optional") : new(true, null);
|
||||
|
||||
if (text.StartsWith("AT")) {
|
||||
if (text.StartsWith("AT") || text.StartsWith("DE")) {
|
||||
if (text.Length != 10) {
|
||||
return new(false, "Bio-Kontrollstellen-Code ist ungültig");
|
||||
}
|
||||
|
||||
@@ -96,6 +96,12 @@ namespace Elwig.Models.Entities {
|
||||
[Column("ustid_nr")]
|
||||
public string? UstIdNr { get; set; }
|
||||
|
||||
[Column("ooc_id")]
|
||||
public string? OrganicOperatorId { get; set; }
|
||||
|
||||
[Column("org_auth_code")]
|
||||
public string? OrganicAuthorityCode { get; set; }
|
||||
|
||||
[Column("juridical_pers")]
|
||||
public bool IsJuridicalPerson { get; set; }
|
||||
|
||||
|
||||
@@ -11,6 +11,9 @@ namespace Elwig.Models.Entities {
|
||||
[Column("name")]
|
||||
public required string Name { get; set; }
|
||||
|
||||
[Column("organic")]
|
||||
public bool IsOrganic { get; set; }
|
||||
|
||||
[Column("description")]
|
||||
public string? Description { get; set; }
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
-- schema version 41 to 42
|
||||
|
||||
ALTER TABLE member ADD COLUMN ooc_id TEXT CHECK (ooc_id REGEXP '^[0-9]{3}-[0-9]{7}$') DEFAULT NULL;
|
||||
ALTER TABLE member ADD COLUMN org_auth_code TEXT CHECK (org_auth_code REGEXP '^[A-Z]{2}-[A-ZÖØ]{3}-[0-9]{2,3}(-[A-Z]{2})?$') DEFAULT NULL;
|
||||
|
||||
ALTER TABLE wine_cultivation ADD COLUMN organic INTEGER NOT NULL CHECK (organic IN (TRUE, FALSE)) DEFAULT FALSE;
|
||||
|
||||
UPDATE member SET org_auth_code = UPPER(SUBSTR(a.name, -11, 10)) FROM member m JOIN member_billing_address a ON a.mgnr = m.mgnr WHERE a.name LIKE '%AT-BIO-___)';
|
||||
UPDATE member SET org_auth_code = UPPER(SUBSTR(a.name, -10, 10)) FROM member m JOIN member_billing_address a ON a.mgnr = m.mgnr WHERE a.name LIKE '%AT-BIO-___';
|
||||
UPDATE member SET org_auth_code = UPPER(suffix) WHERE suffix LIKE 'AT-BIO-___';
|
||||
|
||||
UPDATE wine_cultivation SET organic = TRUE WHERE name LIKE '%bio%' OR name LIKE '%org%' OR description LIKE '%AT-BIO-%';
|
||||
UPDATE wine_cultivation SET description = NULL WHERE description LIKE '%AT-BIO-%';
|
||||
UPDATE wine_cultivation SET description = 'Biologische Produktion' WHERE organic;
|
||||
|
||||
UPDATE client_parameter SET param = 'CLIENT_ORGANIC_AUTHORITYCODE' WHERE param = 'CLIENT_ORGANIC_AUTHORITY';
|
||||
|
||||
UPDATE member_telephone_number SET comment = NULL WHERE comment = '';
|
||||
UPDATE member_email_address SET comment = NULL WHERE comment = '';
|
||||
@@ -106,6 +106,8 @@ namespace Elwig.Services {
|
||||
|
||||
vm.UstIdNr = m.UstIdNr;
|
||||
vm.LfbisNr = m.LfbisNr;
|
||||
vm.OrganicOperatorId = m.OrganicOperatorId;
|
||||
vm.OrganicAuthorityCode = m.OrganicAuthorityCode;
|
||||
vm.IsBuchführend = m.IsBuchführend;
|
||||
vm.IsOrganic = m.IsOrganic;
|
||||
|
||||
@@ -555,6 +557,8 @@ namespace Elwig.Services {
|
||||
|
||||
UstIdNr = string.IsNullOrWhiteSpace(vm.UstIdNr) ? null : vm.UstIdNr,
|
||||
LfbisNr = string.IsNullOrWhiteSpace(vm.LfbisNr) ? null : vm.LfbisNr,
|
||||
OrganicOperatorId = string.IsNullOrWhiteSpace(vm.OrganicOperatorId) ? null : vm.OrganicOperatorId,
|
||||
OrganicAuthorityCode = string.IsNullOrWhiteSpace(vm.OrganicAuthorityCode) ? null : vm.OrganicAuthorityCode,
|
||||
IsBuchführend = vm.IsBuchführend,
|
||||
IsOrganic = vm.IsOrganic,
|
||||
|
||||
|
||||
@@ -118,6 +118,10 @@ namespace Elwig.ViewModels {
|
||||
[ObservableProperty]
|
||||
private string? _lfbisNr;
|
||||
[ObservableProperty]
|
||||
private string? _organicOperatorId;
|
||||
[ObservableProperty]
|
||||
private string? _organicAuthorityCode;
|
||||
[ObservableProperty]
|
||||
private bool _isBuchführend;
|
||||
[ObservableProperty]
|
||||
private bool _isOrganic;
|
||||
|
||||
@@ -576,6 +576,14 @@ namespace Elwig.Windows {
|
||||
InputLostFocus((TextBox)sender, Validator.CheckLfbisNr);
|
||||
}
|
||||
|
||||
protected void OrganicOperatorIdInput_TextChanged(object sender, TextChangedEventArgs? evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckOrganicOperatorId);
|
||||
}
|
||||
|
||||
protected void OrganicOperatorIdInput_LostFocus(object sender, RoutedEventArgs? evt) {
|
||||
InputLostFocus((TextBox)sender, Validator.CheckOrganicOperatorId);
|
||||
}
|
||||
|
||||
protected void OrganicAuthorityCodeInput_TextChanged(object sender, TextChangedEventArgs? evt) {
|
||||
InputTextChanged((TextBox)sender, Validator.CheckOrganicAuthorityCode);
|
||||
}
|
||||
|
||||
@@ -121,12 +121,18 @@
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Grid.Column="3" Margin="0,130,10,10" Width="64"
|
||||
TextChanged="LfbisNrInput_TextChanged" LostFocus="LfbisNrInput_LostFocus"/>
|
||||
|
||||
<Label Content="Bio-Kontrollstelle:"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Right" Grid.Column="3" Margin="10,130,110,10"/>
|
||||
<TextBox x:Name="ClientOrganicAuthorityInput"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Right" Grid.Column="3" Margin="10,130,10,10" Width="90"
|
||||
<Label Content="Bio-KSt.:" ToolTip="Bio-Konstrollstelle"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Right" Grid.Column="3" Margin="10,100,110,10"/>
|
||||
<TextBox x:Name="ClientOrganicAuthorityCodeInput"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Right" Grid.Column="3" Margin="10,100,10,10" Width="82"
|
||||
TextChanged="OrganicAuthorityCodeInput_TextChanged" LostFocus="OrganicAuthorityCodeInput_LostFocus"/>
|
||||
|
||||
<Label Content="OOC-ID:" ToolTip="Bio-EU-Operator-ID / Organic Operator Certificate ID"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Right" Grid.Column="3" Margin="10,130,110,10"/>
|
||||
<TextBox x:Name="ClientOrganicOperatorIdInput"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Right" Grid.Column="3" Margin="10,130,10,10" Width="91"
|
||||
TextChanged="OrganicOperatorIdInput_TextChanged" LostFocus="OrganicOperatorIdInput_LostFocus"/>
|
||||
|
||||
<Label Content="Telefon-Nr.:"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Left" Grid.Column="2" Margin="10,160,0,10"/>
|
||||
<TextBox x:Name="ClientPhoneNrInput" Margin="0,160,10,10" Grid.Column="3"
|
||||
@@ -320,6 +326,10 @@
|
||||
<Label Content="Beschreibung:" Margin="10,70,0,10"/>
|
||||
<TextBox x:Name="WineCultivationDescriptionInput" Grid.Column="1" Margin="0,70,10,10"
|
||||
TextChanged="WineCultivation_Changed"/>
|
||||
|
||||
<CheckBox x:Name="WineCultivationOrganicInput" Content="Bio" Grid.Column="1" Margin="0,105,10,10"
|
||||
Checked="WineCultivation_Changed" Unchecked="WineCultivation_Changed"
|
||||
HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
||||
@@ -72,10 +72,12 @@ namespace Elwig.Windows {
|
||||
WineCultivationIdInput.Text = "";
|
||||
WineCultivationNameInput.Text = "";
|
||||
WineCultivationDescriptionInput.Text = "";
|
||||
WineCultivationOrganicInput.IsChecked = false;
|
||||
} else {
|
||||
WineCultivationIdInput.Text = cult.CultId;
|
||||
WineCultivationNameInput.Text = cult.Name;
|
||||
WineCultivationDescriptionInput.Text = cult.Description;
|
||||
WineCultivationOrganicInput.IsChecked = cult.IsOrganic;
|
||||
}
|
||||
_cultUpdate = false;
|
||||
}
|
||||
@@ -105,7 +107,8 @@ namespace Elwig.Windows {
|
||||
_cultChanged = _cultChanged ||
|
||||
WineCultivationIdInput.Text != cult.CultId ||
|
||||
WineCultivationNameInput.Text != cult.Name ||
|
||||
WineCultivationDescriptionInput.Text != (cult.Description ?? "");
|
||||
WineCultivationDescriptionInput.Text != (cult.Description ?? "") ||
|
||||
WineCultivationOrganicInput.IsChecked != cult.IsOrganic;
|
||||
|
||||
var old = _cultIds.GetValueOrDefault(cult);
|
||||
var id = WineCultivationIdInput.Text ?? "";
|
||||
@@ -113,7 +116,8 @@ namespace Elwig.Windows {
|
||||
cult.CultId = id;
|
||||
cult.Name = WineCultivationNameInput.Text ?? "";
|
||||
cult.Description = WineCultivationDescriptionInput.Text ?? "";
|
||||
if (cult.Description.Length == 0) cult.Description = null;
|
||||
cult.IsOrganic = WineCultivationOrganicInput.IsChecked ?? false;
|
||||
if (string.IsNullOrWhiteSpace(cult.Description)) cult.Description = null;
|
||||
|
||||
CollectionViewSource.GetDefaultView(_cultList).Refresh();
|
||||
UpdateButtons();
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Elwig.Windows {
|
||||
BranchAddressInput, BranchPhoneNrInput, BranchFaxNrInput, BranchMobileNrInput,
|
||||
WineAttributeIdInput, WineAttributeNameInput, WineAttributeActiveInput,
|
||||
WineAttributeMaxKgPerHaInput, WineAttributeStrictInput, WineAttributeFillLowerInput,
|
||||
WineCultivationIdInput, WineCultivationNameInput, WineCultivationDescriptionInput,
|
||||
WineCultivationIdInput, WineCultivationNameInput, WineCultivationDescriptionInput, WineCultivationOrganicInput,
|
||||
AreaCommitmentTypeIdInput, AreaCommitmentTypeWineVariantInput, AreaCommitmentTypeWineAttributeInput,
|
||||
AreaCommitmentTypeMinKgPerHaInput, AreaCommitmentTypePenaltyPerKgInput,
|
||||
AreaCommitmentTypePenaltyInput, AreaCommitmentTypePenaltyNoneInput,
|
||||
@@ -67,6 +67,7 @@ namespace Elwig.Windows {
|
||||
WineCultivationIdInput.IsReadOnly = true;
|
||||
WineCultivationNameInput.IsReadOnly = true;
|
||||
WineCultivationDescriptionInput.IsReadOnly = true;
|
||||
WineCultivationOrganicInput.IsEnabled = false;
|
||||
|
||||
AreaCommitmentTypeWineVariantInput.IsEnabled = false;
|
||||
AreaCommitmentTypeWineAttributeInput.IsEnabled = false;
|
||||
@@ -115,6 +116,7 @@ namespace Elwig.Windows {
|
||||
WineCultivationIdInput.IsReadOnly = false;
|
||||
WineCultivationNameInput.IsReadOnly = false;
|
||||
WineCultivationDescriptionInput.IsReadOnly = false;
|
||||
WineCultivationOrganicInput.IsEnabled = true;
|
||||
|
||||
AreaCommitmentTypeWineVariantInput.IsEnabled = true;
|
||||
AreaCommitmentTypeWineAttributeInput.IsEnabled = true;
|
||||
@@ -329,7 +331,8 @@ namespace Elwig.Windows {
|
||||
ClientBicInput.Text = p.Bic;
|
||||
ClientUstIdNrInput.Text = p.UstIdNr;
|
||||
ClientLfbisNrInput.Text = p.LfbisNr;
|
||||
ClientOrganicAuthorityInput.Text = p.OrganicAuthority;
|
||||
ClientOrganicOperatorIdInput.Text = p.OrganicOperatorId;
|
||||
ClientOrganicAuthorityCodeInput.Text = p.OrganicAuthorityCode;
|
||||
ClientPhoneNrInput.Text = p.PhoneNr;
|
||||
ClientFaxNrInput.Text = p.FaxNr;
|
||||
ClientEmailAddressInput.Text = p.EmailAddress;
|
||||
@@ -369,7 +372,8 @@ namespace Elwig.Windows {
|
||||
p.Bic = string.IsNullOrWhiteSpace(ClientBicInput.Text) ? null : ClientBicInput.Text;
|
||||
p.UstIdNr = string.IsNullOrWhiteSpace(ClientUstIdNrInput.Text) ? null : ClientUstIdNrInput.Text;
|
||||
p.LfbisNr = string.IsNullOrWhiteSpace(ClientLfbisNrInput.Text) ? null : ClientLfbisNrInput.Text;
|
||||
p.OrganicAuthority = string.IsNullOrWhiteSpace(ClientOrganicAuthorityInput.Text) ? null : ClientOrganicAuthorityInput.Text;
|
||||
p.OrganicOperatorId = string.IsNullOrWhiteSpace(ClientOrganicOperatorIdInput.Text) ? null : ClientOrganicOperatorIdInput.Text;
|
||||
p.OrganicAuthorityCode = string.IsNullOrWhiteSpace(ClientOrganicAuthorityCodeInput.Text) ? null : ClientOrganicAuthorityCodeInput.Text;
|
||||
p.PhoneNr = string.IsNullOrWhiteSpace(ClientPhoneNrInput.Text) ? null : ClientPhoneNrInput.Text;
|
||||
p.FaxNr = string.IsNullOrWhiteSpace(ClientFaxNrInput.Text) ? null : ClientFaxNrInput.Text;
|
||||
p.EmailAddress = string.IsNullOrWhiteSpace(ClientEmailAddressInput.Text) ? null : ClientEmailAddressInput.Text;
|
||||
|
||||
@@ -547,37 +547,47 @@
|
||||
<GroupBox Header="Betrieb" Grid.Column="1" Grid.Row="0" Grid.RowSpan="1" Margin="5,5,5,5">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="90"/>
|
||||
<ColumnDefinition Width="150"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="85"/>
|
||||
<ColumnDefinition Width="69"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="55"/>
|
||||
<ColumnDefinition Width="101"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Content="UID:" Margin="10,10,0,0" Grid.Column="0" ToolTip="USt-IdNr. / Umsatzsteuer-Identifikationsnummer"/>
|
||||
<TextBox x:Name="UstIdNrInput" Text="{Binding UstIdNr, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0,10,10,0" Grid.Column="1" Width="96" HorizontalAlignment="Left"
|
||||
TextChanged="UstIdNrInput_TextChanged" LostFocus="UstIdNrInput_LostFocus"/>
|
||||
|
||||
<Label Content="Betriebs-Nr.:" Margin="10,40,0,0" Grid.Column="0"/>
|
||||
<Label Content="Betriebs-Nr.:" Margin="10,10,0,0" Grid.Column="0"/>
|
||||
<TextBox x:Name="LfbisNrInput" Text="{Binding LfbisNr, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0,40,10,0" Grid.Column="1" Width="64" HorizontalAlignment="Left" TextAlignment="Right"
|
||||
Margin="0,10,5,0" Grid.Column="1" Width="64" HorizontalAlignment="Left" TextAlignment="Right"
|
||||
TextChanged="LfbisNrInput_TextChanged" LostFocus="LfbisNrInput_LostFocus"/>
|
||||
|
||||
<CheckBox x:Name="BuchführendInput" Content="Buchführend" IsChecked="{Binding IsBuchführend, Mode=TwoWay}" IsEnabled="False"
|
||||
Checked="CheckBox_Changed" Unchecked="CheckBox_Changed"
|
||||
Grid.Column="2" HorizontalAlignment="Left" Margin="10,15,0,0" VerticalAlignment="Top"/>
|
||||
<Label Content="UID:" Margin="10,40,0,0" Grid.Column="0" ToolTip="USt-IdNr. / Umsatzsteuer-Identifikationsnummer"/>
|
||||
<TextBox x:Name="UstIdNrInput" Text="{Binding UstIdNr, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0,40,5,0" Grid.Column="0" Grid.ColumnSpan="2" Width="96" HorizontalAlignment="Right"
|
||||
TextChanged="UstIdNrInput_TextChanged" LostFocus="UstIdNrInput_LostFocus"/>
|
||||
|
||||
<CheckBox x:Name="OrganicInput" Content="Bio" IsChecked="{Binding IsOrganic, Mode=TwoWay}" IsEnabled="False"
|
||||
Checked="CheckBox_Changed" Unchecked="CheckBox_Changed"
|
||||
Grid.Column="2" HorizontalAlignment="Left" Margin="10,45,0,0" VerticalAlignment="Top"/>
|
||||
<Button x:Name="OrganicButton" Content="easy-cert.com" IsEnabled="{Binding IsMemberSelected}"
|
||||
Height="25" FontSize="12"
|
||||
Click="OrganicButton_Click"
|
||||
Grid.Column="2" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="60,40,0,0"/>
|
||||
Grid.Column="2" HorizontalAlignment="Left" Margin="5,15,0,0" VerticalAlignment="Top"/>
|
||||
|
||||
<CheckBox x:Name="BuchführendInput" Content="Buchführend" IsChecked="{Binding IsBuchführend, Mode=TwoWay}" IsEnabled="False"
|
||||
Checked="CheckBox_Changed" Unchecked="CheckBox_Changed"
|
||||
Grid.Column="2" HorizontalAlignment="Left" Margin="5,45,0,0" VerticalAlignment="Top"/>
|
||||
|
||||
<Label Content="Kontrollstelle:" Margin="0,10,5,0" Grid.Column="2" Grid.ColumnSpan="2" HorizontalAlignment="Right" ToolTip="Bio-Kontrollstelle"/>
|
||||
<TextBox x:Name="OrganicAuthorityCodeInput" Text="{Binding OrganicAuthorityCode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0,10,19,0" Grid.Column="4" Width="82" HorizontalAlignment="Left"
|
||||
TextChanged="OrganicAuthorityCodeInput_TextChanged" LostFocus="OrganicAuthorityCodeInput_LostFocus"/>
|
||||
|
||||
<Label Content="OOC-ID:" Margin="0,40,0,0" Grid.Column="3" HorizontalAlignment="Left" ToolTip="Bio-EU-Operator-ID / Organic Operator Certificate ID"/>
|
||||
<TextBox x:Name="OrganicOperatorIdInput" Text="{Binding OrganicOperatorId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0,40,10,0" Grid.Column="4" Width="91" HorizontalAlignment="Left"
|
||||
TextChanged="OrganicOperatorIdInput_TextChanged" LostFocus="OrganicOperatorIdInput_LostFocus"/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Grid.Column="1" Grid.Row="1" Grid.RowSpan="2" Margin="5,5,5,5">
|
||||
<GroupBox.Header>
|
||||
<TextBlock>Rechnungsadresse (optional) <Run FontSize="10">für Lieferschein, Anlfrg.-Bstng., Tr.-Gutschr.</Run></TextBlock>
|
||||
<TextBlock>Rechnungsadresse (optional)
|
||||
<Run FontSize="10">für Lieferschein, Anlfrg.-Bstng., Tr.-Gutschr.</Run>
|
||||
</TextBlock>
|
||||
</GroupBox.Header>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
|
||||
@@ -7,7 +7,6 @@ using Elwig.ViewModels;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
@@ -966,17 +965,6 @@ namespace Elwig.Windows {
|
||||
}
|
||||
}
|
||||
|
||||
private void OrganicButton_Click(object sender, RoutedEventArgs evt) {
|
||||
if (ViewModel.SelectedMember is not Member m) return;
|
||||
var url = "https://www.easy-cert.com/htm/suchergebnis.htm?" +
|
||||
//$"CustomerNumber={m.LfbisNr}&" +
|
||||
$"Name={(m.BillingAddress?.FullName ?? m.FullName).Replace(' ', '+')}&" +
|
||||
$"PostalCode={(m.BillingAddress?.PostalDest ?? m.PostalDest).AtPlz?.Plz}";
|
||||
Process.Start(new ProcessStartInfo(url) {
|
||||
UseShellExecute = true,
|
||||
});
|
||||
}
|
||||
|
||||
private void MemberReferenceButton_Click(object sender, RoutedEventArgs evt) {
|
||||
if (ViewModel.SelectedMember is not Member m || m.PredecessorMgNr == null) return;
|
||||
FocusMember((int)m.PredecessorMgNr);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
-- inserts for HelperTests.BillingTest
|
||||
|
||||
INSERT INTO wine_cultivation (cultid, name, description) VALUES
|
||||
('KIP', 'KIP', 'Kontrollierte Integrierte Produktion'),
|
||||
('B', 'Bio', 'AT-BIO-302');
|
||||
INSERT INTO wine_cultivation (cultid, name, description, organic) VALUES
|
||||
('KIP', 'KIP', 'Kontrollierte Integrierte Produktion', FALSE),
|
||||
('B', 'Bio', 'Biologische Produktion', TRUE);
|
||||
|
||||
INSERT INTO wine_attribute (attrid, name, active, max_kg_per_ha, strict, fill_lower) VALUES
|
||||
('K', 'Kabinett', TRUE, NULL, FALSE, 0),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-- inserts for DocumentTests
|
||||
|
||||
INSERT INTO wine_cultivation (cultid, name, description) VALUES
|
||||
('B', 'Bio', 'AT-BIO-302');
|
||||
INSERT INTO wine_cultivation (cultid, name, description, organic) VALUES
|
||||
('B', 'Bio', 'Biologische Produktion', TRUE);
|
||||
|
||||
INSERT INTO wine_attribute (attrid, name, active, max_kg_per_ha, strict, fill_lower) VALUES
|
||||
('K', 'Kabinett', TRUE, NULL, FALSE, 0);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
-- inserts for E2ETests
|
||||
|
||||
INSERT INTO wine_cultivation (cultid, name, description) VALUES
|
||||
('KIP', 'KIP', 'Kontrollierte Integrierte Produktion'),
|
||||
('B', 'Bio', 'AT-BIO-302');
|
||||
INSERT INTO wine_cultivation (cultid, name, description, organic) VALUES
|
||||
('KIP', 'KIP', 'Kontrollierte Integrierte Produktion', FALSE),
|
||||
('B', 'Bio', 'Biologische Produktion', TRUE);
|
||||
|
||||
INSERT INTO wine_attribute (attrid, name, active, max_kg_per_ha, strict, fill_lower) VALUES
|
||||
('K', 'Kabinett', TRUE, NULL, FALSE, 0),
|
||||
|
||||
@@ -66,11 +66,11 @@ INSERT INTO wb_kg (kgnr, glnr) VALUES
|
||||
(15216, 2),
|
||||
(15224, 2);
|
||||
|
||||
INSERT INTO member (mgnr, given_name, name, zwstid, volllieferant, buchführend, country, postal_dest, address, default_kgnr, iban, lfbis_nr, ustid_nr) VALUES
|
||||
(101, 'Max', 'Mustermann', 'X', FALSE, FALSE, 40, 222303524, 'Winzerstraße 1', 06109, 'AT811234567890123457', '0123463', NULL ),
|
||||
(102, 'Wernhardt', 'Weinbauer', 'X', FALSE, FALSE, 40, 222303524, 'Winzerstraße 2', 06109, 'AT541234567890123458', '0123471', 'ATU12345684'),
|
||||
(103, 'Matthäus', 'Musterbauer', 'X', FALSE, FALSE, 40, 212005138, 'Brünner Straße 10', 15224, 'AT271234567890123459', '0123480', NULL ),
|
||||
(104, 'Waltraud', 'Winzer', 'X', FALSE, TRUE , 40, 212005138, 'Wiener Straße 15', 15224, 'AT971234567890123460', '0123498', 'ATU12345693');
|
||||
INSERT INTO member (mgnr, given_name, name, zwstid, volllieferant, buchführend, country, postal_dest, address, default_kgnr, iban, lfbis_nr, ustid_nr, org_auth_code) VALUES
|
||||
(101, 'Max', 'Mustermann', 'X', FALSE, FALSE, 40, 222303524, 'Winzerstraße 1', 06109, 'AT811234567890123457', '0123463', NULL , NULL ),
|
||||
(102, 'Wernhardt', 'Weinbauer', 'X', FALSE, FALSE, 40, 222303524, 'Winzerstraße 2', 06109, 'AT541234567890123458', '0123471', 'ATU12345684', NULL ),
|
||||
(103, 'Matthäus', 'Musterbauer', 'X', FALSE, FALSE, 40, 212005138, 'Brünner Straße 10', 15224, 'AT271234567890123459', '0123480', NULL , 'AT-BIO-302'),
|
||||
(104, 'Waltraud', 'Winzer', 'X', FALSE, TRUE , 40, 212005138, 'Wiener Straße 15', 15224, 'AT971234567890123460', '0123498', 'ATU12345693', NULL );
|
||||
|
||||
INSERT INTO member_billing_address (mgnr, name, country, postal_dest, address) VALUES
|
||||
(102, 'W&B Weinbauer GesbR', 40, 222303524, 'Winzerstraße 2'),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
-- inserts for ServiceTests
|
||||
|
||||
|
||||
INSERT INTO wine_cultivation (cultid, name, description) VALUES
|
||||
('B', 'Bio', 'AT-BIO-302');
|
||||
INSERT INTO wine_cultivation (cultid, name, description, organic) VALUES
|
||||
('B', 'Bio', 'Biologische Produktion', TRUE);
|
||||
|
||||
INSERT INTO wine_attribute (attrid, name, active, max_kg_per_ha, strict, fill_lower) VALUES
|
||||
('K', 'Kabinett', TRUE, NULL, FALSE, 0);
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Tests.UnitTests.DocumentTests {
|
||||
public async Task Test_01_OneDeliveryPart() {
|
||||
using var doc = await DeliveryNote.Initialize(2020, 1);
|
||||
var text = await Utils.GeneratePdfText(doc);
|
||||
Assert.Multiple(() => {
|
||||
using (Assert.EnterMultipleScope()) {
|
||||
Assert.That(text, Contains.Substring("""
|
||||
MUSTERMANN Max
|
||||
Winzerstraße 1
|
||||
@@ -26,14 +26,14 @@ namespace Tests.UnitTests.DocumentTests {
|
||||
Waage/Terminal: ?/1, ID: 321 – 09:02, 01.10.2020
|
||||
Brutto: 3 219 kg – Tara: 0 kg – Netto: 3 219 kg – gerebelt gewogen
|
||||
"""));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task Test_02_TwoDeliveryParts() {
|
||||
using var doc = await DeliveryNote.Initialize(2020, 4);
|
||||
var text = await Utils.GeneratePdfText(doc);
|
||||
Assert.Multiple(() => {
|
||||
using (Assert.EnterMultipleScope()) {
|
||||
Assert.That(text, Contains.Substring("""
|
||||
W&B Weinbauer GesbR
|
||||
WEINBAUER Wernhardt
|
||||
@@ -58,14 +58,14 @@ namespace Tests.UnitTests.DocumentTests {
|
||||
Waage/Terminal: ?/?, ID: ? (gerebelt gewogen)
|
||||
"""));
|
||||
Assert.That(text, Contains.Substring("Gesamt: 81 16,5 4 483"));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task Test_03_DeliveryPartsWithAttribute() {
|
||||
using var doc = await DeliveryNote.Initialize(2020, 3);
|
||||
var text = await Utils.GeneratePdfText(doc);
|
||||
Assert.Multiple(() => {
|
||||
using (Assert.EnterMultipleScope()) {
|
||||
Assert.That(text, Contains.Substring("""
|
||||
MUSTERMANN Max
|
||||
Winzerstraße 1
|
||||
@@ -95,14 +95,14 @@ namespace Tests.UnitTests.DocumentTests {
|
||||
Waage/Terminal: ?/?, ID: ? (gerebelt gewogen)
|
||||
"""));
|
||||
Assert.That(text, Contains.Substring("Gesamt: 81 16,5 6 970"));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task Test_04_DeliveryPartsWithCultivation() {
|
||||
using var doc = await DeliveryNote.Initialize(2020, 7);
|
||||
var text = await Utils.GeneratePdfText(doc);
|
||||
Assert.Multiple(() => {
|
||||
using (Assert.EnterMultipleScope()) {
|
||||
Assert.That(text, Contains.Substring("""
|
||||
MUSTERBAUER Matthäus
|
||||
Brünner Straße 10
|
||||
@@ -115,20 +115,20 @@ namespace Tests.UnitTests.DocumentTests {
|
||||
Assert.That(text, Contains.Substring("Das Mitglied erklärt, dass die gelieferte Ware dem österreichischen Weingesetz entspricht"));
|
||||
Assert.That(text, Contains.Substring("""
|
||||
1 Grüner Veltliner Wein 80 16,3 3 198
|
||||
Bewirtschaftung: Bio (AT-BIO-302)
|
||||
Bewirtschaftung: Bio (Biologische Produktion) – Kontrollstelle: AT-BIO-302
|
||||
Herkunft: Österreich
|
||||
/ Wolkersdorfer Hochleithen / Wolkersdorf im Weinviertel / KG Wolkersdorf
|
||||
Waage/Terminal: ?/?, ID: ? (gerebelt gewogen)
|
||||
"""));
|
||||
Assert.That(text, Contains.Substring("""
|
||||
2 Grüner Veltliner Qualitätswein 75 15,4 2 134
|
||||
Bewirtschaftung: Bio (AT-BIO-302)
|
||||
Bewirtschaftung: Bio (Biologische Produktion) – Kontrollstelle: AT-BIO-302
|
||||
Herkunft: Österreich / Weinland / Niederösterreich
|
||||
/ Wolkersdorfer Hochleithen / Wolkersdorf im Weinviertel / KG Wolkersdorf
|
||||
Waage/Terminal: ?/?, ID: ? (gerebelt gewogen)
|
||||
"""));
|
||||
Assert.That(text, Contains.Substring("Gesamt: 78 15,9 5 332"));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -1 +1 @@
|
||||
curl --fail -s -L "https://elwig.at/files/create.sql?v=41" -u "elwig:ganzGeheim123!" -o "Resources\Sql\Create.sql"
|
||||
curl --fail -s -L "https://elwig.at/files/create.sql?v=42" -u "elwig:ganzGeheim123!" -o "Resources\Sql\Create.sql"
|
||||
Reference in new issue
Block a user