X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FClientConfig.pm;h=9bf0eda3e3cbe3dad658a77043832b0f2a75c691;hb=661febc70d58eb13923455512e8d76f1ef29ae60;hp=3d5b7704a06c4800dfec301c664718c2dc1593a3;hpb=5eb836e4c3a624438acea1984639bfafb0d03d94;p=kivitendo-erp.git 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) {