X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=f08daabfde2218e79c95bc7b3327eae3faa28aa2;hb=2fda509c7dc417aad28ed072e91e8ffe2396314d;hp=e076691a1b326263f13d93e0606ddbc42ec78d2c;hpb=d629acd82a27e980899a044ca8b0f4becc8e94bb;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index e076691a1..f08daabfd 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -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}; @@ -361,12 +346,12 @@ sub form_header { # 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 +365,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 +395,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 +417,12 @@ sub form_header { "all" => 0, "old_id" => \@old_project_ids }, "employees" => "ALL_SALESMEN", - "taxzones" => "ALL_TAXZONES"); - + "taxzones" => "ALL_TAXZONES", + "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 +434,25 @@ 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| + | . $locale->text(ucfirst($form->{vc})) . qq| + | . + (($myconfig{vclimit} == 1 ) + ? qq|| + : (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_SHIPTO"} }) { @@ -490,6 +498,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 +530,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 +583,6 @@ sub form_header { } } - $vclabel = ucfirst $form->{vc}; - $vclabel = $locale->text($vclabel); - - - if ($form->{business}) { $business = qq| @@ -665,48 +702,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 +792,7 @@ onchange="document.getElementById('update_button').click();">| . - - - {vc}_id value=$form->{"$form->{vc}_id"}> - {vc}"}"> + $vc @@ -792,10 +803,7 @@ onchange="document.getElementById('update_button').click();">| . $taxzone $department - - - - {defaultcurrency}> + $currencies $exchangerate @@ -805,7 +813,11 @@ onchange="document.getElementById('update_button').click();">| . - |; + + + + + |; # #
$vclabel$vc| . $locale->text('Contact Person') . qq| $contact
| . $locale->text('Currency') . qq|
| . $locale->text('Ship via') . qq|
| . $locale->text('Transaction description') . qq|
# @@ -1341,20 +1353,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} = "
- - + $vc $department + + + + @@ -1484,7 +1485,7 @@ sub search { . $locale->text('Required by') . qq| - + @@ -1497,8 +1498,12 @@ sub search { . $locale->text('Tax') . qq| + + + |; + $column_header{transaction_description} = + qq||; $column_header{ids} = qq||; @@ -1777,6 +1784,7 @@ sub orders { $column_data{"delivered"} = ""; + $column_data{transaction_description} = ""; $i++; $i %= 2;
$vclabel$vc
$ordlabel
| . $locale->text('Transaction description') . qq|
| . $locale->text("Project Number") . qq| $projectnumber
$vclabel ucfirst($form->{vc}) $employee | . $locale->text('Ship via') . qq| | . $locale->text('Total') . qq|
| . $locale->text('Project Number') . qq| | + . $locale->text('Transaction description') . qq|
| @@ -1544,27 +1549,26 @@ sub orders { $ordnumber = ($form->{type} =~ /_order$/) ? "ordnumber" : "quonumber"; - $number = $form->escape($form->{$ordnumber}); - $name = $form->escape($form->{ $form->{vc} }); - $department = $form->escape($form->{department}); - # construct href - $href = - "$form->{script}?action=orders&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&transdatefrom=$form->{transdatefrom}&transdateto=$form->{transdateto}&open=$form->{open}&closed=$form->{closed}¬delivered=$form->{notdelivered}&delivered=$form->{delivered}&$ordnumber=$number&$form->{vc}=$name&department=$department"; - - # construct callback - $number = $form->escape($form->{$ordnumber}, 1); - $name = $form->escape($form->{ $form->{vc} }, 1); - $department = $form->escape($form->{department}, 1); - - $callback = - "$form->{script}?action=orders&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&transdatefrom=$form->{transdatefrom}&transdateto=$form->{transdateto}&open=$form->{open}&closed=$form->{closed}¬delivered=$form->{notdelivered}&delivered=$form->{delivered}&$ordnumber=$number&$form->{vc}=$name&department=$department"; - - @columns = - $form->sort_columns("transdate", "reqdate", "id", "$ordnumber", - "name", "netamount", "tax", "amount", - "curr", "employee", "shipvia", "globalprojectnumber", - "open", "closed", "delivered"); + my @fields = + qw(type vc login password transdatefrom transdateto + open closed notdelivered delivered department + transaction_description); + $href = "$form->{script}?action=orders&" + . join("&", map { "${_}=" . E($form->{$_}) } @fields) + . "&${ordnumber}=" . E($form->{$ordnumber}); + $callback = $href; + + @columns = ( + "transdate", "reqdate", + "id", "$ordnumber", + "name", "netamount", + "tax", "amount", + "curr", "employee", + "shipvia", "globalprojectnumber", + "transaction_description", "open", + "closed", "delivered" + ); $form->{l_open} = $form->{l_closed} = "Y" if ($form->{open} && $form->{closed}); @@ -1658,6 +1662,9 @@ sub orders { $column_header{employee} = qq|$employee| + . $locale->text("Transaction description") . qq|" . ($oe->{"delivered"} ? $locale->text("Yes") : $locale->text("No")) . "" . H($oe->{transaction_description}) . "