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' ]
21 periodic_invoices_config => {
23 class => 'SL::DB::PeriodicInvoicesConfig',
24 column_map => { id => 'oe_id' },
26 periodic_invoices => {
27 type => 'one to many',
28 class => 'SL::DB::PeriodicInvoice',
29 column_map => { id => 'oe_id' },
33 __PACKAGE__->meta->initialize;
37 sub items { goto &orderitems; }
42 return 'sales_order' if $self->customer_id && ! $self->quotation;
43 return 'purchase_order' if $self->vendor_id && ! $self->quotation;
44 return 'sales_quotation' if $self->customer_id && $self->quotation;
45 return 'request_quotation' if $self->vendor_id && $self->quotation;
51 return shift->type eq shift;
58 if ($self->quotation) {
61 return SL::DB::Manager::Invoice->get_all(
63 ordnumber => $self->ordnumber,
64 @{ $params{query} || [] },
70 sub abschlag_invoices {
71 return shift()->invoices(query => [ abschlag => 1 ]);
75 return shift()->invoices(query => [ abschlag => 0 ]);
84 SL::DB::Order - Order Datenbank Objekt.
90 Returns one of the following string types:
100 =item request_quotation
106 Rreturns true if the order is of the given type.
114 Sven Schöling <s.schoeling@linet-services.de>