X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fir.pl;h=f4345c1fe1cf3dc549a6531fee8638aae2b47e7b;hb=ab1df08bfae3ef3361c7b5e4e16d91ae3cb34961;hp=a9b8aeeea6908ed5ee02e7db8ac138b205587dd9;hpb=5563e1162d014b09d591fd68e5317ebbb2212148;p=kivitendo-erp.git diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index a9b8aeeea..f4345c1fe 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -32,10 +32,15 @@ #====================================================================== use SL::IR; +use SL::IS; use SL::PE; +use List::Util qw(max); -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 +49,8 @@ require "$form->{path}/arap.pl"; sub add { $lxdebug->enter_sub(); + return $lxdebug->leave_sub() if (load_draft_maybe()); + $form->{title} = $locale->text('Add Vendor Invoice'); &invoice_links; @@ -56,6 +63,10 @@ sub add { sub edit { $lxdebug->enter_sub(); + # show history button + $form->{javascript} = qq||; + #/show hhistory button + $form->{title} = $locale->text('Edit Vendor Invoice'); &invoice_links; @@ -69,13 +80,16 @@ sub invoice_links { $lxdebug->enter_sub(); # create links - $form->{webdav} = $webdav; - - # set jscalendar - $form->{jscalendar} = $jscalendar; + $form->{webdav} = $webdav; + $form->{jsscript} = 1; $form->create_links("AP", \%myconfig, "vendor"); + #quote all_vendor Bug 133 + foreach $ref (@{ $form->{all_vendor} }) { + $ref->{name} = $form->quote($ref->{name}); + } + if ($form->{all_vendor}) { unless ($form->{vendor_id}) { $form->{vendor_id} = $form->{all_vendor}->[0]->{id}; @@ -106,22 +120,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} =~ /