]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/IR.pm
Entwürfe: beim Buchen dazugehörigen Entwurf löschen
[kivitendo-erp.git] / SL / IR.pm
index a2688baea90109d54241484f127e40d35df3664f..a424ab99083b8a9334a193779adbace2050d2af1 100644 (file)
--- a/SL/IR.pm
+++ b/SL/IR.pm
@@ -41,6 +41,7 @@ use SL::Common;
 use SL::CVar;
 use SL::DATEV qw(:CONSTANTS);
 use SL::DBUtils;
+use SL::DB::Draft;
 use SL::DO;
 use SL::GenericTranslations;
 use SL::HTML::Restrict;
@@ -810,6 +811,10 @@ SQL
     do_query($form, $dbh, $query, @orphaned_ids);
   }
 
+  if ($form->{draft_id}) {
+    SL::DB::Manager::Draft->delete_all(where => [ id => delete($form->{draft_id}) ]);
+  }
+
   # safety check datev export
   if ($::instance_conf->get_datev_check_on_purchase_invoice) {
     # if we need department for kostenstelle in DATEV check