X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/d52e2ffc5a084a39f3442311bc8c02b114aa128a..7679dfa4ba64c4cc24a027fa5bdfd5e616ca92a8:/bin/mozilla/oe.pl
diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl
index 640fb37e5..b5cd79d63 100644
--- a/bin/mozilla/oe.pl
+++ b/bin/mozilla/oe.pl
@@ -403,6 +403,7 @@ sub form_header {
map({ push(@old_project_ids, $form->{"project_id_$_"})
if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"}));
+ my $vc = $form->{vc} eq "customer" ? "customers" : "vendors";
$form->get_lists("contacts" => "ALL_CONTACTS",
"shipto" => "ALL_SHIPTO",
"projects" => { "key" => "ALL_PROJECTS",
@@ -411,11 +412,9 @@ sub form_header {
"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"));
-
+ "currencies" => "ALL_CURRENCIES",
+ $vc => "ALL_" . uc($vc));
+
my %labels;
my @values = (undef);
foreach my $item (@{ $form->{"ALL_CONTACTS"} }) {
@@ -435,11 +434,13 @@ sub form_header {
$labels{$item->{"id"}} = $item->{name}.qq|--|.$item->{"id"};
}
- my $vc = qq|
+ $vc = qq|
+ {vc}_id"}) . qq|">
+ {vc}"}) . qq|">
| . $locale->text(ucfirst($form->{vc})) . qq| |
| .
- (($myconfig{vclimit} == 1 )
- ? 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|
@@ -1428,8 +1429,11 @@ sub search {
| | |;
}
+ my $vc = $form->{vc} eq "customer" ? "customers" : "vendors";
+
$form->get_lists("projects" => { "key" => "ALL_PROJECTS",
- "all" => 1 });
+ "all" => 1 },
+ $vc => "ALL_" . uc($vc));
my %labels = ();
my @values = ("");
@@ -1441,6 +1445,24 @@ sub search {
NTI($cgi->popup_menu('-name' => 'project_id', '-values' => \@values,
'-labels' => \%labels));
+ %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_label = $form->{vc} eq "customer" ? $locale->text('Customer') : $locale->text('Vendor');
+ $vc =
+ $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));
+
$form->header;
print qq|
@@ -1457,7 +1479,8 @@ sub search {
- $vc
+ | $vc_label |
+ $vc |
$department
@@ -1556,12 +1579,6 @@ $jsscript
sub orders {
$lxdebug->enter_sub();
- # split vendor / customer
- ($form->{ $form->{vc} }, $form->{"$form->{vc}_id"}) =
- split(/--/, $form->{ $form->{vc} });
-
- OE->transactions(\%myconfig, \%$form);
-
$ordnumber = ($form->{type} =~ /_order$/) ? "ordnumber" : "quonumber";
# construct href
@@ -1569,11 +1586,18 @@ sub orders {
qw(type vc login password transdatefrom transdateto
open closed notdelivered delivered department
transaction_description);
+ push @fields, $form->{vc};
$href = "$form->{script}?action=orders&"
. join("&", map { "${_}=" . E($form->{$_}) } @fields)
. "&${ordnumber}=" . E($form->{$ordnumber});
$callback = $href;
+ # split vendor / customer
+ ($form->{ $form->{vc} }, $form->{"$form->{vc}_id"}) =
+ split(/--/, $form->{ $form->{vc} });
+
+ OE->transactions(\%myconfig, \%$form);
+
@columns = (
"transdate", "reqdate",
"id", "$ordnumber",
@@ -1927,6 +1951,10 @@ sub save_and_close {
$form->isblank("transdate", $locale->text('Quotation Date missing!'));
}
+ my $idx = $form->{type} =~ /_quotation$/ ? "quonumber" : "ordnumber";
+ $form->{$idx} =~ s/^\s*//g;
+ $form->{$idx} =~ s/\s*$//g;
+
$msg = ucfirst $form->{vc};
$form->isblank($form->{vc}, $locale->text($msg . " missing!"));
@@ -2018,6 +2046,10 @@ sub save {
$form->isblank("transdate", $locale->text('Quotation Date missing!'));
}
+ my $idx = $form->{type} =~ /_quotation$/ ? "quonumber" : "ordnumber";
+ $form->{$idx} =~ s/^\s*//g;
+ $form->{$idx} =~ s/\s*$//g;
+
$msg = ucfirst $form->{vc};
$form->isblank($form->{vc}, $locale->text($msg . " missing!"));
@@ -2495,6 +2527,8 @@ sub save_as_new {
# Let Lx-Office assign a new order number if the user hasn't changed the
# previous one. If it has been changed manually then use it as-is.
my $idx = $form->{type} =~ /_quotation$/ ? "quonumber" : "ordnumber";
+ $form->{$idx} =~ s/^\s*//g;
+ $form->{$idx} =~ s/\s*$//g;
if ($form->{saved_xyznumber} &&
($form->{saved_xyznumber} eq $form->{$idx})) {
delete($form->{$idx});
|