X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fir.pl;h=6c9c8a87eb67e70ee1470326b3dc6fdbada67df1;hb=ea2e84cc75e2879141eea5e957439936280682bf;hp=e6f035d01fbe3fddc91be1fc9a375e2103bccf11;hpb=df88ef1f6710198e1228ac1b8846dd3e64a5ca25;p=kivitendo-erp.git diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index e6f035d01..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; } @@ -124,13 +131,6 @@ sub invoice_links { $form->{oldvendor} = "$form->{vendor}--$form->{vendor_id}"; - # vendors - if (@{ $form->{all_vendor} }) { - $form->{vendor} = "$form->{vendor}--$form->{vendor_id}"; - map { $form->{selectvendor} .= "