Angebots-Position mit Auftragsposition verknüpft (orderitems -> orderitems) II
authorJan Büren <jan@kivitendo-premium.de>
Thu, 22 Jan 2015 14:51:29 +0000 (15:51 +0100)
committerJan Büren <jan@kivitendo-premium.de>
Thu, 22 Jan 2015 14:51:29 +0000 (15:51 +0100)
   - mehrfach speichern (converted* wird nicht gelöscht)    i.O.

SL/OE.pm

index 9d6f849..d8c66f5 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -578,7 +578,7 @@ SQL
                                   name_prefix  => 'ic_',
                                   name_postfix => "_$i",
                                   dbh          => $dbh);
-      # link quotation items with order items
+      # link quotation items with order items and delete entry (just one link)
       if ($form->{"converted_from_quotation_orderitems_id_$i"}) {
         RecordLinks->create_links('dbh'        => $dbh,
                                   'mode'       => 'ids',
@@ -587,6 +587,7 @@ SQL
                                   'to_table'   => 'orderitems',
                                   'to_id'      => $orderitems_id,
         );
+        delete $form->{"converted_from_quotation_orderitems_id_$i"};
       }
     }
   }