1 # This file has been auto-generated only because it didn't exist.
2 # Feel free to modify it at will; it will not be overwritten automatically.
4 package SL::DB::Contact;
8 use SL::DB::MetaSetup::Contact;
9 use SL::DB::Helper::CustomVariables (
14 # Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
15 __PACKAGE__->meta->make_manager_class;
17 __PACKAGE__->meta->initialize;
22 return unless $self->cp_id;
24 require SL::DB::Order;
25 require SL::DB::Invoice;
26 require SL::DB::PurchaseInvoice;
27 require SL::DB::DeliveryOrder;
29 return SL::DB::Manager::Order->get_all_count(query => [ cp_id => $self->cp_id ])
30 + SL::DB::Manager::Invoice->get_all_count(query => [ cp_id => $self->cp_id ])
31 + SL::DB::Manager::PurchaseInvoice->get_all_count(query => [ cp_id => $self->cp_id ])
32 + SL::DB::Manager::DeliveryOrder->get_all_count(query => [ cp_id => $self->cp_id ]);
36 $_[0]->cp_cv_id(undef);
42 die 'not an accessor' if @_ > 1;
43 join ', ', grep $_, $self->cp_name, $self->cp_givenname;
48 die 'not an accessor' if @_ > 1;
50 . join '', map { " ($_)" } grep $_, $self->cp_abteilung;