X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fir.pl;h=9cdb6d7d995ad581acfa6baa876991a13ca0f2f9;hb=8b5efb772c54921ce86998882177cf2f75d3d493;hp=7e610f3e5bf2ef9bfbe7b1c3edce8f2d7dda7572;hpb=3138b5c71a57c5cf7ce31a96432563f663063c22;p=kivitendo-erp.git
diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl
index 7e610f3e5..9cdb6d7d9 100644
--- a/bin/mozilla/ir.pl
+++ b/bin/mozilla/ir.pl
@@ -34,6 +34,7 @@
use SL::IR;
use SL::IS;
use SL::PE;
+use List::Util qw(max);
require "bin/mozilla/io.pl";
require "bin/mozilla/arap.pl";
@@ -46,7 +47,6 @@ require "bin/mozilla/drafts.pl";
sub add {
$lxdebug->enter_sub();
- $form->{"Watchdog::invdate,duedate,vendor,vendor_id"} = 1;
return $lxdebug->leave_sub() if (load_draft_maybe());
@@ -217,70 +217,46 @@ sub form_header {
# set option selected
foreach $item (qw(AP vendor currency department)) {
$form->{"select$item"} =~ s/ selected//;
- $form->{"select$item"} =~
- s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
- }
-
- if ($form->{old_employee_id}) {
- $form->{employee_id} = $form->{old_employee_id};
- }
- if ($form->{old_salesman_id}) {
- $form->{salesman_id} = $form->{old_salesman_id};
+ $form->{"select$item"} =~ s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
}
+ $form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id};
+ $form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id};
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
-
-
- $form->{radier} =
- ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0;
-
- $form->{exchangerate} =
- $form->format_amount(\%myconfig, $form->{exchangerate});
-
- $form->{creditlimit} =
- $form->format_amount(\%myconfig, $form->{creditlimit}, 0, "0");
- $form->{creditremaining} =
- $form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0");
+ $form->{radier} = ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0;
+ $form->{exchangerate} = $form->format_amount(\%myconfig, $form->{exchangerate});
+ $form->{creditlimit} = $form->format_amount(\%myconfig, $form->{creditlimit}, 0, "0");
+ $form->{creditremaining} = $form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0");
$exchangerate = "";
if ($form->{currency} ne $form->{defaultcurrency}) {
if ($form->{forex}) {
- $exchangerate .= qq|
-
|
- . $locale->text('Exchangerate') . qq| |
- $form->{exchangerate}{exchangerate}> |
-|;
+ $exchangerate .= qq| | . $locale->text('Exchangerate') . qq| |
+ $form->{exchangerate}{exchangerate}> | \n|;
} else {
- $exchangerate .= qq|
- |
- . $locale->text('Exchangerate') . qq| |
- {exchangerate}> |
-|;
+ $exchangerate .= qq| | . $locale->text('Exchangerate') . qq| |
+ {exchangerate}> | \n|;
}
}
- $exchangerate .= qq|
-{forex}>
-|;
+ $exchangerate .= qq| {forex}>\n|;
my @old_project_ids = ($form->{"globalproject_id"});
- map({ push(@old_project_ids, $form->{"project_id_$_"})
- if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"}));
-
- $form->get_lists("contacts" => "ALL_CONTACTS",
- "projects" => { "key" => "ALL_PROJECTS",
- "all" => 0,
- "old_id" => \@old_project_ids },
- "taxzones" => "ALL_TAXZONES",
- "employees" => "ALL_SALESMEN",
+ map { push @old_project_ids, $form->{"project_id_$_"} if $form->{"project_id_$_"}; } 1..$form->{"rowcount"};
+
+ $form->get_lists("contacts" => "ALL_CONTACTS",
+ "projects" => { "key" => "ALL_PROJECTS",
+ "all" => 0,
+ "old_id" => \@old_project_ids },
+ "taxzones" => "ALL_TAXZONES",
+ "employees" => "ALL_SALESMEN",
"currencies" => "ALL_CURRENCIES",
- "vendors" => "ALL_VENDORS");
+ "vendors" => "ALL_VENDORS");
my %labels;
my @values = (undef);
foreach my $item (@{ $form->{"ALL_CONTACTS"} }) {
push(@values, $item->{"cp_id"});
- $labels{$item->{"cp_id"}} = $item->{"cp_name"} .
- ($item->{"cp_abteilung"} ? " ($item->{cp_abteilung})" : "");
+ $labels{$item->{"cp_id"}} = $item->{"cp_name"} . ($item->{"cp_abteilung"} ? " ($item->{cp_abteilung})" : "");
}
my $contact;
@@ -288,10 +264,8 @@ sub form_header {
$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|
+ | | . NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values, '-style' => 'width: 250px',
+ '-labels' => \%labels, '-default' => $form->{"cp_id"})) . qq|
|
|;
}
@@ -302,10 +276,8 @@ sub form_header {
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"}));
+ my $globalprojectnumber = NTI($cgi->popup_menu('-name' => 'globalproject_id', '-values' => \@values, '-labels' => \%labels,
+ '-default' => $form->{"globalproject_id"}));
%labels = ();
@values = ();
@@ -321,9 +293,8 @@ sub form_header {
$currencies = qq|
| . $locale->text('Currency') . qq| |
- | .
- NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"},
- '-values' => \@values, '-labels' => \%labels)) . qq|
+ | | . NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"},
+ '-values' => \@values, '-labels' => \%labels)) . qq|
|
|;
}
@@ -336,13 +307,12 @@ sub form_header {
$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|
+ | | . NTI($cgi->popup_menu('-name' => 'employee_id', '-default' => $form->{"employee_id"},
+ '-values' => \@values, '-labels' => \%labels)) . qq|
|
-
|;
+ |;
%labels = ();
@values = ();
@@ -360,8 +330,8 @@ sub form_header {
(($myconfig{vclimit} <= scalar(@values))
? qq||
: (NTI($cgi->popup_menu('-name' => 'vendor', '-default' => $form->{oldvendor},
- '-onChange' => 'document.getElementById(\'update_button\').click();',
- '-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px')))) . qq|
+ '-onChange' => 'document.getElementById(\'update_button\').click();',
+ '-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px')))) . qq|
|;
@@ -376,12 +346,10 @@ sub form_header {
$taxzone = qq|
| . $locale->text('Steuersatz') . qq| |
- | .
- NTI($cgi->popup_menu('-name' => 'taxzone_id', '-default' => $form->{"taxzone_id"},
- '-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px')) . qq|
+ | | . NTI($cgi->popup_menu('-name' => 'taxzone_id', '-default' => $form->{"taxzone_id"},
+ '-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px')) . qq|
|
|;
-
} else {
$taxzone = qq|
@@ -394,13 +362,12 @@ sub form_header {
}
$department = qq|
-
+
| . $locale->text('Department') . qq| |
|
-
-| if $form->{selectdepartment};
+ \n| if $form->{selectdepartment};
$n = ($form->{creditremaining} =~ /-/) ? "0" : "1";
@@ -410,31 +377,25 @@ sub form_header {
$button1 = qq|
- text('button') . qq|> |
- |;
+ text('button') . qq|>\n|;
$button2 = qq|
- text('button') . qq|> |
- |;
+ text('button') . qq|>\n|;
#write Trigger
$jsscript =
- Form->write_trigger(\%myconfig, "2", "invdate", "BL", "trigger1",
+ Form->write_trigger(\%myconfig, "2",
+ "invdate", "BL", "trigger1",
"duedate", "BL", "trigger2");
- $form->{"javascript"} .= qq||;
- $form->{"javascript"} .= qq||;
- $form->{javascript} .= qq||;
+ $form->{javascript} .= qq||;
+ $form->{javascript} .= qq||;
+ $form->{javascript} .= qq||;
- $jsscript .=
- $form->write_trigger(\%myconfig, 2,
- "orddate", "BL", "trigger_orddate",
- "quodate", "BL", "trigger_quodate");
+ $jsscript .= $form->write_trigger(\%myconfig, 2, "orddate", "BL", "trigger_orddate", "quodate", "BL", "trigger_quodate");
$form->header;
- $onload = qq|focus()|;
+ $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|
@@ -443,9 +404,10 @@ sub form_header {