]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Entwürfe: beim Buchen dazugehörigen Entwurf löschen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 24 Jan 2017 16:25:48 +0000 (17:25 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 24 Jan 2017 16:41:23 +0000 (17:41 +0100)
SL/AP.pm
SL/AR.pm
SL/Controller/Draft.pm
SL/GL.pm
SL/IR.pm
SL/IS.pm
templates/webpages/ap/form_footer.html
templates/webpages/ar/form_footer.html
templates/webpages/ir/form_footer.html
templates/webpages/is/form_footer.html

index 8d700640e532b86b80506c23286ff1af7c1e1383..2d232a24b964f2e0d6668ef7cb0c8f71213cef85 100644 (file)
--- a/SL/AP.pm
+++ b/SL/AP.pm
@@ -40,6 +40,7 @@ use SL::DBUtils;
 use SL::IO;
 use SL::MoreCommon;
 use SL::DB::Default;
+use SL::DB::Draft;
 use SL::Util qw(trim);
 use SL::DB;
 use Data::Dumper;
@@ -361,6 +362,10 @@ sub _post_transaction {
 
   IO->set_datepaid(table => 'ap', id => $form->{id}, dbh => $dbh);
 
+  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_ap_transaction) {
     my $transdate = $::form->{transdate} ? DateTime->from_lxoffice($::form->{transdate}) : undef;
index 4caf5273ca5ebb1227194b35c8e4215ce460bf52..2ca302258d9d0d0a2a17e382f875357d49b730d6 100644 (file)
--- a/SL/AR.pm
+++ b/SL/AR.pm
@@ -38,6 +38,7 @@ package AR;
 use Data::Dumper;
 use SL::DATEV qw(:CONSTANTS);
 use SL::DBUtils;
+use SL::DB::Draft;
 use SL::IO;
 use SL::MoreCommon;
 use SL::DB::Default;
@@ -305,6 +306,10 @@ sub _post_transaction {
 
   IO->set_datepaid(table => 'ar', id => $form->{id}, dbh => $dbh);
 
+  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_ar_transaction) {
     my $transdate = $::form->{transdate} ? DateTime->from_lxoffice($::form->{transdate}) : undef;
index 8ad37ced6f8fb0f9f88ee5eae70509c864a25808..6c0110ab350f5b4652aa22fe8594a41aeedda989 100644 (file)
@@ -68,6 +68,7 @@ sub action_save {
     $self->js
       ->flash('info', t8("Draft saved."))
       ->dialog->close('#save_draft')
+      ->val('#draft_id', $draft->id)
       ->render;
   }
 }
index f46a95427ca6440a0f5ab90d9b84ed4718559d2d..ec6b4a467f9e253a636802bf0e5f76b7ce5cda18 100644 (file)
--- a/SL/GL.pm
+++ b/SL/GL.pm
@@ -45,6 +45,7 @@ use Data::Dumper;
 use SL::DATEV qw(:CONSTANTS);
 use SL::DBUtils;
 use SL::DB::Chart;
+use SL::DB::Draft;
 use SL::Util qw(trim);
 use SL::DB;
 
@@ -190,6 +191,10 @@ sub _post_transaction {
     do_query($form, $dbh, qq|UPDATE gl SET storno = 't' WHERE id = ?|, conv_i($form->{storno_id}));
   }
 
+  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_gl_transaction) {
     my $transdate = $::form->{transdate} ? DateTime->from_lxoffice($::form->{transdate}) : undef;
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
index 6018634dd8c3a0d01e83876619c4d089e1c79ae9..d5e028067fca12f560e4a6711c2f53d50d1299af 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -52,6 +52,7 @@ use SL::IC;
 use SL::IO;
 use SL::TransNumber;
 use SL::DB::Default;
+use SL::DB::Draft;
 use SL::DB::Tax;
 use SL::DB::TaxZone;
 use SL::TransNumber;
@@ -1402,6 +1403,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_sales_invoice) {
     my $transdate = $::form->{invdate} ? DateTime->from_lxoffice($::form->{invdate}) : undef;
index ba952ca5deb137f0a3eb4a7b55c16acfd2e96c47..e66bb41ce21ea349e258c3c08f663a7591320c85 100644 (file)
@@ -1,7 +1,7 @@
 [%- USE T8 %]
 [%- USE HTML %]
 [%- USE L %]
-[%- USE LxERP %]
+[%- USE LxERP %][%- USE P -%]
 
 [%- IF (num_follow_ups && num_due) %]
   <p>[% LxERP.t8('There are #1 unfinished follow-ups of which #2 are due.', num_follow_ups, num_due) %]</p>
@@ -9,8 +9,8 @@
 
 <input name=callback type=hidden value="[% callback | html %]">
 <input name=gldate type=hidden value="[% gldate | html %]">
-<input type=hidden name=draft_id value="[% draft_id %]">
-<input type=hidden name=draft_description value="[% draft_description | html %]">
+[% P.hidden_tag('draft_id', draft_id) %]
+[% P.hidden_tag('draft_description', draft_description) %]
 
 <br>
 
index e7b9660dcf5e5ab25713236c3eabb382fdfce75f..70864955bf7638b781e8aa82cbf0943cdcf9838e 100644 (file)
@@ -1,6 +1,6 @@
 [% USE LxERP %]
 [% USE T8 %]
-[% USE L %]
+[% USE L %][%- USE P -%]
 
   [% IF ( follow_up_length && follow_up_due_length ) %]
     [% LxERP.t8('There are #1 unfinished follow-ups of which #2 are due.', follow_up_length , follow_up_due_length) %]
@@ -8,8 +8,8 @@
 
   <input type="hidden" name="gldate" value="[% gldate | html %]">
   <input type="hidden" name="callback" value="[% callback | html %]">
-  <input type="hidden" name="draft_id" value="[% draft_id | html %]">
-  <input type="hidden" name="draft_description" value="[% draft_description | html %]">
+  [% P.hidden_tag('draft_id', draft_id) %]
+  [% P.hidden_tag('draft_description', draft_description) %]
 
   <br>
 
index f07a2b81019a65311fb9ded3fb348d1b81327de8..ef36e6bff7bf2850c8feade0ad1364743e52cd74 100644 (file)
@@ -1,7 +1,7 @@
 [%- USE T8 %]
 [%- USE HTML %]
 [%- USE LxERP %]
-[%- USE L %]
+[%- USE L %][%- USE P -%]
   <tr>
    <td>
     <table width="100%">
 
 <input type="hidden" name="rowcount" value="[% rowcount %]">
 <input type="hidden" name="callback" value="[% callback %]">
-<input type="hidden" name="draft_id" value="[% draft_id %]">
-<input type="hidden" name="draft_description" value="[% draft_description %]">
+[% P.hidden_tag('draft_id', draft_id) %]
+[% P.hidden_tag('draft_description', draft_description) %]
 <input type="hidden" name="vendor_discount" value="[% vendor_discount %]">
 
 </form>
index 912218a4829bc38dcdd186ac0ade425fa1efcfb1..1cb4a1836c0b9c4c3beddfd245530b16549263fd 100644 (file)
 
 <input type="hidden" name="rowcount" value="[% rowcount %]">
 <input type="hidden" name="callback" value="[% callback | html %]">
-<input type="hidden" name="draft_id" value="[% draft_id %]">
-<input type="hidden" name="draft_description" value="[% draft_description %]">
+[% P.hidden_tag('draft_id', draft_id) %]
+[% P.hidden_tag('draft_description', draft_description) %]
 <input type="hidden" name="customer_discount" value="[% customer_discount %]">
 <input type="hidden" name="gldate" value="[% gldate %]">
 </form>