Revision b632cee8
Von Moritz Bunkus vor fast 12 Jahren hinzugefügt
SL/DB/OrderItem.pm | ||
---|---|---|
16 | 16 |
); |
17 | 17 |
|
18 | 18 |
__PACKAGE__->meta->add_relationship( |
19 |
part => { |
|
20 |
type => 'one to one', |
|
21 |
class => 'SL::DB::Part', |
|
22 |
column_map => { parts_id => 'id' }, |
|
23 |
}, |
|
24 |
price_factor_obj => { |
|
25 |
type => 'one to one', |
|
26 |
class => 'SL::DB::PriceFactor', |
|
27 |
column_map => { price_factor_id => 'id' }, |
|
28 |
}, |
|
29 | 19 |
unit_obj => { |
30 | 20 |
type => 'one to one', |
31 | 21 |
class => 'SL::DB::Unit', |
32 | 22 |
column_map => { unit => 'name' }, |
33 | 23 |
}, |
34 |
order => { |
|
35 |
type => 'one to one', |
|
36 |
class => 'SL::DB::Order', |
|
37 |
column_map => { trans_id => 'id' }, |
|
38 |
}, |
|
39 | 24 |
); |
40 | 25 |
|
41 | 26 |
__PACKAGE__->meta->initialize; |
... | ... | |
54 | 39 |
return sum(map { AM->convert_unit($_->unit => $self->unit) * $_->qty } @doi); |
55 | 40 |
} |
56 | 41 |
|
42 |
sub part { |
|
43 |
# canonial alias for parts. |
|
44 |
goto &parts; |
|
45 |
} |
|
46 |
|
|
47 |
sub order { |
|
48 |
# canonial alias for trans. |
|
49 |
goto &trans; |
|
50 |
} |
|
51 |
|
|
57 | 52 |
1; |
Auch abrufbar als: Unified diff
InvoiceItem, OrderItem, DeliveryOrderItem: diverse Fremdschlüssel eingeführt