Payment-Helper pay_invoice case 'difference_as_skonto' entfernt
[kivitendo-erp.git] / SL / DB / Helper / LinkedRecords.pm
index bf91e6a..4614e5a 100644 (file)
@@ -210,7 +210,7 @@ sub _linked_records_implementation {
     }
 
     # don't use rose retrieval here. too slow.
-    # instead use recursive sql to get all the linked record_links entrys, and retrieve the objects from there
+    # instead use recursive sql to get all the linked record_links entries and retrieve the objects from there
     my $query = <<"";
       WITH RECURSIVE record_links_rec_${wanted}(id, from_table, from_id, to_table, to_id, depth, path, cycle) AS (
         SELECT id, from_table, from_id, to_table, to_id,
@@ -313,6 +313,9 @@ sub sort_linked_records {
                   'SL::DB::RequirementSpec' => sub { $_[0]->id },
                   'SL::DB::Letter'          => sub { $_[0]->letternumber },
                   'SL::DB::ShopOrder'       => sub { $_[0]->shop_ordernumber },
+                  'SL::DB::EmailJournal'    => sub { $_[0]->id },
+                  'SL::DB::Dunning'         => sub { $_[0]->dunning_id },
+                  'SL::DB::GLTransaction'   => sub { $_[0]->reference },
                   UNKNOWN                   => '9999999999999999',
                 );
   my $number_xtor = sub {
@@ -340,9 +343,11 @@ sub sort_linked_records {
               purchase_order            => 130,
               purchase_delivery_order   => 140,
               'SL::DB::PurchaseInvoice' => 150,
-              'SL::DB::PurchaseInvoice' => 150,
+              'SL::DB::GLTransaction'   => 170,
               'SL::DB::Letter'          => 200,
               'SL::DB::ShopOrder'       => 250,
+              'SL::DB::EmailJournal'    => 300,
+              'SL::DB::Dunning'         => 350,
               UNKNOWN                   => 999,
             );
   my $score_xtor = sub {