8 use SL::DB::MetaSetup::Order;
 
   9 use SL::DB::Manager::Order;
 
  12 __PACKAGE__->meta->add_relationship(
 
  14     type         => 'one to many',
 
  15     class        => 'SL::DB::OrderItem',
 
  16     column_map   => { id => 'trans_id' },
 
  18       with_objects => [ 'part' ]
 
  23 __PACKAGE__->meta->initialize;
 
  30   return 'sales_order'       if $self->customer_id && ! $self->quotation;
 
  31   return 'purchase_order'    if $self->vendor_id   && ! $self->quotation;
 
  32   return 'sales_quotation'   if $self->customer_id &&   $self->quotation;
 
  33   return 'request_quotation' if $self->vendor_id   &&   $self->quotation;
 
  39   return shift->type eq shift;
 
  46   if ($self->quotation) {
 
  49     return SL::DB::Manager::Invoice->get_all(
 
  51         ordnumber => $self->ordnumber,
 
  52         @{ $params{query} || [] },
 
  58 sub abschlag_invoices {
 
  59   return shift()->invoices(query => [ abschlag => 1 ]);
 
  63   return shift()->invoices(query => [ abschlag => 0 ]);
 
  72 SL::DB::Order - Order Datenbank Objekt.
 
  78 Returns one of the following string types:
 
  88 =item request_quotation
 
  94 Rreturns true if the order is of the given type.
 
 102 Sven Schöling <s.schoeling@linet-services.de>