X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=f08daabfde2218e79c95bc7b3327eae3faa28aa2;hb=2fda509c7dc417aad28ed072e91e8ffe2396314d;hp=e076691a1b326263f13d93e0606ddbc42ec78d2c;hpb=d629acd82a27e980899a044ca8b0f4becc8e94bb;p=kivitendo-erp.git
diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl
index e076691a1..f08daabfd 100644
--- a/bin/mozilla/oe.pl
+++ b/bin/mozilla/oe.pl
@@ -254,14 +254,6 @@ sub order_links {
(@{ $form->{"all_$form->{vc}"} });
}
- # currencies
- @curr = split(/:/, $form->{currencies});
- chomp $curr[0];
- $form->{defaultcurrency} = $curr[0];
- $form->{currency} = $form->{defaultcurrency} unless $form->{currency};
-
- map { $form->{selectcurrency} .= "\n" } @curr;
-
$form->{taxincluded} = $taxincluded if ($form->{id});
# departments
@@ -277,13 +269,6 @@ sub order_links {
$form->{employee} = "$form->{employee}--$form->{employee_id}";
- # sales staff
- if (@{ $form->{all_employees} }) {
- $form->{selectemployee} = "";
- map { $form->{selectemployee} .= "\n" }
- (@{ $form->{all_employees} });
- }
-
# forex
$form->{forex} = $form->{exchangerate};
@@ -361,12 +346,12 @@ sub form_header {
# with JavaScript Calendar
$button1 = qq|
-
{transdate} onBlur=\"check_right_date_format(this)\"> |
+ |
text('button') . qq|> |
|;
$button2 = qq|
- {reqdate} onBlur=\"check_right_date_format(this)\"> |
+ |
text('button') . qq|> |
|;
@@ -380,9 +365,9 @@ sub form_header {
# without JavaScript Calendar
$button1 = qq|
- {transdate} onBlur=\"check_right_date_format(this)\"> | |;
+ | |;
$button2 = qq|
- {reqdate} onBlur=\"check_right_date_format(this)\"> | |;
+ | |;
}
my @tmp;
@@ -410,7 +395,7 @@ sub form_header {
}
# set option selected
- foreach $item ($form->{vc}, currency, department, employee) {
+ foreach $item ($form->{vc}, currency, department, employee, ($form->{vc} eq "customer" ? customer : vendor)) {
$form->{"select$item"} =~ s/ selected//;
$form->{"select$item"} =~
s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
@@ -432,8 +417,12 @@ sub form_header {
"all" => 0,
"old_id" => \@old_project_ids },
"employees" => "ALL_SALESMEN",
- "taxzones" => "ALL_TAXZONES");
-
+ "taxzones" => "ALL_TAXZONES",
+ "currencies" => "ALL_CURRENCIES");
+ ($form->{vc} eq "customer"
+ ? $form->get_lists("customers" => "ALL_CUSTOMERS")
+ : $form->get_lists("vendors" => "ALL_VENDORS"));
+
my %labels;
my @values = (undef);
foreach my $item (@{ $form->{"ALL_CONTACTS"} }) {
@@ -445,6 +434,25 @@ sub form_header {
NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values,
'-labels' => \%labels, '-default' => $form->{"cp_id"}));
+ %labels = ();
+ @values = ();
+
+ foreach my $item (@{ $form->{($form->{vc} eq "customer" ? "ALL_CUSTOMERS" : "ALL_VENDORS")}}) {
+ push(@values, $item->{name}.qq|--|.$item->{"id"});
+ $labels{$item->{"id"}} = $item->{name}.qq|--|.$item->{"id"};
+ }
+
+ my $vc = qq|
+ | . $locale->text(ucfirst($form->{vc})) . qq| |
+ | .
+ (($myconfig{vclimit} == 1 )
+ ? qq||
+ : (NTI($cgi->popup_menu('-name' => "$form->{vc}", '-default' => $form->{"old$form->{vc}"},
+ '-onChange' => 'document.getElementById(\'update_button\').click();',
+ '-values' => \@values, '-labels' => \%labels)))) . qq|
+ | {vc}"}) . qq|">|;
+
%labels = ();
@values = ("");
foreach my $item (@{ $form->{"ALL_SHIPTO"} }) {
@@ -490,6 +498,21 @@ sub form_header {
|;
}
+ %labels = ();
+ @values = ();
+ 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', '-default' => $form->{"employee"},
+ '-values' => \@values, '-labels' => \%labels)) . qq|
+ |
+
|;
%labels = ();
@values = ();
@@ -507,6 +530,25 @@ sub form_header {
|;
+ %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|
+ |
+
|;
+
+
$form->{exchangerate} =
$form->format_amount(\%myconfig, $form->{exchangerate});
@@ -541,11 +583,6 @@ sub form_header {
}
}
- $vclabel = ucfirst $form->{vc};
- $vclabel = $locale->text($vclabel);
-
-
-
if ($form->{business}) {
$business = qq|
@@ -665,48 +702,25 @@ sub form_header {
|;
}
- $vc =
- ($form->{"select$form->{vc}"})
- ? qq|\n{vc}"}) . qq|">|
- : qq|{vc} value="$form->{$form->{vc}}" size=35>|;
-
$department = qq|
| . $locale->text('Department') . qq| |
|
-
-| if $form->{selectdepartment};
-
- $employee = qq|
-
-|;
+ | if $form->{selectdepartment};
if ($form->{type} eq 'sales_order') {
if ($form->{selectemployee}) {
$employee = qq|
{customer_klass}>
-
- | . $locale->text('Employee') . qq| |
- |
-
- |
-
+ $employees
|;
}
} else {
$employee = qq|
{customer_klass}>
-
- | . $locale->text('Employee') . qq| |
- |
-
- |
-
+ $employees
|;
}
if ($form->{resubmit} && ($form->{format} eq "html")) {
@@ -778,10 +792,7 @@ onchange="document.getElementById('update_button').click();">| .
- $vclabel |
- $vc |
- {vc}_id value=$form->{"$form->{vc}_id"}>
- {vc}"}">
+ $vc
|
. $locale->text('Contact Person') . qq| |
$contact |
@@ -792,10 +803,7 @@ onchange="document.getElementById('update_button').click();">| .
$taxzone
$department
- | . $locale->text('Currency') . qq| |
- |
-
- {defaultcurrency}>
+ $currencies
$exchangerate
@@ -805,7 +813,11 @@ onchange="document.getElementById('update_button').click();">| .
| . $locale->text('Ship via') . qq| |
|
- |;
+
+
+ | . $locale->text('Transaction description') . qq| |
+ |
+ |;
#
#
#
@@ -1341,20 +1353,6 @@ sub search {
$form->all_vc(\%myconfig, $form->{vc},
($form->{vc} eq 'customer') ? "AR" : "AP");
- map { $vc .= "\n" }
- @{ $form->{"all_$form->{vc}"} };
-
- $vclabel = ucfirst $form->{vc};
- $vclabel = $locale->text($vclabel);
-
- # $locale->text('Vendor')
- # $locale->text('Customer')
-
- $vc =
- ($vc)
- ? qq||
- : qq|{vc} size=35>|;
-
# departments
if (@{ $form->{all_departments} }) {
$form->{selectdepartment} = " | |