--- /dev/null
+package SL::DB::Manager::Vendor;
+
+use strict;
+
+use SL::DB::Helper::Manager;
+use base qw(SL::DB::Helper::Manager);
+
+use SL::DB::Helper::Filtered;
+use SL::DB::Helper::Sorted;
+
+sub object_class { 'SL::DB::Vendor' }
+
+__PACKAGE__->make_manager_methods;
+
+__PACKAGE__->add_filter_specs(
+ all => sub {
+ my ($key, $value, $prefix) = @_;
+ return or => [ map { $prefix . $_ => $value } qw(vendornumber name) ]
+ }
+);
+
+sub _sort_spec {
+ return (
+ default => [ 'name', 1 ],
+ columns => {
+ SIMPLE => 'ALL',
+ map { ( $_ => "lower(vendor.$_)" ) } qw(account_number bank bank_code bcc bic cc city contact country department_1 department_2 depositor email fax greeting homepage iban language
+ name notes phone street taxnumber user_password username ustid v_customer_id vendornumber zipcode)
+ });
+}
+1;
use strict;
use SL::DB::MetaSetup::Vendor;
+use SL::DB::Manager::Vendor;
use SL::DB::Helper::TransNumberGenerator;
use SL::DB::Helper::CustomVariables (
module => 'CT',
},
);
-__PACKAGE__->meta->make_manager_class;
__PACKAGE__->meta->initialize;
__PACKAGE__->before_save('_before_save_set_vendornumber');
return 1;
}
+sub displayable_name {
+ my $self = shift;
+
+ return join ' ', grep $_, $self->vendornumber, $self->name;
+}
+
sub is_customer { 0 };
sub is_vendor { 1 };