X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=0a2c93d8de5b753a1c6ca46eda3b2f770e3e6cf1;hb=f6124ea6b4ad154625d1fbce3485884e5f2ce82c;hp=1e0c8a6c6d38833db7f2bb6de4de3b376f1c8d84;hpb=ddbe3ea5ec297a58acc9ee3afc17156fb97be7f2;p=kivitendo-erp.git
diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl
index 1e0c8a6c6..0a2c93d8d 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;
@@ -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;
}
@@ -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};
@@ -349,24 +334,16 @@ 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
$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 +357,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 +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}/;
@@ -432,8 +409,13 @@ sub form_header {
"all" => 0,
"old_id" => \@old_project_ids },
"employees" => "ALL_SALESMEN",
- "taxzones" => "ALL_TAXZONES");
-
+ "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"} }) {
@@ -445,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"} }) {
@@ -490,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 = ();
@@ -507,6 +538,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 +591,6 @@ sub form_header {
}
}
- $vclabel = ucfirst $form->{vc};
- $vclabel = $locale->text($vclabel);
-
-
-
if ($form->{business}) {
$business = qq|
@@ -665,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")) {
@@ -778,10 +800,7 @@ onchange="document.getElementById('update_button').click();">| .
|
$taxincluded
@@ -1153,7 +1173,6 @@ sub form_footer {
-{path}>
{login}>
{password}>
@@ -1173,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
@@ -1342,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} = " |