1 package SL::DB::Shipto;
5 use SL::DB::MetaSetup::Shipto;
6 use SL::DB::Manager::Shipto;
7 use SL::DB::Helper::CustomVariables (
12 our @SHIPTO_VARIABLES = qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptogln shiptocontact
13 shiptophone shiptofax shiptoemail shiptodepartment_1 shiptodepartment_2);
15 __PACKAGE__->meta->initialize;
19 my $text = join('; ', grep { $_ } (map({ $self->$_ } qw(shiptoname shiptostreet)),
22 qw(shiptozipcode shiptocity))));
30 return unless $self->shipto_id;
32 require SL::DB::Order;
33 require SL::DB::Invoice;
34 require SL::DB::DeliveryOrder;
36 return SL::DB::Manager::Order->get_all_count(query => [ shipto_id => $self->shipto_id ])
37 || SL::DB::Manager::Invoice->get_all_count(query => [ shipto_id => $self->shipto_id ])
38 || SL::DB::Manager::DeliveryOrder->get_all_count(query => [ shipto_id => $self->shipto_id ]);
42 $_[0]->trans_id(undef);