X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fap.pl;h=3440f93fbbc3f2d4268957358b3f8310f5f11d71;hb=71c23cdf2826595579b8e62fc964393875ef070f;hp=00ab61801a5f97e8715443c0cfdd226cc1c88e42;hpb=f7b15d4334848fad1bcd0b569eff5139f9a6ba4d;p=kivitendo-erp.git
diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl
index 00ab61801..3440f93fb 100644
--- a/bin/mozilla/ap.pl
+++ b/bin/mozilla/ap.pl
@@ -40,10 +40,11 @@ use SL::AP;
use SL::FU;
use SL::IR;
use SL::IS;
-use SL::PE;
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";
@@ -99,6 +100,7 @@ sub add {
$form->{initial_transdate} = $form->{transdate};
create_links(dont_save => 1);
$form->{transdate} = $form->{initial_transdate};
+
&display_form;
$main::lxdebug->leave_sub();
@@ -126,6 +128,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->catfile($_->full_filedescriptor),
+ } } @all_objects;
+ }
&form_header;
&form_footer;
@@ -173,11 +188,7 @@ sub create_links {
(@{ $form->{all_vendor} });
}
- # departments
- if (@{ $form->{all_departments} || [] }) {
- $form->{department} = "$form->{department}--$form->{department_id}";
- $form->{selectdepartment} = "