X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fir.pl;h=87225eb043f7e3cce2cecec7daab2a8f5f356cd9;hb=ea43d77bdaf75a43472261a971b29e732a410321;hp=ad850892238eb16f5ba8c7bfcf86951dc3fc931c;hpb=1e25131315e72036aa6df1d626011a761218d233;p=kivitendo-erp.git diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index ad8508922..87225eb04 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -31,12 +31,14 @@ # #====================================================================== +use SL::FU; use SL::IR; use SL::IS; use SL::PE; -use List::Util qw(max); +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"; @@ -48,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'); @@ -61,7 +65,9 @@ sub add { sub edit { $lxdebug->enter_sub(); - $form->{"Watchdog::qty_1"} = 1; + + $auth->assert('vendor_invoice_edit'); + # show history button $form->{javascript} = qq||; #/show hhistory button @@ -78,6 +84,8 @@ sub edit { sub invoice_links { $lxdebug->enter_sub(); + $auth->assert('vendor_invoice_edit'); + # create links $form->{webdav} = $webdav; $form->{jsscript} = 1; @@ -181,6 +189,8 @@ sub invoice_links { sub prepare_invoice { $lxdebug->enter_sub(); + $auth->assert('vendor_invoice_edit'); + if ($form->{id}) { map { $form->{$_} =~ s/\"/"/g } qw(invnumber ordnumber quonumber); @@ -214,6 +224,10 @@ sub prepare_invoice { sub form_header { $lxdebug->enter_sub(); + $auth->assert('vendor_invoice_edit'); + + push @{ $form->{AJAX} }, CGI::Ajax->new('set_duedate_vendor' => "$form->{script}?action=set_duedate_vendor"); + # set option selected foreach $item (qw(AP vendor currency department)) { $form->{"select$item"} =~ s/ selected//; @@ -333,7 +347,7 @@ sub form_header { : (NTI($cgi->popup_menu('-name' => 'vendor', '-default' => $form->{oldvendor}, '-onChange' => 'document.getElementById(\'update_button\').click();', '-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px')))) . qq| - + |; %labels = (); @@ -377,11 +391,18 @@ sub form_header { $jsscript = ""; $button1 = qq| -