]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DB/PurchaseInvoice.pm
DeliveryPlan: Cleanup, vc mitschleifen
[mfinanz.git] / SL / DB / PurchaseInvoice.pm
index f74ee19e146c0a006b79303e61ca973e6e5e3e29..3245e4b91fa25f85335d08ef7f326530c5038388 100644 (file)
@@ -23,11 +23,24 @@ __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;
 
 sub items { goto &invoiceitems; }
+sub add_items { goto &add_invoiceitems; }
+
+sub items_sorted {
+  my ($self) = @_;
+
+  return [ sort {$a->id <=> $b->id } @{ $self->items } ];
+}
 
 sub is_sales {
   # For compatibility with Order, DeliveryOrder