From: Moritz Bunkus Date: Wed, 11 Mar 2020 11:02:19 +0000 (+0100) Subject: Mandantenkonfiguration: UStID-Nummern beim Speichern validieren X-Git-Tag: release-3.5.6.1~245^2~5 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=f7bb8c5aa998707f62849e00e2e9edd0f88c2c43;p=kivitendo-erp.git Mandantenkonfiguration: UStID-Nummern beim Speichern validieren --- diff --git a/SL/Controller/ClientConfig.pm b/SL/Controller/ClientConfig.pm index 3d5b7704a..9bf0eda3e 100644 --- a/SL/Controller/ClientConfig.pm +++ b/SL/Controller/ClientConfig.pm @@ -20,6 +20,7 @@ use SL::Template; use SL::Controller::TopQuickSearch; use SL::DB::Helper::AccountingPeriod qw(get_balance_startdate_method_options); use SL::Helper::ShippedQty; +use SL::VATIDNr; __PACKAGE__->run_before('check_auth'); @@ -99,6 +100,11 @@ sub action_save { } } + my $cleaned_ustid = SL::VATIDNr->clean($defaults->{co_ustid}); + if ($cleaned_ustid && !SL::VATIDNr->validate($cleaned_ustid)) { + push @errors, t8("The VAT ID number '#1' is invalid.", $defaults->{co_ustid}); + } + # Show form again if there were any errors. Nothing's been changed # yet in the database. if (@errors) {