diff --git a/Elwig/Helpers/Validator.cs b/Elwig/Helpers/Validator.cs index 1ea8042..599e7e9 100644 --- a/Elwig/Helpers/Validator.cs +++ b/Elwig/Helpers/Validator.cs @@ -246,9 +246,16 @@ namespace Elwig.Helpers { return new(false, "Betriebsnummer zu kurz"); } - // TODO + // https://statistik.at/fileadmin/shared/QM/Standarddokumentationen/RW/std_r_land-forstw_register.pdf#page=41 + int s = 0; + for (int i = 0; i < 6; i++) + s += (input.Text[i] - '0') * (7 - i); + s = (11 - (s % 11)) % 10; - return new(true, "Not implemented yet"); + if (s != (input.Text[6] - '0')) + return new(false, "Prüfsumme der Betriebsnummer ist falsch"); + + return new(true, null); } public static ValidationResult CheckUstId(TextBox input, bool required) {