1 package SL::DB::Contact;
5 use SL::DB::MetaSetup::Contact;
6 use SL::DB::Manager::Contact;
7 use SL::DB::Helper::CustomVariables (
12 __PACKAGE__->meta->initialize;
17 return unless $self->cp_id;
19 require SL::DB::Order;
20 require SL::DB::Invoice;
21 require SL::DB::PurchaseInvoice;
22 require SL::DB::DeliveryOrder;
24 return SL::DB::Manager::Order->get_all_count(query => [ cp_id => $self->cp_id ])
25 + SL::DB::Manager::Invoice->get_all_count(query => [ cp_id => $self->cp_id ])
26 + SL::DB::Manager::PurchaseInvoice->get_all_count(query => [ cp_id => $self->cp_id ])
27 + SL::DB::Manager::DeliveryOrder->get_all_count(query => [ cp_id => $self->cp_id ]);
31 $_[0]->cp_cv_id(undef);
37 die 'not an accessor' if @_ > 1;
38 join ', ', grep $_, $self->cp_name, $self->cp_givenname;
43 die 'not an accessor' if @_ > 1;
45 . join '', map { " ($_)" } grep $_, $self->cp_abteilung;
50 die 'not an accessor' if @_ > 1;
51 join ' ', grep $_, $self->cp_title, $self->cp_givenname, $self->cp_name;