X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/f7b15d4334848fad1bcd0b569eff5139f9a6ba4d..b166ba3bdc7dbc69b5be36501905508fd3dce242:/bin/mozilla/gl.pl diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 9b54c9af6..2c5f74a7e 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -41,9 +41,10 @@ use List::Util qw(sum); use SL::FU; use SL::GL; use SL::IS; -use SL::PE; use SL::ReportGenerator; use SL::DBUtils qw(selectrow_query selectall_hashref_query); +use SL::Webdav; +use SL::Locale::String qw(t8); require "bin/mozilla/common.pl"; require "bin/mozilla/reportgenerator.pl"; @@ -201,6 +202,18 @@ sub edit { $form->{show_details} = $myconfig{show_form_details} unless defined $form->{show_details}; + if ($form->{reference} && $::instance_conf->get_webdav) { + my $webdav = SL::Webdav->new( + type => 'general_ledger', + number => $form->{reference}, + ); + my $webdav_path = $webdav->webdav_path; + my @all_objects = $webdav->get_all_objects; + @{ $form->{WEBDAV} } = map { { name => $_->filename, + type => t8('File'), + link => File::Spec->catdir($webdav_path, $_->filename), + } } @all_objects; + } form_header(); display_rows(); form_footer(); @@ -511,6 +524,12 @@ sub generate_report { $main::lxdebug->leave_sub(); } +sub show_draft { + $::form->{transdate} = DateTime->today_local->to_kivitendo if !$::form->{transdate}; + $::form->{gldate} = $::form->{transdate} if !$::form->{gldate}; + update(); +} + sub update { $main::lxdebug->enter_sub(); @@ -1163,6 +1182,11 @@ sub post { $form->{storno} = 0; post_transaction(); + if ($::instance_conf->get_webdav) { + SL::Webdav->new(type => 'general_ledger', + number => $form->{reference}, + )->webdav_path; + } $form->{callback} = build_std_url("action=add", "show_details"); $form->redirect($form->{callback});