]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DB/Part.pm
Part - history_entries Relationship
[mfinanz.git] / SL / DB / Part.pm
index 901f57aa802febed8e829b3dfbc062430984dee6..32571276b9acc4d924dd8ab3354153f67561a0ec 100644 (file)
@@ -46,6 +46,13 @@ __PACKAGE__->meta->add_relationships(
     class        => 'SL::DB::AssortmentItem',
     column_map   => { id => 'assortment_id' },
   },
+  history_entries   => {
+    type            => 'one to many',
+    class           => 'SL::DB::History',
+    column_map      => { id => 'trans_id' },
+    query_args      => [ what_done => 'part' ],
+    manager_args    => { sort_by => 'itime' },
+  },
 );
 
 __PACKAGE__->meta->initialize;