From 9d0aef995ce621cc75eafd1623fbf9a018e6168e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Fri, 23 Dec 2016 10:08:14 +0100 Subject: [PATCH] Kreditorenbuchung um WebDAV-Funktion erweitert --- SL/Webdav.pm | 1 + bin/mozilla/ap.pl | 21 +++++++++++++++++++++ doc/changelog | 2 ++ templates/webpages/ap/form_header.html | 11 ++++++++++- 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/SL/Webdav.pm b/SL/Webdav.pm index 22a402073..946f2bffd 100644 --- a/SL/Webdav.pm +++ b/SL/Webdav.pm @@ -31,6 +31,7 @@ my %type_to_path = ( assembly => 'erzeugnisse', letter => 'briefe', general_ledger => 'dialogbuchungen', + accounts_payable => 'kreditorenbuchungen', ); sub get_all_files { diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index eee20d0a0..0af34509a 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -43,6 +43,8 @@ use SL::IS; use SL::ReportGenerator; use SL::DB::Default; use SL::DB::PurchaseInvoice; +use SL::Webdav; +use SL::Locale::String qw(t8); require "bin/mozilla/arap.pl"; require "bin/mozilla/common.pl"; @@ -125,6 +127,19 @@ sub display_form { $main::auth->assert('ap_transactions'); + # get all files stored in the webdav folder + if ($form->{invnumber} && $::instance_conf->get_webdav) { + my $webdav = SL::Webdav->new( + type => 'accounts_payable', + number => $form->{invnumber}, + ); + 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; &form_footer; @@ -728,6 +743,12 @@ sub post { $form->{id} = 0 if $form->{postasnew}; if (AP->post_transaction(\%myconfig, \%$form)) { + # create webdav folder + if ($::instance_conf->get_webdav) { + SL::Webdav->new(type => 'accounts_payable', + number => $form->{invnumber}, + )->webdav_path; + } # saving the history if(!exists $form->{addition} && $form->{id} ne "") { $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; diff --git a/doc/changelog b/doc/changelog index d43e46ad0..3bf706f3e 100644 --- a/doc/changelog +++ b/doc/changelog @@ -10,6 +10,8 @@ kleinere neue Features und Detailverbesserungen: - Dialogbuchen um WebDAV-Funktion erweitert + - Kreditorenbuchung um WebDAV-Funktion erweitert + - Verfeinerung der Rechte für Finanzbuchhaltung: Es können nun für Dialogbuchungen, Debitoren- und Kreditorenbuchungen extra Rechte vergeben werden diff --git a/templates/webpages/ap/form_header.html b/templates/webpages/ap/form_header.html index 07e3188d8..56abcb7f3 100644 --- a/templates/webpages/ap/form_header.html +++ b/templates/webpages/ap/form_header.html @@ -79,9 +79,12 @@

[% saved_message | html %]

[% END %] -
+
+[% PROCESS 'webdav/_list.html' %] +
+ [% LxERP.t8('Loading...') %] +
+
+ -- 2.20.1