X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Foe.pl;h=e076691a1b326263f13d93e0606ddbc42ec78d2c;hb=84bed7a655edfe816ad2a04b5549b6bd6a968c79;hp=ee8eddf17c07924b9880aad6eeca873b20eba555;hpb=2b89ec9756dc1d3525b6163fe4cf4f38af83f9d8;p=kivitendo-erp.git
diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl
index ee8eddf17..e076691a1 100644
--- a/bin/mozilla/oe.pl
+++ b/bin/mozilla/oe.pl
@@ -37,8 +37,8 @@ use SL::IR;
use SL::IS;
use SL::PE;
-require "$form->{path}/io.pl";
-require "$form->{path}/arap.pl";
+require "bin/mozilla/io.pl";
+require "bin/mozilla/arap.pl";
1;
@@ -98,7 +98,7 @@ sub add {
set_headings("add");
$form->{callback} =
- "$form->{script}?action=add&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&path=$form->{path}&password=$form->{password}"
+ "$form->{script}?action=add&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}"
unless $form->{callback};
&order_links;
@@ -120,19 +120,19 @@ sub edit {
# editing without stuff to edit? try adding it first
if ($form->{rowcount}) {
- map { $id++ if $form->{"id_$_"} } (1 .. $form->{rowcount});
+ map { $id++ if $form->{"multi_id_$_"} } (1 .. $form->{rowcount});
if (!$id) {
# reset rowcount
undef $form->{rowcount};
&add;
+ $lxdebug->leave_sub();
return;
}
- } else {
- if (!$form->{id}) {
- &add;
- return;
- }
+ } elsif (!$form->{id}) {
+ &add;
+ $lxdebug->leave_sub();
+ return;
}
if ($form->{print_and_save}) {
@@ -167,6 +167,8 @@ sub order_links {
# set jscalendar
$form->{jscalendar} = $jscalendar;
+ my $editing = $form->{id};
+
OE->retrieve(\%myconfig, \%$form);
if ($form->{payment_id}) {
@@ -179,6 +181,8 @@ sub order_links {
$taxzone_id = $form->{taxzone_id};
}
+ $salesman_id = $form->{salesman_id} if ($editing);
+
# if multiple rowcounts (== collective order) then check if the
# there were more than one customer (in that case OE::retrieve removes
@@ -236,7 +240,7 @@ sub order_links {
if ($taxzone_id) {
$form->{taxzone_id} = $taxzone_id;
}
- $form->{intnotes} = $intnotes;
+ $form->{intnotes} = $intnotes if $intnotes;
($form->{ $form->{vc} }) = split /--/, $form->{ $form->{vc} };
$form->{"old$form->{vc}"} =
qq|$form->{$form->{vc}}--$form->{"$form->{vc}_id"}|;
@@ -245,7 +249,8 @@ sub order_links {
if (@{ $form->{"all_$form->{vc}"} }) {
$form->{ $form->{vc} } =
qq|$form->{$form->{vc}}--$form->{"$form->{vc}_id"}|;
- map { $form->{"select$form->{vc}"} .= "\n" }
(@{ $form->{"all_$form->{vc}"} });
}
@@ -255,7 +260,7 @@ sub order_links {
$form->{defaultcurrency} = $curr[0];
$form->{currency} = $form->{defaultcurrency} unless $form->{currency};
- map { $form->{selectcurrency} .= "\n" } @curr;
$form->{taxincluded} = $taxincluded if ($form->{id});
@@ -266,7 +271,7 @@ sub order_links {
map {
$form->{selectdepartment} .=
- "\n"
} (@{ $form->{all_departments} });
}
@@ -275,13 +280,15 @@ sub order_links {
# sales staff
if (@{ $form->{all_employees} }) {
$form->{selectemployee} = "";
- map { $form->{selectemployee} .= "\n" }
(@{ $form->{all_employees} });
}
# forex
$form->{forex} = $form->{exchangerate};
+ $form->{salesman_id} = $salesman_id if ($editing);
+
$lxdebug->leave_sub();
}
@@ -354,12 +361,12 @@ sub form_header {
# with JavaScript Calendar
$button1 = qq|
-
{transdate}> |
+ {transdate} onBlur=\"check_right_date_format(this)\"> |
text('button') . qq|> |
|;
$button2 = qq|
- {reqdate}> |
+ {reqdate} onBlur=\"check_right_date_format(this)\"> |
text('button') . qq|> |
|;
@@ -373,28 +380,30 @@ sub form_header {
# without JavaScript Calendar
$button1 = qq|
- {transdate}> | |;
+ {transdate} onBlur=\"check_right_date_format(this)\"> | |;
$button2 = qq|
- {reqdate}> | |;
+ {reqdate} onBlur=\"check_right_date_format(this)\"> | |;
}
- if ($form->{id}) {
- $openclosed = qq|
-
-
-
-
-|;
+ my @tmp;
- if (($form->{"type"} eq "sales_order") ||
- ($form->{"type"} eq "purchase_order")) {
- $openclosed .= qq|
+ if (($form->{"type"} eq "sales_order") ||
+ ($form->{"type"} eq "purchase_order")) {
+ push(@tmp, qq|
-
-|;
- }
+ |);
+ }
+ if ($form->{id}) {
+ push(@tmp, qq|
+
+ |);
+ }
+
+ if (@tmp) {
$openclosed .= qq|
+ |
+ | . join("\n", @tmp) . qq|
|
|;
@@ -410,6 +419,9 @@ sub form_header {
#quote select[customer|vendor] Bug 133
$form->{"select$form->{vc}"} = $form->quote($form->{"select$form->{vc}"});
+ #substitute \n and \r to \s (bug 543)
+ $form->{"select$form->{vc}"} =~ s/[\n\r]/ /g;
+
my @old_project_ids = ($form->{"globalproject_id"});
map({ push(@old_project_ids, $form->{"project_id_$_"})
if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"}));
@@ -418,9 +430,12 @@ sub form_header {
"shipto" => "ALL_SHIPTO",
"projects" => { "key" => "ALL_PROJECTS",
"all" => 0,
- "old_id" => \@old_project_ids });
+ "old_id" => \@old_project_ids },
+ "employees" => "ALL_SALESMEN",
+ "taxzones" => "ALL_TAXZONES");
- my (%labels, @values);
+ my %labels;
+ my @values = (undef);
foreach my $item (@{ $form->{"ALL_CONTACTS"} }) {
push(@values, $item->{"cp_id"});
$labels{$item->{"cp_id"}} = $item->{"cp_name"} .
@@ -456,6 +471,42 @@ sub form_header {
'-labels' => \%labels,
'-default' => $form->{"globalproject_id"}));
+ $salesman = "";
+ 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};
+ }
+
+ $salesman =
+ qq|
+ | . $locale->text('Salesman') . qq| |
+ | .
+ NTI($cgi->popup_menu('-name' => 'salesman_id', '-default' => $form->{salesman_id},
+ '-values' => \@values, '-labels' => \%labels))
+ . qq| |
+
|;
+ }
+
+
+ %labels = ();
+ @values = ();
+ foreach my $item (@{ $form->{"ALL_TAXZONES"} }) {
+ push(@values, $item->{"id"});
+ $labels{$item->{"id"}} = $item->{"description"};
+ }
+
+ $taxzone = qq|
+
+ | . $locale->text('Steuersatz') . qq| |
+ | .
+ NTI($cgi->popup_menu('-name' => 'taxzone_id', '-default' => $form->{"taxzone_id"},
+ '-values' => \@values, '-labels' => \%labels)) . qq|
+ |
+
|;
+
$form->{exchangerate} =
$form->format_amount(\%myconfig, $form->{exchangerate});
@@ -527,34 +578,6 @@ sub form_header {
|;
}
- if (@{ $form->{TAXZONE} }) {
- $form->{selecttaxzone} = "";
- foreach $item (@{ $form->{TAXZONE} }) {
- if ($item->{id} == $form->{taxzone_id}) {
- $form->{selecttaxzone} .=
- "";
- } else {
- $form->{selecttaxzone} .=
- "";
- }
-
- }
- } else {
- $form->{selecttaxzone} =~ s/ selected//g;
- if ($form->{taxzone_id} ne "") {
- $form->{selecttaxzone} =~ s/value=$form->{taxzone_id}>/value=$form->{taxzone_id} selected>/;
- }
- }
-
- $taxzone = qq|
-
- | . $locale->text('Steuersatz') . qq| |
- |
-
-
|;
-
-
if ($form->{type} !~ /_quotation$/) {
$ordnumber = qq|
@@ -644,7 +667,10 @@ sub form_header {
$vc =
($form->{"select$form->{vc}"})
- ? qq|\n{vc}"}">|
+ ? qq|\n{vc}"}) . qq|">|
: qq|{vc} value="$form->{$form->{vc}}" size=35>|;
$department = qq|
@@ -665,7 +691,7 @@ sub form_header {
$employee = qq|
{customer_klass}>
- | . $locale->text('Salesperson') . qq| |
+ | . $locale->text('Employee') . qq| |
|
|
@@ -689,16 +715,21 @@ sub form_header {
} elsif ($form->{resubmit}) {
$onload = qq|document.oe.submit()|;
} else {
- $onload = "fokus()";
+ $onload = "focus()";
}
$credittext = $locale->text('Credit Limit exceeded!!!');
if ($creditwarning) {
$onload = qq|alert('$credittext')|;
}
-
+
+ $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
+ $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
+
$form->{"javascript"} .= qq||;
-
+ # show history button js
+ $form->{javascript} .= qq||;
+ #/show history button js
$form->header;
print qq|
@@ -801,6 +832,7 @@ print qq|
$openclosed
$employee
+ $salesman
$ordnumber
| . $locale->text('Project Number') . qq| |
@@ -891,7 +923,8 @@ sub form_footer {
$tax .= qq|
- $form->{"${item}_description"} |
+ $form->{"${item}_description"} |
+ . $form->{"${item}_rate"} * 100 .qq|% |
$form->{"${item}_total"} |
|;
@@ -930,7 +963,8 @@ sub form_footer {
$tax .= qq|
- Enthaltene $form->{"${item}_description"} |
+ Enthaltene $form->{"${item}_description"} |
+ . $form->{"${item}_rate"} * 100 .qq|% |
$form->{"${item}_total"} |
@@ -963,7 +997,7 @@ sub form_footer {
$intnotes |
| . $locale->text('Payment Terms') . qq| |
- |
@@ -1024,7 +1058,7 @@ sub form_footer {
|;
- &print_options;
+ print_options();
print qq|
|
@@ -1048,6 +1082,12 @@ sub form_footer {
if (($form->{id})) {
print qq|
+
+
| . $locale->text("Workflow $form->{type}") . qq|
@@ -1105,26 +1145,17 @@ sub form_footer {
|;
}
+ $form->hide_form("saved_xyznumber");
+
print qq|
{rowcount}>
-{path}>
{login}>
{password}>
-|;
-# button for saving history
-print qq|
- {id}
- . qq|); name=history id=history value=|
- . $locale->text('history')
- . qq|>|;
-# /button for saving history
-
-qq|
+