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;
 
  20   return unless $self->cp_id;
 
  22   require SL::DB::Order;
 
  23   require SL::DB::Invoice;
 
  24   require SL::DB::PurchaseInvoice;
 
  25   require SL::DB::DeliveryOrder;
 
  27   return SL::DB::Manager::Order->get_all_count(query => [ cp_id => $self->cp_id ])
 
  28        + SL::DB::Manager::Invoice->get_all_count(query => [ cp_id => $self->cp_id ])
 
  29        + SL::DB::Manager::PurchaseInvoice->get_all_count(query => [ cp_id => $self->cp_id ])
 
  30        + SL::DB::Manager::DeliveryOrder->get_all_count(query => [ cp_id => $self->cp_id ]);
 
  34   $_[0]->cp_cv_id(undef);
 
  40   die 'not an accessor' if @_ > 1;
 
  41   join ', ', grep $_, $self->cp_name, $self->cp_givenname;
 
  46   die 'not an accessor' if @_ > 1;
 
  48     . join '', map { " ($_)" } grep $_, $self->cp_abteilung;