This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -638,6 +638,7 @@ namespace Elwig.Helpers.Export {
|
||||
["zwstid"] = m.ZwstId,
|
||||
["lfbis_nr"] = m.LfbisNr,
|
||||
["ustid_nr"] = m.UstIdNr,
|
||||
["org_auth_code"] = m.OrganicAuthorityCode,
|
||||
["juridical_pers"] = m.IsJuridicalPerson,
|
||||
["volllieferant"] = m.IsVollLieferant,
|
||||
["buchführend"] = m.IsBuchführend,
|
||||
@@ -710,6 +711,7 @@ namespace Elwig.Helpers.Export {
|
||||
ZwstId = json["zwstid"]?.AsValue().GetValue<string>(),
|
||||
LfbisNr = json["lfbis_nr"]?.AsValue().GetValue<string>(),
|
||||
UstIdNr = json["ustid_nr"]?.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,
|
||||
|
||||
@@ -631,15 +631,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 +650,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 +670,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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user