7 use SL::DB::MetaSetup::Order;
 
   8 use SL::DB::Manager::Order;
 
  11 __PACKAGE__->meta->add_relationship(
 
  13     type         => 'one to many',
 
  14     class        => 'SL::DB::OrderItem',
 
  15     column_map   => { id => 'trans_id' },
 
  17       with_objects => [ 'part' ]
 
  22 __PACKAGE__->meta->initialize;
 
  29   return 'sales_order'       if $self->customer_id && ! $self->quotation;
 
  30   return 'purchase_order'    if $self->vendor_id   && ! $self->quotation;
 
  31   return 'sales_quotation'   if $self->customer_id &&   $self->quotation;
 
  32   return 'request_quotation' if $self->vendor_id   &&   $self->quotation;
 
  38   return shift->type eq shift;
 
  45   if ($self->quotation) {
 
  48     return SL::DB::Manager::Invoice->get_all(
 
  50         ordnumber => $self->ordnumber,
 
  51         @{ $params{query} || [] },
 
  57 sub abschlag_invoices {
 
  58   return shift()->invoices(query => [ abschlag => 1 ]);
 
  62   return shift()->invoices(query => [ abschlag => 0 ]);
 
  71 SL::DB::Order - Order Datenbank Objekt.
 
  77 Returns one of the following string types:
 
  87 =item request_quotation
 
  93 Rreturns true if the order is of the given type.
 
 101   Sven Schöling <s.schoeling@linet-services.de>