X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=0a2c93d8de5b753a1c6ca46eda3b2f770e3e6cf1;hb=f6124ea6b4ad154625d1fbce3485884e5f2ce82c;hp=6c7cb6569dfeb6de5731215c107013d56fde25d5;hpb=01a6bf1b55f003fb6f15a70acf51d3e921af7244;p=kivitendo-erp.git
diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl
index 6c7cb6569..0a2c93d8d 100644
--- a/bin/mozilla/oe.pl
+++ b/bin/mozilla/oe.pl
@@ -157,7 +157,6 @@ sub edit {
sub order_links {
$lxdebug->enter_sub();
-
# get customer/vendor
$form->all_vc(\%myconfig, $form->{vc},
($form->{vc} eq 'customer') ? "AR" : "AP");
@@ -231,6 +230,7 @@ sub order_links {
}
$form->{cp_id} = $cp_id;
+
if ($payment_id) {
$form->{payment_id} = $payment_id;
}
@@ -269,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};
@@ -341,14 +334,6 @@ sub form_header {
$form->{jsscript} = $form->{jscalendar};
$jsscript = "";
- $payment = qq||;
- foreach $item (@{ $form->{payment_terms} }) {
- if ($form->{payment_id} eq $item->{id}) {
- $payment .= qq||;
- } else {
- $payment .= qq||;
- }
- }
if ($form->{jsscript}) {
# with JavaScript Calendar
@@ -372,9 +357,9 @@ sub form_header {
# without JavaScript Calendar
$button1 = qq|
-
| |;
+ | |;
$button2 = qq|
- | |;
+ | |;
}
my @tmp;
@@ -402,7 +387,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}/;
@@ -425,8 +410,12 @@ sub form_header {
"old_id" => \@old_project_ids },
"employees" => "ALL_SALESMEN",
"taxzones" => "ALL_TAXZONES",
+ "payments" => "ALL_PAYMENTS",
"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"} }) {
@@ -438,6 +427,40 @@ 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|
+ {vc}"}) . qq|">
+ | . $locale->text(ucfirst($form->{vc})) . qq| |
+ | .
+ (($myconfig{vclimit} <= scalar(@values))
+ ? qq|{vc}"}) . qq|" name="$form->{vc}">|
+ : (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_PAYMENTS"} }) {
+ push(@values, $item->{"id"});
+ $labels{$item->{"id"}} = $item->{"description"};
+ }
+
+ $payments = qq|
+ | . $locale->text('Payment Terms') . qq| |
+ | .
+ NTI($cgi->popup_menu('-name' => 'payment_id', '-values' => \@values,
+ '-labels' => \%labels, '-default' => $form->{payment_id}))
+ . qq| | |;
+
%labels = ();
@values = ("");
foreach my $item (@{ $form->{"ALL_SHIPTO"} }) {
@@ -483,6 +506,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 = ();
@@ -553,11 +591,6 @@ sub form_header {
}
}
- $vclabel = ucfirst $form->{vc};
- $vclabel = $locale->text($vclabel);
-
-
-
if ($form->{business}) {
$business = qq|
@@ -677,48 +710,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")) {
@@ -790,10 +800,7 @@ onchange="document.getElementById('update_button').click();">| .
|
$taxincluded
@@ -1181,9 +1192,17 @@ sub update {
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
qw(exchangerate creditlimit creditremaining);
$form->{update} = 1;
-
+
+ if($form->{payment_id}) {
+ $payment_id = $form->{payment_id};
+ }
+
&check_name($form->{vc});
-
+
+ if($form->{payment_id} eq "") {
+ $form->{payment_id} = $payment_id;
+ }
+
$buysell = 'buy';
$buysell = 'sell' if ($form->{vc} eq 'vendor');
$form->{exchangerate} = $exchangerate
@@ -1350,20 +1369,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} = " |