From: Moritz Bunkus Date: Tue, 24 Jan 2017 16:25:48 +0000 (+0100) Subject: Entwürfe: beim Buchen dazugehörigen Entwurf löschen X-Git-Tag: release-3.5.4~1646 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c954dea7c1b814d66b8c31d04fa70a1bbbcce71e;p=kivitendo-erp.git Entwürfe: beim Buchen dazugehörigen Entwurf löschen --- diff --git a/SL/AP.pm b/SL/AP.pm index 8d700640e..2d232a24b 100644 --- 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; diff --git a/SL/AR.pm b/SL/AR.pm index 4caf5273c..2ca302258 100644 --- 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; diff --git a/SL/Controller/Draft.pm b/SL/Controller/Draft.pm index 8ad37ced6..6c0110ab3 100644 --- a/SL/Controller/Draft.pm +++ b/SL/Controller/Draft.pm @@ -68,6 +68,7 @@ sub action_save { $self->js ->flash('info', t8("Draft saved.")) ->dialog->close('#save_draft') + ->val('#draft_id', $draft->id) ->render; } } diff --git a/SL/GL.pm b/SL/GL.pm index f46a95427..ec6b4a467 100644 --- 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; diff --git a/SL/IR.pm b/SL/IR.pm index a2688baea..a424ab990 100644 --- 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 diff --git a/SL/IS.pm b/SL/IS.pm index 6018634dd..d5e028067 100644 --- 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; diff --git a/templates/webpages/ap/form_footer.html b/templates/webpages/ap/form_footer.html index ba952ca5d..e66bb41ce 100644 --- a/templates/webpages/ap/form_footer.html +++ b/templates/webpages/ap/form_footer.html @@ -1,7 +1,7 @@ [%- USE T8 %] [%- USE HTML %] [%- USE L %] -[%- USE LxERP %] +[%- USE LxERP %][%- USE P -%] [%- IF (num_follow_ups && num_due) %]

[% LxERP.t8('There are #1 unfinished follow-ups of which #2 are due.', num_follow_ups, num_due) %]

@@ -9,8 +9,8 @@ - - +[% P.hidden_tag('draft_id', draft_id) %] +[% P.hidden_tag('draft_description', draft_description) %]
diff --git a/templates/webpages/ar/form_footer.html b/templates/webpages/ar/form_footer.html index e7b9660dc..70864955b 100644 --- a/templates/webpages/ar/form_footer.html +++ b/templates/webpages/ar/form_footer.html @@ -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 @@ - - + [% P.hidden_tag('draft_id', draft_id) %] + [% P.hidden_tag('draft_description', draft_description) %]
diff --git a/templates/webpages/ir/form_footer.html b/templates/webpages/ir/form_footer.html index f07a2b810..ef36e6bff 100644 --- a/templates/webpages/ir/form_footer.html +++ b/templates/webpages/ir/form_footer.html @@ -1,7 +1,7 @@ [%- USE T8 %] [%- USE HTML %] [%- USE LxERP %] -[%- USE L %] +[%- USE L %][%- USE P -%] @@ -152,8 +152,8 @@ - - +[% P.hidden_tag('draft_id', draft_id) %] +[% P.hidden_tag('draft_description', draft_description) %] diff --git a/templates/webpages/is/form_footer.html b/templates/webpages/is/form_footer.html index 912218a48..1cb4a1836 100644 --- a/templates/webpages/is/form_footer.html +++ b/templates/webpages/is/form_footer.html @@ -201,8 +201,8 @@ - - +[% P.hidden_tag('draft_id', draft_id) %] +[% P.hidden_tag('draft_description', draft_description) %]