X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Foe.pl;h=6281afe4d625a381abe160e379ee1dfb3fa1daf7;hb=cae6316e718234083b892b042e61714ceb13b0ca;hp=b8d754c5c0f88da233261ff99999dc5b36a6d487;hpb=d7f060429e809653d45e93e86b3c5c8d7129e0a9;p=kivitendo-erp.git
diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl
index b8d754c5c..6281afe4d 100644
--- a/bin/mozilla/oe.pl
+++ b/bin/mozilla/oe.pl
@@ -30,15 +30,18 @@
# Order entry module
# Quotation module
#======================================================================
-use Data::Dumper;
+
+use POSIX qw(strftime);
use SL::OE;
use SL::IR;
use SL::IS;
use SL::PE;
+use SL::ReportGenerator;
require "bin/mozilla/io.pl";
require "bin/mozilla/arap.pl";
+require "bin/mozilla/report_generator.pl";
1;
@@ -324,6 +327,23 @@ 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};
+ }
+
+ $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
+
+
+ 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
@@ -374,7 +394,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}/;
@@ -396,7 +416,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",
@@ -416,7 +437,7 @@ sub form_header {
| . $locale->text('Contact Person') . qq| |
| .
- NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values,
+ NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values, '-style' => 'width: 250px',
'-labels' => \%labels, '-default' => $form->{"cp_id"}))
. qq|
|
@@ -427,8 +448,8 @@ sub form_header {
@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|
@@ -437,10 +458,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|">|;
@@ -454,7 +476,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| | |;
@@ -462,8 +484,7 @@ 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;
@@ -472,7 +493,7 @@ sub form_header {
| . $locale->text('Shipping Address') . qq| |
| .
- NTI($cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values,
+ NTI($cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values, '-style' => 'width: 250px',
'-labels' => \%labels, '-default' => $form->{"shipto_id"}))
. qq| | |;
}
@@ -487,21 +508,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| |
|;
@@ -509,16 +529,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|
|
|;
@@ -535,7 +555,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|
|
|;
@@ -563,6 +583,10 @@ sub form_header {
$form->{exchangerate} =
$form->format_amount(\%myconfig, $form->{exchangerate});
+ if (!$form->{exchangerate}) {
+ $form->{exchangerate} = "";
+ }
+
if (($form->{creditlimit} != 0) && ($form->{creditremaining} < 0) && !$form->{update}) {
$creditwarning = 1;
} else {
@@ -597,32 +621,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|
+ |
+
|;
}
@@ -656,20 +673,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 {
@@ -716,23 +724,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 =
@@ -755,41 +759,26 @@ sub form_header {
# show history button js
$form->{javascript} .= qq||;
#/show history button js
+ $form->{javascript} .= qq||;
+
$form->header;
print qq|