X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fir.pl;h=440ee6e4064035e56fc3e861e193bd141c86a143;hb=703f76b624a9c447bf77e40db2cd3d5f3cc19e51;hp=03f377d2490f6f9adcb4a294db76f8242af9ec35;hpb=9e117fbd2bb27c58831580608cd63f85c82487ac;p=kivitendo-erp.git
diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl
index 03f377d24..440ee6e40 100644
--- a/bin/mozilla/ir.pl
+++ b/bin/mozilla/ir.pl
@@ -31,11 +31,17 @@
#
#======================================================================
+use SL::FU;
use SL::IR;
+use SL::IS;
use SL::PE;
+use List::Util qw(max sum);
-require "$form->{path}/io.pl";
-require "$form->{path}/arap.pl";
+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";
1;
@@ -44,6 +50,10 @@ require "$form->{path}/arap.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');
&invoice_links;
@@ -56,6 +66,12 @@ 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;
@@ -68,11 +84,11 @@ sub edit {
sub invoice_links {
$lxdebug->enter_sub();
- # create links
- $form->{webdav} = $webdav;
+ $auth->assert('vendor_invoice_edit');
- # set jscalendar
- $form->{jscalendar} = $jscalendar;
+ # create links
+ $form->{webdav} = $webdav;
+ $form->{jsscript} = 1;
$form->create_links("AP", \%myconfig, "vendor");
@@ -100,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;
}
@@ -111,22 +127,10 @@ sub invoice_links {
$form->{taxzone_id} = $taxzone_id;
}
- # currencies
- @curr = split /:/, $form->{currencies};
- chomp $curr[0];
- $form->{defaultcurrency} = $curr[0];
-
map { $form->{selectcurrency} .= "";
- } else {
- $form->{selecttaxzone} .=
- "";
- }
+ my $contact;
+ if (scalar @values > 1) {
+ $contact = qq|
+
+ | . $locale->text('Contact Person') . qq| |
+ | . NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values, '-style' => 'width: 250px',
+ '-labels' => \%labels, '-default' => $form->{"cp_id"})) . qq|
+ |
+
|;
+ }
- }
- } else {
- $form->{selecttaxzone} =~ s/ selected//g;
- if ($form->{taxzone_id} ne "") {
- $form->{selecttaxzone} =~ s/value=$form->{taxzone_id}/value=$form->{taxzone_id} selected/;
- }
+ %labels = ();
+ @values = ("");
+ foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
+ push(@values, $item->{"id"});
+ $labels{$item->{"id"}} = $item->{"projectnumber"};
}
- if ($form->{rowcount} >1) {
- $form->{selecttaxzone} =~ /