]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DB/InvoiceItem.pm
Rose: 'with_args' nach Foreign-Key-Einführung gefixt
[mfinanz.git] / SL / DB / InvoiceItem.pm
index 1407c33343ba6726c5fe5f689c4f91f9b443a3c8..36f0870d0c7eafc5bc71073bba6072fce8dbbdb9 100644 (file)
@@ -3,20 +3,17 @@ 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 => {
-    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' },
   },
@@ -27,4 +24,9 @@ __PACKAGE__->meta->make_manager_class;
 
 __PACKAGE__->meta->initialize;
 
+sub part {
+  # canonial alias for parts.
+  goto &parts;
+}
+
 1;