X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fir.pl;h=440ee6e4064035e56fc3e861e193bd141c86a143;hb=a25cb06e5823fc35924c0eae0c358763841307d0;hp=c9624ccb3035b25ea14f1f0406e0195a006a8f68;hpb=e06a7e08648363ef8c8ef14678ab853ae7bdd670;p=kivitendo-erp.git diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index c9624ccb3..440ee6e40 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,6 +84,8 @@ sub edit { sub invoice_links { $lxdebug->enter_sub(); + $auth->assert('vendor_invoice_edit'); + # create links $form->{webdav} = $webdav; $form->{jsscript} = 1; @@ -107,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; } @@ -122,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} .= "