Fremdschlüssel für Tabellen oe, delivery_orders, parts, translation
[kivitendo-erp.git] / SL / DB / InvoiceItem.pm
index d8b3903..016f945 100644 (file)
@@ -3,13 +3,20 @@ package SL::DB::InvoiceItem;
 use strict;
 
 use SL::DB::MetaSetup::InvoiceItem;
+use SL::DB::Helper::CustomVariables (
+  sub_module  => 'invoice',
+  cvars_alias => 1,
+  overloads   => {
+    parts_id => 'SL::DB::Part',
+  },
+);
 
 __PACKAGE__->meta->add_relationship(
-  part => {
+  unit_obj       => {
     type         => 'one to one',
-    class        => 'SL::DB::Part',
-    column_map   => { parts_id => 'id' },
-  }
+    class        => 'SL::DB::Unit',
+    column_map   => { unit => 'name' },
+  },
 );
 
 # Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
@@ -17,4 +24,9 @@ __PACKAGE__->meta->make_manager_class;
 
 __PACKAGE__->meta->initialize;
 
+sub part {
+  # canonial alias for parts.
+  goto &parts;
+}
+
 1;