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);
14 __PACKAGE__->meta->add_relationship(
16 type => 'one to many',
17 class => 'SL::DB::OrderItem',
18 column_map => { id => 'trans_id' },
20 with_objects => [ 'part' ]
25 __PACKAGE__->meta->initialize;
32 return 'sales_order' if $self->customer_id && ! $self->quotation;
33 return 'purchase_order' if $self->vendor_id && ! $self->quotation;
34 return 'sales_quotation' if $self->customer_id && $self->quotation;
35 return 'request_quotation' if $self->vendor_id && $self->quotation;
41 return shift->type eq shift;
48 if ($self->quotation) {
51 return SL::DB::Manager::Invoice->get_all(
53 ordnumber => $self->ordnumber,
54 @{ $params{query} || [] },
60 sub abschlag_invoices {
61 return shift()->invoices(query => [ abschlag => 1 ]);
65 return shift()->invoices(query => [ abschlag => 0 ]);
74 SL::DB::Order - Order Datenbank Objekt.
80 Returns one of the following string types:
90 =item request_quotation
96 Rreturns true if the order is of the given type.
104 Sven Schöling <s.schoeling@linet-services.de>