7 use SL::DB::MetaSetup::Order;
8 use SL::DB::Manager::Order;
11 __PACKAGE__->attr_number($_, places => -2) for qw(amount netamount marge_total marge_percent);
12 __PACKAGE__->attr_date($_) for qw(transdate reqdate);
13 __PACKAGE__->attr_percent($_) for qw(marge_percent);
15 __PACKAGE__->meta->add_relationship(
17 type => 'one to many',
18 class => 'SL::DB::OrderItem',
19 column_map => { id => 'trans_id' },
21 with_objects => [ 'part' ]
26 __PACKAGE__->meta->initialize;
33 return 'sales_order' if $self->customer_id && ! $self->quotation;
34 return 'purchase_order' if $self->vendor_id && ! $self->quotation;
35 return 'sales_quotation' if $self->customer_id && $self->quotation;
36 return 'request_quotation' if $self->vendor_id && $self->quotation;
42 return shift->type eq shift;
49 if ($self->quotation) {
52 return SL::DB::Manager::Invoice->get_all(
54 ordnumber => $self->ordnumber,
55 @{ $params{query} || [] },
61 sub abschlag_invoices {
62 return shift()->invoices(query => [ abschlag => 1 ]);
66 return shift()->invoices(query => [ abschlag => 0 ]);
75 SL::DB::Order - Order Datenbank Objekt.
81 Returns one of the following string types:
91 =item request_quotation
97 Rreturns true if the order is of the given type.
105 Sven Schöling <s.schoeling@linet-services.de>