X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fir.pl;h=c535bcfec926aef54e9aa3f816a2a8396d020c83;hb=f087c3736d8c707c18cb3ea87692995940361057;hp=143696311499868152f9b9a5402f150cc4a64e16;hpb=4486e3bc8eb00c37cf8029e663eb94b4b9c5346a;p=kivitendo-erp.git diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 143696311..c535bcfec 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'); @@ -101,8 +105,7 @@ sub invoice_links { $form->{vc} = 'vendor'; # create links - $form->{webdav} = $::lx_office_conf{features}->{webdav}; - $form->{jsscript} = 1; + $form->{webdav} = $::instance_conf->get_webdav; $form->create_links("AP", \%myconfig, "vendor"); @@ -117,39 +120,16 @@ sub invoice_links { } } - my ($payment_id, $language_id, $taxzone_id, $currency); - if ($form->{payment_id}) { - $payment_id = $form->{payment_id}; - } - if ($form->{language_id}) { - $language_id = $form->{language_id}; - } - if ($form->{taxzone_id}) { - $taxzone_id = $form->{taxzone_id}; - } - if ($form->{currency}) { - $currency = $form->{currency}; - } + $form->backup_vars(qw(payment_id language_id taxzone_id + currency delivery_term_id intnotes cp_id)); - my $cp_id = $form->{cp_id}; IR->get_vendor(\%myconfig, \%$form); IR->retrieve_invoice(\%myconfig, \%$form); - $form->{cp_id} = $cp_id; - if ($payment_id) { - $form->{payment_id} = $payment_id; - } - if ($language_id) { - $form->{language_id} = $language_id; - } - if ($taxzone_id) { - $form->{taxzone_id} = $taxzone_id; - } - if ($currency) { - $form->{currency} = $currency; - } + $form->restore_vars(qw(payment_id language_id taxzone_id + currency delivery_term_id intnotes cp_id)); - my @curr = split(/:/, $form->{currencies}); #seems to be missing + my @curr = $form->get_all_currencies(); map { $form->{selectcurrency} .= "