X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fir.pl;h=e6f035d01fbe3fddc91be1fc9a375e2103bccf11;hb=b5157f97d47413e5f33cced1d0de527979ff3d61;hp=1b99f5fb53b8ff45b29141d50d9493624d6924a5;hpb=82c784869fbfc8a746a0ee0662947f189f021993;p=kivitendo-erp.git
diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl
index 1b99f5fb5..e6f035d01 100644
--- a/bin/mozilla/ir.pl
+++ b/bin/mozilla/ir.pl
@@ -32,10 +32,13 @@
#======================================================================
use SL::IR;
+use SL::IS;
use SL::PE;
-require "$form->{path}/io.pl";
-require "$form->{path}/arap.pl";
+require "bin/mozilla/io.pl";
+require "bin/mozilla/arap.pl";
+require "bin/mozilla/common.pl";
+require "bin/mozilla/drafts.pl";
1;
@@ -44,6 +47,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;
@@ -55,7 +60,11 @@ 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;
@@ -111,11 +120,6 @@ 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} .=
- "";
- }
-
- }
- } else {
- $form->{selecttaxzone} =~ s/ selected//g;
- if ($form->{taxzone_id} ne "") {
- $form->{selecttaxzone} =~ s/value=$form->{taxzone_id}/value=$form->{taxzone_id} selected/;
- }
+ NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values,
+ '-labels' => \%labels, '-default' => $form->{"cp_id"}));
+
+ %labels = ();
+ @values = ("");
+ foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
+ push(@values, $item->{"id"});
+ $labels{$item->{"id"}} = $item->{"projectnumber"};
+ }
+ my $globalprojectnumber =
+ NTI($cgi->popup_menu('-name' => 'globalproject_id', '-values' => \@values,
+ '-labels' => \%labels,
+ '-default' => $form->{"globalproject_id"}));
+
+ %labels = ();
+ @values = ();
+ my $i = 0;
+ foreach my $item (@{ $form->{"ALL_CURRENCIES"} }) {
+ push(@values, $item);
+ $labels{$item} = $item;
+ }
+
+ $form->{currency} = $form->{defaultcurrency} unless $form->{currency};
+ my $currencies = qq|
+
+ | . $locale->text('Currency') . qq| |
+ | .
+ NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"},
+ '-values' => \@values, '-labels' => \%labels)) . qq|
+ |
+
|;
+
+ %labels = ();
+ @values = ();
+ my $i = 0;
+ foreach my $item (@{ $form->{"ALL_SALESMEN"} }) {
+ push(@values, $item->{"id"});
+ $labels{$item->{"id"}} = $item->{"name"};
+ }
+ my $employees = qq|
+
+ | . $locale->text('Employee') . qq| |
+ | .
+ NTI($cgi->popup_menu('-name' => 'employee_id', '-default' => $form->{"employee_id"},
+ '-values' => \@values, '-labels' => \%labels)) . qq|
+ |
+
|;
+
+ %labels = ();
+ @values = ();
+ my $i = 0;
+ foreach my $item (@{ $form->{"ALL_VENDORS"} }) {
+ push(@values, $item->{name}.qq|--|.$item->{"id"});
+ $labels{$item->{"id"}} = $item->{"name"}.qq|--|.$item->{"id"};
+ }
+ my $vendors = qq|
+ | . $locale->text('Vendor') . qq| |
+ | .
+ NTI($cgi->popup_menu('-name' => 'vendor', '-default' => $form->{"vendor"},
+ '-onChange' => 'document.getElementById(\'update_button\').click();',
+ '-values' => \@values, '-labels' => \%labels)) . qq|
+ | |;
+
+ %labels = ();
+ @values = ();
+ foreach my $item (@{ $form->{"ALL_TAXZONES"} }) {
+ push(@values, $item->{"id"});
+ $labels{$item->{"id"}} = $item->{"description"};
}
- $taxzone = qq|
-
- | . $locale->text('Steuersatz') . qq| |
- |
-
-
|;
-
-
+ if (!$form->{"id"}) {
+ $taxzone = qq|
+
+ | . $locale->text('Steuersatz') . qq| |
+ | .
+ NTI($cgi->popup_menu('-name' => 'taxzone_id', '-default' => $form->{"taxzone_id"},
+ '-values' => \@values, '-labels' => \%labels)) . qq|
+ |
+
|;
- $vendor =
- ($form->{selectvendor})
- ? qq|\n|
- : qq||;
+ } else {
+ $taxzone = qq|
+
+ | . $locale->text('Steuersatz') . qq| |
+
+
+ | . H($labels{$form->{"taxzone_id"}}) . qq|
+ |
+
|;
+ }
$department = qq|
| . $locale->text('Department') . qq| |
-
-
+ |
+
|
| if $form->{selectdepartment};
@@ -323,12 +396,12 @@ sub form_header {
# with JavaScript Calendar
$button1 = qq|
- {invdate}> |
+ |
text('button') . qq|> |
|;
$button2 = qq|
- {duedate}> |
+ |
text('button') . qq|> |
|;
@@ -341,12 +414,13 @@ sub form_header {
# without JavaScript Calendar
$button1 =
- qq|{invdate}> | |;
+ qq| | |;
$button2 =
- qq|{duedate}> | |;
+ qq| | |;
}
$form->{"javascript"} .= qq||;
+ $form->{"javascript"} .= qq||;
$jsscript .=
$form->write_trigger(\%myconfig, 2,
@@ -354,9 +428,11 @@ sub form_header {
"quodate", "BL", "trigger_quodate");
$form->header;
-
+ $onload = qq|focus()|;
+ $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
+ $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
print qq|
-
+