X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/82515b2d93dc5632f24d6e0b6f8f05f3fd19fbb0..14d07f37b1f03ecb512b221faeb93e62dfd34b3d:/SL/DB/Invoice.pm diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index cc488829f..c64cf9d1d 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -9,10 +9,8 @@ use List::Util qw(first); use SL::DB::MetaSetup::Invoice; use SL::DB::Manager::Invoice; - -__PACKAGE__->attr_number($_, places => -2) for qw(amount netamount paid marge_total marge_percent taxamount); -__PACKAGE__->attr_date($_) for qw(transdate gldate datepaid duedate deliverydate orddate quodate); -__PACKAGE__->attr_percent($_) for qw(abschlag_percentage); +use SL::DB::Helper::LinkedRecords; +use SL::DB::Helper::PriceTaxCalculator; __PACKAGE__->meta->add_relationship( invoiceitems => { @@ -29,6 +27,8 @@ __PACKAGE__->meta->initialize; # methods +sub items { goto &invoiceitems; } + # it is assumed, that ordnumbers are unique here. sub first_order_by_ordnumber { my $self = shift; @@ -59,4 +59,6 @@ sub taxamount { return $self->amount - $self->netamount; } +__PACKAGE__->meta->make_attr_helpers(taxamount => 'numeric(15,5)'); + 1;