+ my $res = &{"CT::save_$form->{db}"}("", \%myconfig, \%$form);
+
+ if (3 == $res) {
+ if ($form->{"db"} eq "customer") {
+ $form->error($locale->text('This customer number is already in use.'));
+ } else {
+ $form->error($locale->text('This vendor number is already in use.'));
+ }
+ }
+ # saving the history
+ if(!exists $form->{addition}) {
+ $form->{addition} = "SAVED";
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history