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;
40 return 'sales_order' if $self->customer_id && ! $self->quotation;
41 return 'purchase_order' if $self->vendor_id && ! $self->quotation;
42 return 'sales_quotation' if $self->customer_id && $self->quotation;
43 return 'request_quotation' if $self->vendor_id && $self->quotation;
49 return shift->type eq shift;
56 if ($self->quotation) {
59 return SL::DB::Manager::Invoice->get_all(
61 ordnumber => $self->ordnumber,
62 @{ $params{query} || [] },
68 sub abschlag_invoices {
69 return shift()->invoices(query => [ abschlag => 1 ]);
73 return shift()->invoices(query => [ abschlag => 0 ]);
82 SL::DB::Order - Order Datenbank Objekt.
88 Returns one of the following string types:
98 =item request_quotation
104 Rreturns true if the order is of the given type.
112 Sven Schöling <s.schoeling@linet-services.de>