Verknüpfungen zum Preisfaktor-Objekt
[kivitendo-erp.git] / SL / DB / OrderItem.pm
1 package SL::DB::OrderItem;
2
3 use strict;
4
5 use SL::DB::MetaSetup::OrderItem;
6
7 __PACKAGE__->meta->add_relationship(
8   part => {
9     type         => 'one to one',
10     class        => 'SL::DB::Part',
11     column_map   => { parts_id => 'id' },
12   },
13   price_factor_obj => {
14     type           => 'one to one',
15     class          => 'SL::DB::PriceFactor',
16     column_map     => { price_factor_id => 'id' },
17   },
18 );
19
20 # Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
21 __PACKAGE__->meta->make_manager_class;
22
23 __PACKAGE__->meta->initialize;
24
25 sub is_price_update_available {
26   my $self = shift;
27   return $self->origprice > $self->part->sellprice;
28 }
29
30 1;