X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fir.pl;h=6c9c8a87eb67e70ee1470326b3dc6fdbada67df1;hb=ea2e84cc75e2879141eea5e957439936280682bf;hp=f3d02605f465c8e7c40710844949711333492c99;hpb=cf92746139ba3c141b3686250885257b6b54849e;p=kivitendo-erp.git diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index f3d02605f..6c9c8a87e 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -31,11 +31,14 @@ # #====================================================================== +use SL::FU; use SL::IR; use SL::IS; use SL::PE; +use List::Util qw(max sum); require "bin/mozilla/io.pl"; +require "bin/mozilla/invoice_io.pl"; require "bin/mozilla/arap.pl"; require "bin/mozilla/common.pl"; require "bin/mozilla/drafts.pl"; @@ -47,6 +50,8 @@ require "bin/mozilla/drafts.pl"; sub add { $lxdebug->enter_sub(); + $auth->assert('vendor_invoice_edit'); + return $lxdebug->leave_sub() if (load_draft_maybe()); $form->{title} = $locale->text('Add Vendor Invoice'); @@ -60,11 +65,13 @@ sub add { sub edit { $lxdebug->enter_sub(); - + + $auth->assert('vendor_invoice_edit'); + # show history button $form->{javascript} = qq||; #/show hhistory button - + $form->{title} = $locale->text('Edit Vendor Invoice'); &invoice_links; @@ -77,11 +84,11 @@ sub edit { sub invoice_links { $lxdebug->enter_sub(); - # create links - $form->{webdav} = $webdav; + $auth->assert('vendor_invoice_edit'); - # set jscalendar - $form->{jscalendar} = $jscalendar; + # create links + $form->{webdav} = $webdav; + $form->{jsscript} = 1; $form->create_links("AP", \%myconfig, "vendor"); @@ -109,7 +116,7 @@ sub invoice_links { IR->get_vendor(\%myconfig, \%$form); IR->retrieve_invoice(\%myconfig, \%$form); $form->{cp_id} = $cp_id; - + if ($payment_id) { $form->{payment_id} = $payment_id; } @@ -120,22 +127,10 @@ sub invoice_links { $form->{taxzone_id} = $taxzone_id; } - # currencies - @curr = split(/:/, $form->{currencies}); - chomp $curr[0]; - $form->{defaultcurrency} = $curr[0]; - map { $form->{selectcurrency} .= "