Rose-Models Einkauf/Verkauf: Relationships für angepasste Lieferadressen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 6 Feb 2014 13:23:07 +0000 (14:23 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 24 Feb 2014 13:40:01 +0000 (14:40 +0100)
SL/DB/DeliveryOrder.pm
SL/DB/Invoice.pm
SL/DB/Order.pm
SL/DB/PurchaseInvoice.pm

index 0a8f348..8409c2b 100644 (file)
@@ -17,6 +17,12 @@ __PACKAGE__->meta->add_relationship(orderitems => { type         => 'one to many
                                                     column_map   => { id => 'delivery_order_id' },
                                                     manager_args => { with_objects => [ 'part' ] }
                                                   },
+                                    custom_shipto => {
+                                      type        => 'one to one',
+                                      class       => 'SL::DB::Shipto',
+                                      column_map  => { id => 'trans_id' },
+                                      query_args  => [ module => 'DO' ],
+                                    },
                                    );
 
 __PACKAGE__->meta->initialize;
index 72844b4..a2b8d1a 100644 (file)
@@ -38,6 +38,12 @@ __PACKAGE__->meta->add_relationship(
     column_map      => { id => 'ar_id' },
     manager_args    => { with_objects => [ 'sepa_export' ] }
   },
+  custom_shipto     => {
+    type            => 'one to one',
+    class           => 'SL::DB::Shipto',
+    column_map      => { id => 'trans_id' },
+    query_args      => [ module => 'AR' ],
+  },
 );
 
 __PACKAGE__->meta->initialize;
index e2516ea..f037ed1 100644 (file)
@@ -30,6 +30,12 @@ __PACKAGE__->meta->add_relationship(
     class                  => 'SL::DB::PeriodicInvoicesConfig',
     column_map             => { id => 'oe_id' },
   },
+  custom_shipto            => {
+    type                   => 'one to one',
+    class                  => 'SL::DB::Shipto',
+    column_map             => { id => 'trans_id' },
+    query_args             => [ module => 'OE' ],
+  },
 );
 
 __PACKAGE__->meta->initialize;
index 61d9355..2457cde 100644 (file)
@@ -23,6 +23,12 @@ __PACKAGE__->meta->add_relationship(
     column_map      => { id => 'ap_id' },
     manager_args    => { with_objects => [ 'sepa_export' ] }
   },
+  custom_shipto     => {
+    type            => 'one to one',
+    class           => 'SL::DB::Shipto',
+    column_map      => { id => 'trans_id' },
+    query_args      => [ module => 'AP' ],
+  },
 );
 
 __PACKAGE__->meta->initialize;