X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FOrder.pm;h=00886d67e8c4aa2d84666ddeac874c17231bbbbb;hb=f7e892266e58bd2a75de38b58feac85ed25747e8;hp=6a9977b0792c102479843fce7543be35429313e5;hpb=71180454c6f80037a7a2fa58a662b6b5cd4a67b1;p=kivitendo-erp.git diff --git a/SL/DB/Order.pm b/SL/DB/Order.pm index 6a9977b07..00886d67e 100644 --- a/SL/DB/Order.pm +++ b/SL/DB/Order.pm @@ -31,36 +31,6 @@ __PACKAGE__->meta->add_relationship( class => 'SL::DB::PeriodicInvoicesConfig', column_map => { id => 'oe_id' }, }, - periodic_invoices => { - type => 'one to many', - class => 'SL::DB::PeriodicInvoice', - column_map => { id => 'oe_id' }, - }, - payment_term => { - type => 'one to one', - class => 'SL::DB::PaymentTerm', - column_map => { payment_id => 'id' }, - }, - contact => { - type => 'one to one', - class => 'SL::DB::Contact', - column_map => { cp_id => 'cp_id' }, - }, - shipto => { - type => 'one to one', - class => 'SL::DB::Shipto', - column_map => { shipto_id => 'shipto_id' }, - }, - department => { - type => 'one to one', - class => 'SL::DB::Department', - column_map => { department_id => 'id' }, - }, - language => { - type => 'one to one', - class => 'SL::DB::Language', - column_map => { language_id => 'id' }, - }, ); __PACKAGE__->meta->initialize; @@ -69,6 +39,12 @@ __PACKAGE__->meta->initialize; sub items { goto &orderitems; } +sub items_sorted { + my ($self) = @_; + + return [ sort {$a->id <=> $b->id } @{ $self->items } ]; +} + sub type { my $self = shift; @@ -98,7 +74,7 @@ sub displayable_type { sub is_sales { croak 'not an accessor' if @_ > 1; - return shift->customer_id; + return !!shift->customer_id; } sub invoices { @@ -162,6 +138,10 @@ sub number { return $self->${ \ $number_method{$self->type} }(@_); } +sub date { + goto &transdate; +} + 1; __END__