X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/ef2b5e949ac07d4f3258821f781da90761bead1a..8b7b7b3f6252786b38bb6c9357fc00a08750b8db:/SL/DB/OrderItem.pm?ds=sidebyside diff --git a/SL/DB/OrderItem.pm b/SL/DB/OrderItem.pm index 3b868d350..f7ff3bbe6 100644 --- a/SL/DB/OrderItem.pm +++ b/SL/DB/OrderItem.pm @@ -16,26 +16,11 @@ use SL::DB::Helper::CustomVariables ( ); __PACKAGE__->meta->add_relationship( - part => { - type => 'one to one', - class => 'SL::DB::Part', - column_map => { parts_id => 'id' }, - }, - price_factor_obj => { - type => 'one to one', - class => 'SL::DB::PriceFactor', - column_map => { price_factor_id => 'id' }, - }, unit_obj => { - type => 'one to one', + type => 'many to one', class => 'SL::DB::Unit', column_map => { unit => 'name' }, }, - order => { - type => 'one to one', - class => 'SL::DB::Order', - column_map => { trans_id => 'id' }, - }, ); __PACKAGE__->meta->initialize; @@ -54,4 +39,14 @@ sub shipped_qty { return sum(map { AM->convert_unit($_->unit => $self->unit) * $_->qty } @doi); } +sub part { + # canonial alias for parts. + goto &parts; +} + +sub order { + # canonial alias for trans. + goto &trans; +} + 1;