]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/DB/Printer.pm
SL::DB::Buchungsgruppe: Relationsnamen inventory_account gefixt
[kivitendo-erp.git] / SL / DB / Printer.pm
index fd58eb55c8ce1dd84b7ae3fa1bca7927cb45c1d3..046027bc5a9e0ba228b0463e0c27168acd9ae3fb 100644 (file)
@@ -3,11 +3,24 @@ package SL::DB::Printer;
 use strict;
 
 use SL::DB::MetaSetup::Printer;
+use SL::DB::Manager::Printer;
+use SL::DB::Helper::Util;
 
-__PACKAGE__->meta->make_manager_class;
+__PACKAGE__->meta->initialize;
 
 sub description {
   goto &printer_description;
 }
 
+sub validate {
+  my ($self) = @_;
+
+  my @errors;
+  push @errors, $::locale->text('The description is missing.')    if !$self->printer_description;
+  push @errors, $::locale->text('The command is missing.')        if !$self->printer_command;
+  push @errors, $::locale->text('The description is not unique.') if !SL::DB::Helper::Util::is_unique($self, 'printer_description');
+
+  return @errors;
+}
+
 1;