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