SL::DB::Customer: Fehler in der shipto Relation.
[kivitendo-erp.git] / SL / DB / Customer.pm
1 package SL::DB::Customer;
2
3 use strict;
4
5 use SL::DB::MetaSetup::Customer;
6
7 use SL::DB::VC;
8
9 __PACKAGE__->meta->add_relationship(
10   shipto => {
11     type         => 'one to many',
12     class        => 'SL::DB::Shipto',
13     column_map   => { id      => 'trans_id' },
14     manager_args => { sort_by => 'lower(shipto.shiptoname)' },
15     query_args   => [ 'module' => 'CT' ],
16   },
17   business => {
18     type         => 'one to one',
19     class        => 'SL::DB::Business',
20     column_map   => { business_id => 'id' },
21   },
22 );
23
24 __PACKAGE__->meta->make_manager_class;
25 __PACKAGE__->meta->initialize;
26
27 sub short_address {
28   my ($self) = @_;
29
30   return join ', ', grep { $_ } $self->street, $self->zipcode, $self->city;
31 }
32
33 1;