X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/fc35d1dd4441b0dd26fe0b1b397cc66508a715f3..a87694dc525b4eabff11029f1e5401621e2bd3bc:/SL/DB/Invoice.pm diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 3ed6cd34e..065d2b3cd 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -1,6 +1,3 @@ -# This file has been auto-generated only because it didn't exist. -# Feel free to modify it at will; it will not be overwritten automatically. - package SL::DB::Invoice; use strict; @@ -13,6 +10,7 @@ use SL::DB::MetaSetup::Invoice; use SL::DB::Manager::Invoice; use SL::DB::Helper::Payment qw(:ALL); use SL::DB::Helper::AttrHTML; +use SL::DB::Helper::AttrSorted; use SL::DB::Helper::FlattenToForm; use SL::DB::Helper::LinkedRecords; use SL::DB::Helper::PriceTaxCalculator; @@ -61,6 +59,7 @@ __PACKAGE__->meta->add_relationship( __PACKAGE__->meta->initialize; __PACKAGE__->attr_html('notes'); +__PACKAGE__->attr_sorted('items'); __PACKAGE__->before_save('_before_save_set_invnumber'); @@ -79,12 +78,6 @@ sub _before_save_set_invnumber { sub items { goto &invoiceitems; } sub add_items { goto &add_invoiceitems; } -sub items_sorted { - my ($self) = @_; - - return [ sort {$a->position <=> $b->position } @{ $self->items } ]; -} - sub is_sales { # For compatibility with Order, DeliveryOrder croak 'not an accessor' if @_ > 1;