X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fir.pl;h=c5f137f99f7606d29c1483ff0e52cd5e0be41d0a;hb=4c6e9282cff83ba335a03e39536df3fa7b3b2101;hp=2ace9a7b434c58c380b4e810f8846f4376b0887b;hpb=7edc9f8c5eeec5fd24ccd709efa62f928ab66350;p=kivitendo-erp.git
diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl
index 2ace9a7b4..c5f137f99 100644
--- a/bin/mozilla/ir.pl
+++ b/bin/mozilla/ir.pl
@@ -35,13 +35,14 @@ use SL::FU;
use SL::IR;
use SL::IS;
use SL::PE;
+use SL::DB::Default;
+use SL::DB::PurchaseInvoice;
use List::Util qw(max sum);
+use List::UtilsBy qw(sort_by);
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";
use strict;
@@ -57,7 +58,11 @@ sub add {
$main::auth->assert('vendor_invoice_edit');
- return $main::lxdebug->leave_sub() if (load_draft_maybe());
+ if (!$::instance_conf->get_allow_new_purchase_invoice) {
+ $::form->show_generic_error($::locale->text("You do not have the permissions to access this function."));
+ }
+
+ $form->{show_details} = $::myconfig{show_form_details};
$form->{title} = $locale->text('Record Vendor Invoice');
@@ -76,6 +81,8 @@ sub edit {
$main::auth->assert('vendor_invoice_edit');
+ $form->{show_details} = $::myconfig{show_form_details};
+
# show history button
$form->{javascript} = qq||;
#/show hhistory button
@@ -100,9 +107,6 @@ sub invoice_links {
$form->{vc} = 'vendor';
# create links
- $form->{webdav} = $::lx_office_conf{features}->{webdav};
- $form->{jsscript} = 1;
-
$form->create_links("AP", \%myconfig, "vendor");
#quote all_vendor Bug 133
@@ -116,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} .= "