kivitendo/SL/DB/InvoiceItem.pm @ cdf32772
82515b2d | Sven Schöling | package SL::DB::InvoiceItem;
|
||
use strict;
|
||||
use SL::DB::MetaSetup::InvoiceItem;
|
||||
916ec1da | Bernd Bleßmann | use SL::DB::Manager::InvoiceItem;
|
||
942291e4 | Bernd Bleßmann | use SL::DB::Helper::ActsAsList;
|
||
ca808f20 | Geoffrey Richardson | use SL::DB::Helper::LinkedRecords;
|
||
1904d8c6 | Sven Schöling | use SL::DB::Helper::RecordItem;
|
||
1b65e282 | Sven Schöling | use SL::DB::Helper::CustomVariables (
|
||
sub_module => 'invoice',
|
||||
cvars_alias => 1,
|
||||
overloads => {
|
||||
5a7ae14c | Sven Schöling | parts_id => {
|
||
class => 'SL::DB::Part',
|
||||
module => 'IC',
|
||||
},
|
||||
1b65e282 | Sven Schöling | },
|
||
);
|
||||
2f56fd8d | Tamino Steinert | use Rose::DB::Object::Helpers qw(as_tree strip);
|
||
82515b2d | Sven Schöling | |||
942291e4 | Bernd Bleßmann | __PACKAGE__->configure_acts_as_list(group_by => [qw(trans_id)]);
|
||
cd9e51e6 | Moritz Bunkus | __PACKAGE__->meta->add_relationships(
|
||
invoice => {
|
||||
type => 'one to one',
|
||||
class => 'SL::DB::Invoice',
|
||||
column_map => { trans_id => 'id' },
|
||||
},
|
||||
purchase_invoice => {
|
||||
type => 'one to one',
|
||||
class => 'SL::DB::PurchaseInvoice',
|
||||
column_map => { trans_id => 'id' },
|
||||
},
|
||||
);
|
||||
82515b2d | Sven Schöling | __PACKAGE__->meta->initialize;
|
||
073ee541 | Geoffrey Richardson | sub record {
|
||
my ($self) = @_;
|
||||
return $self->invoice if $self->invoice;
|
||||
return $self->purchase_invoice if $self->purchase_invoice;
|
||||
return;
|
||||
};
|
||||
82515b2d | Sven Schöling | 1;
|