X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fir.pl;h=951bce515780c73bce59bd7d344d93ca91e72fc3;hb=fa7fc7eeb3ca718914affee06c0629a08d571288;hp=46e32fabc55a63afe7a3a8c38ad76333c9c2339b;hpb=c102d51f8d6b29354bdf86c75e5f011e20ec4abd;p=kivitendo-erp.git diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 46e32fabc..951bce515 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -58,6 +58,10 @@ sub add { $main::auth->assert('vendor_invoice_edit'); + if (!$::instance_conf->get_allow_new_purchase_invoice) { + $::form->show_generic_error($::locale->text("You do not have the permissions to access this function.")); + } + return $main::lxdebug->leave_sub() if (load_draft_maybe()); $form->{title} = $locale->text('Record Vendor Invoice'); @@ -269,8 +273,8 @@ sub form_header { "departments" => "all_departments", "price_factors" => "ALL_PRICE_FACTORS"); - $TMPL_VAR{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{employee_id}, deleted => 0 ] ]); - $TMPL_VAR{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all(query => [ + $TMPL_VAR{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ or => [ id => $::form->{employee_id}, deleted => 0 ] ]); + $TMPL_VAR{ALL_CONTACTS} = SL::DB::Manager::Contact->get_all_sorted(query => [ or => [ cp_cv_id => $::form->{"$::form->{vc}_id"} * 1, and => [ @@ -327,10 +331,12 @@ sub form_header { max_dunning_level dunning_amount shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax shiptoemail shiptodepartment_1 shiptodepartment_2 message email subject cc bcc taxaccounts cursor_fokus - convert_from_do_ids convert_from_oe_ids show_details + convert_from_do_ids convert_from_oe_ids show_details gldate ), @custom_hiddens, map { $_.'_rate', $_.'_description', $_.'_taxnumber' } split / /, $form->{taxaccounts}]; + $::request->{layout}->use_javascript(map { "${_}.js" } qw(kivi.SalesPurchase ckeditor/ckeditor ckeditor/adapters/jquery)); + $form->header(); print $form->parse_html_template("ir/form_header", \%TMPL_VAR);