X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Foe.pl;h=6ee8520c205b614b26a14601143b162818ae66c7;hb=2efc8cbcc63c56094e0692067b7cb678c1583987;hp=b5cd79d636621c7baad5e47d73daca7b742a4c9a;hpb=adc17ef4cd00cdc9d67bba6379f9261339300acd;p=kivitendo-erp.git
diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl
index b5cd79d63..6ee8520c2 100644
--- a/bin/mozilla/oe.pl
+++ b/bin/mozilla/oe.pl
@@ -162,9 +162,8 @@ sub order_links {
($form->{vc} eq 'customer') ? "AR" : "AP");
# retrieve order/quotation
- $form->{webdav} = $webdav;
- # set jscalendar
- $form->{jscalendar} = $jscalendar;
+ $form->{webdav} = $webdav;
+ $form->{jsscript} = 1;
my $editing = $form->{id};
@@ -325,42 +324,37 @@ sub form_header {
my $checkedclosed = $form->{"closed"} ? "checked" : "";
my $checkeddelivered = $form->{"delivered"} ? "checked" : "";
+ if ($form->{old_employee_id}) {
+ $form->{employee_id} = $form->{old_employee_id};
+ }
+ if ($form->{old_salesman_id}) {
+ $form->{salesman_id} = $form->{old_salesman_id};
+ }
+
map { $form->{$_} =~ s/\"/"/g }
qw(ordnumber quonumber shippingpoint shipvia notes intnotes shiptoname
shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact
shiptophone shiptofax shiptodepartment_1 shiptodepartment_2);
# use JavaScript Calendar or not
- $form->{jsscript} = $form->{jscalendar};
+ $form->{jsscript} = 1;
$jsscript = "";
- if ($form->{jsscript}) {
-
- # with JavaScript Calendar
- $button1 = qq|
-
|
- text('button') . qq|> |
- |;
- $button2 = qq|
- |
- text('button') . qq|> |
- |;
-
- #write Trigger
- $jsscript =
- Form->write_trigger(\%myconfig, "2", "transdate", "BL", "trigger1",
- "reqdate", "BL", "trigger2");
-
- } else {
-
- # without JavaScript Calendar
- $button1 = qq|
- | |;
- $button2 = qq|
- | |;
- }
+ $button1 = qq|
+
+ text('button') . qq|> |
+ |;
+ $button2 = qq|
+
+ text('button') . qq|> |
+ |;
+
+ #write Trigger
+ $jsscript =
+ Form->write_trigger(\%myconfig, "2", "transdate", "BL", "trigger1",
+ "reqdate", "BL", "trigger2");
my @tmp;
@@ -387,7 +381,7 @@ sub form_header {
}
# set option selected
- foreach $item ($form->{vc}, currency, department, employee, ($form->{vc} eq "customer" ? customer : vendor)) {
+ foreach $item ($form->{vc}, currency, department, ($form->{vc} eq "customer" ? customer : vendor)) {
$form->{"select$item"} =~ s/ selected//;
$form->{"select$item"} =~
s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
@@ -409,7 +403,8 @@ sub form_header {
"projects" => { "key" => "ALL_PROJECTS",
"all" => 0,
"old_id" => \@old_project_ids },
- "employees" => "ALL_SALESMEN",
+ "employees" => "ALL_EMPLOYEES",
+ "salesmen" => "ALL_SALESMEN",
"taxzones" => "ALL_TAXZONES",
"payments" => "ALL_PAYMENTS",
"currencies" => "ALL_CURRENCIES",
@@ -422,16 +417,26 @@ sub form_header {
$labels{$item->{"cp_id"}} = $item->{"cp_name"} .
($item->{"cp_abteilung"} ? " ($item->{cp_abteilung})" : "");
}
- my $contact =
- NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values,
- '-labels' => \%labels, '-default' => $form->{"cp_id"}));
+
+ my $contact;
+ if (scalar @values > 1) {
+ $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|
+ |
+
|;
+ }
%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"};
+ push(@values, $item->{"name"}.qq|--|.$item->{"id"});
+ $labels{$item->{"name"}.qq|--|.$item->{"id"}} = $item->{name};
}
$vc = qq|
@@ -440,10 +445,11 @@ sub form_header {
| . $locale->text(ucfirst($form->{vc})) . qq| |
| .
(($myconfig{vclimit} <= scalar(@values))
- ? qq|{vc}"}) . qq|" name="$form->{vc}">|
+ ? 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|
+ '-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px')))) . qq|
+
| {vc}"}) . qq|">|;
@@ -457,7 +463,7 @@ sub form_header {
$payments = qq|
| . $locale->text('Payment Terms') . qq| |
| .
- NTI($cgi->popup_menu('-name' => 'payment_id', '-values' => \@values,
+ NTI($cgi->popup_menu('-name' => 'payment_id', '-values' => \@values, '-style' => 'width: 250px',
'-labels' => \%labels, '-default' => $form->{payment_id}))
. qq| | |;
@@ -465,16 +471,19 @@ sub form_header {
@values = ("");
foreach my $item (@{ $form->{"ALL_SHIPTO"} }) {
push(@values, $item->{"shipto_id"});
- $labels{$item->{"shipto_id"}} =
- $item->{"shiptoname"} . " " . $item->{"shiptodepartment_1"};
+ $labels{$item->{"shipto_id"}} = join "; ", grep { $_ } map { $item->{"shipto${_}" } } qw(name department_1 street city);
}
- my $shipto = qq|
- | . $locale->text('Shipping Address') . qq| |
- | .
- NTI($cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values,
- '-labels' => \%labels, '-default' => $form->{"shipto_id"}))
+ my $shipto;
+ if (scalar @values > 1) {
+ $shipto = qq|
+ |
+ | . $locale->text('Shipping Address') . qq| |
+ | .
+ NTI($cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values, '-style' => 'width: 250px',
+ '-labels' => \%labels, '-default' => $form->{"shipto_id"}))
. qq| | |;
+ }
%labels = ();
@values = ("");
@@ -486,21 +495,20 @@ sub form_header {
NTI($cgi->popup_menu('-name' => 'globalproject_id', '-values' => \@values,
'-labels' => \%labels,
'-default' => $form->{"globalproject_id"}));
-
- $salesman = "";
+
+ my $salesmen = "";
+ %labels = ();
+ @values = ();
if ($form->{type} =~ /^sales_/) {
- %labels = ();
- @values = ("");
- foreach my $item (@{ $form->{ALL_SALESMEN} }) {
- push(@values, $item->{id});
- $labels{$item->{id}} = $item->{name} ne "" ? $item->{name} : $item->{login};
+ foreach my $item (@{ $form->{"ALL_SALESMEN"} }) {
+ push(@values, $item->{"id"});
+ $labels{$item->{"id"}} = ($item->{"name"} ne "" ? $item->{"name"} : $item->{"login"});
}
-
- $salesman =
+ $salesmen =
qq|
| . $locale->text('Salesman') . qq| |
| .
- NTI($cgi->popup_menu('-name' => 'salesman_id', '-default' => $form->{salesman_id},
+ NTI($cgi->popup_menu('-name' => 'salesman_id', '-default' => $form->{"salesman_id"} ? $form->{"salesman_id"} : $form->{"employee_id"},
'-values' => \@values, '-labels' => \%labels))
. qq| |
|;
@@ -508,16 +516,16 @@ sub form_header {
%labels = ();
@values = ();
- foreach my $item (@{ $form->{"ALL_SALESMEN"} }) {
+ foreach my $item (@{ $form->{"ALL_EMPLOYEES"} }) {
push(@values, $item->{"id"});
- $labels{$item->{"id"}} = $item->{"name"};
+ $labels{$item->{"id"}} = $item->{"name"} ne "" ? $item->{"name"} : $item->{"login"};
}
- my $employees = qq|
+ my $employee = qq|
| . $locale->text('Employee') . qq| |
| .
- NTI($cgi->popup_menu('-name' => 'employee', '-default' => $form->{"employee"},
+ NTI($cgi->popup_menu('-name' => 'employee_id', '-default' => $form->{"employee_id"},
'-values' => \@values, '-labels' => \%labels)) . qq|
|
|;
@@ -534,7 +542,7 @@ sub form_header {
| . $locale->text('Steuersatz') . qq| |
| .
NTI($cgi->popup_menu('-name' => 'taxzone_id', '-default' => $form->{"taxzone_id"},
- '-values' => \@values, '-labels' => \%labels)) . qq|
+ '-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px')) . qq|
|
|;
@@ -545,9 +553,11 @@ sub form_header {
push(@values, $item);
$labels{$item} = $item;
}
-
- $form->{currency} = $form->{defaultcurrency} unless $form->{currency};
- my $currencies = qq|
+
+ $form->{currency} = $form->{defaultcurrency} unless $form->{currency};
+ my $currencies;
+ if (scalar @values) {
+ $currencies = qq|
| . $locale->text('Currency') . qq| |
| .
@@ -555,7 +565,7 @@ sub form_header {
'-values' => \@values, '-labels' => \%labels)) . qq|
|
|;
-
+ }
$form->{exchangerate} =
$form->format_amount(\%myconfig, $form->{exchangerate});
@@ -594,32 +604,25 @@ sub form_header {
if ($form->{business}) {
$business = qq|
- | . $locale->text('Business') . qq| |
- $form->{business} |
- | . $locale->text('Trade Discount') . qq| |
- |
+ | | . ($form->{vc} eq "customer" ? $locale->text('Customer type') : $locale->text('Vendor type')) . qq| |
+ $form->{business}; | . $locale->text('Trade Discount') . qq| |
. $form->format_amount(\%myconfig, $form->{tradediscount} * 100)
. qq| % |
-
+
|;
}
if ($form->{max_dunning_level}) {
$dunning = qq|
-
-
-
-
- | . $locale->text('Max. Dunning Level') . qq|: |
- $form->{max_dunning_level} |
- | . $locale->text('Dunning Amount') . qq|: |
- |
- . $form->format_amount(\%myconfig, $form->{dunning_amount},2)
- . qq| |
-
-
- |
-
+
+ | . $locale->text('Max. Dunning Level') . qq|: |
+
+ $form->{max_dunning_level};
+ | . $locale->text('Dunning Amount') . qq|: |
+ . $form->format_amount(\%myconfig, $form->{dunning_amount},2)
+ . qq|
+ |
+
|;
}
@@ -653,20 +656,11 @@ sub form_header {
$n = ($form->{creditremaining} =~ /-/) ? "0" : "1";
$creditremaining = qq|
-
- |
-
-
-
- | . $locale->text('Credit Limit') . qq| |
- $form->{creditlimit} |
- |
- | . $locale->text('Remaining') . qq| |
- $form->{creditremaining} |
-
-
- |
- $shipto
+ $shipto
+
+ | . $locale->text('Credit Limit') . qq| |
+ $form->{creditlimit}; | . $locale->text('Remaining') . qq| $form->{creditremaining} |
+
|;
} else {
@@ -713,23 +707,19 @@ sub form_header {
$department = qq|
| . $locale->text('Department') . qq| |
-
+ |
|
| if $form->{selectdepartment};
if ($form->{type} eq 'sales_order') {
if ($form->{selectemployee}) {
- $employee = qq|
- {customer_klass}>
- $employees
-|;
+ $employee .= qq|
+ |;
}
} else {
- $employee = qq|
- {customer_klass}>
- $employees
-|;
+ $employee .= qq|
+ |;
}
if ($form->{resubmit} && ($form->{format} eq "html")) {
$onload =
@@ -752,41 +742,26 @@ sub form_header {
# show history button js
$form->{javascript} .= qq||;
#/show history button js
+ $form->{javascript} .= qq||;
+
$form->header;
print qq|