Items in Belegen können durch LinkedRecords angesprochen werden
[kivitendo-erp.git] / SL / DB / InvoiceItem.pm
1 package SL::DB::InvoiceItem;
2
3 use strict;
4
5 use SL::DB::MetaSetup::InvoiceItem;
6 use SL::DB::Helper::ActsAsList;
7 use SL::DB::Helper::LinkedRecords;
8 use SL::DB::Helper::CustomVariables (
9   sub_module  => 'invoice',
10   cvars_alias => 1,
11   overloads   => {
12     parts_id => {
13      class => 'SL::DB::Part',
14      module => 'IC',
15     },
16   },
17 );
18
19 __PACKAGE__->meta->make_manager_class;
20
21 __PACKAGE__->configure_acts_as_list(group_by => [qw(trans_id)]);
22
23 __PACKAGE__->meta->add_relationships(
24   invoice          => {
25     type           => 'one to one',
26     class          => 'SL::DB::Invoice',
27     column_map     => { trans_id => 'id' },
28   },
29
30   purchase_invoice => {
31     type           => 'one to one',
32     class          => 'SL::DB::PurchaseInvoice',
33     column_map     => { trans_id => 'id' },
34   },
35 );
36
37 __PACKAGE__->meta->initialize;
38
39 1;