1 package SL::DB::Shipto;
5 use SL::DB::MetaSetup::Shipto;
6 use SL::DB::Manager::Shipto;
7 use Rose::DB::Object::Helpers qw(clone_and_reset clone);
9 our @SHIPTO_VARIABLES = qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact
10 shiptophone shiptofax shiptoemail shiptodepartment_1 shiptodepartment_2);
12 __PACKAGE__->meta->initialize;
16 my $text = join('; ', grep { $_ } (map({ $self->$_ } qw(shiptoname shiptostreet)),
19 qw(shiptozipcode shiptocity))));
27 return unless $self->shipto_id;
29 require SL::DB::Order;
30 require SL::DB::Invoice;
31 require SL::DB::DeliveryOrder;
33 return SL::DB::Manager::Order->get_all_count(query => [ shipto_id => $self->shipto_id ])
34 || SL::DB::Manager::Invoice->get_all_count(query => [ shipto_id => $self->shipto_id ])
35 || SL::DB::Manager::DeliveryOrder->get_all_count(query => [ shipto_id => $self->shipto_id ]);
39 $_[0]->trans_id(undef);