1 package SL::DB::InvoiceItem;
5 use SL::DB::MetaSetup::InvoiceItem;
6 use SL::DB::Helper::ActsAsList;
7 use SL::DB::Helper::LinkedRecords;
8 use SL::DB::Helper::RecordItem;
9 use SL::DB::Helper::CustomVariables (
10 sub_module => 'invoice',
14 class => 'SL::DB::Part',
20 __PACKAGE__->meta->make_manager_class;
22 __PACKAGE__->configure_acts_as_list(group_by => [qw(trans_id)]);
24 __PACKAGE__->meta->add_relationships(
27 class => 'SL::DB::Invoice',
28 column_map => { trans_id => 'id' },
33 class => 'SL::DB::PurchaseInvoice',
34 column_map => { trans_id => 'id' },
38 __PACKAGE__->meta->initialize;
43 return $self->invoice if $self->invoice;
44 return $self->purchase_invoice if $self->purchase_invoice;