X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=3c55ee58f60248b7c6e95be9e63c1c421652b71a;hb=ce3ce404919a3e39c4b966db7b7d02076cd8c7e5;hp=173ad770fdefefaafcf7cb711f6cee2db7d5626b;hpb=6e50e0c2879d0e9b4dbb13b84a51d24388fc8d1f;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 173ad770f..3c55ee58f 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; @@ -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 @@ -361,12 +353,12 @@ sub form_header { # with JavaScript Calendar $button1 = qq| - {transdate}> + text('button') . qq|> |; $button2 = qq| - {reqdate}> + text('button') . qq|> |; @@ -380,28 +372,30 @@ sub form_header { # without JavaScript Calendar $button1 = qq| - {transdate}>|; + |; $button2 = qq| - {reqdate}>|; + |; } - 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| |; @@ -429,7 +423,9 @@ sub form_header { "projects" => { "key" => "ALL_PROJECTS", "all" => 0, "old_id" => \@old_project_ids }, - "employees" => "ALL_SALESMEN"); + "employees" => "ALL_SALESMEN", + "taxzones" => "ALL_TAXZONES", + "currencies" => "ALL_CURRENCIES"); my %labels; my @values = (undef); @@ -487,6 +483,42 @@ sub form_header { |; } + + %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| + + |; + + %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}); @@ -558,34 +590,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| @@ -723,14 +727,17 @@ onchange="document.getElementById('update_button').click();">| . } 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||; @@ -797,10 +804,7 @@ onchange="document.getElementById('update_button').click();">| . $taxzone $department - | . $locale->text('Currency') . qq| - - - {defaultcurrency}> + $currencies $exchangerate @@ -810,7 +814,11 @@ onchange="document.getElementById('update_button').click();">| . | . $locale->text('Ship via') . qq| - |; + + + | . $locale->text('Transaction description') . qq| + + |; # # # @@ -1063,7 +1071,7 @@ sub form_footer { @@ -1158,7 +1166,6 @@ sub form_footer { -{path}> {login}> {password}> @@ -1398,12 +1405,12 @@ sub search { # with JavaScript Calendar $button1 = qq| - |; $button2 = qq| - |; @@ -1416,9 +1423,9 @@ sub search { # without JavaScript Calendar $button1 = qq| - |; + |; $button2 = qq| - |; + |; } $form->get_lists("projects" => { "key" => "ALL_PROJECTS", @@ -1458,6 +1465,10 @@ sub search { + + + + @@ -1503,8 +1514,12 @@ sub search { . $locale->text('Tax') . qq| + + + |; + $column_header{transaction_description} = + qq||; $column_header{ids} = qq||; @@ -1767,7 +1783,7 @@ sub orders { $column_data{reqdate} = ""; $column_data{$ordnumber} = - ""; + ""; $column_data{name} = ""; $column_data{employee} = ""; @@ -1784,6 +1800,7 @@ sub orders { $column_data{"delivered"} = ""; + $column_data{transaction_description} = ""; $i++; $i %= 2; @@ -1835,7 +1852,6 @@ sub orders { if ($form->{type} =~ /sales_order/) { print qq| - @@ -1858,7 +1874,6 @@ sub orders { {type}> {vc}> -{path}> {login}> {password}> @@ -1976,6 +1991,7 @@ sub save_and_close { # saving the history if(!exists $form->{addition}) { + $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber}; $form->{addition} = "SAVED"; $form->save_history($form->dbconnect(\%myconfig)); } @@ -2057,6 +2073,7 @@ sub save { # saving the history if(!exists $form->{addition}) { + $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber}; $form->{addition} = "SAVED"; $form->save_history($form->dbconnect(\%myconfig)); } @@ -2128,6 +2145,7 @@ sub yes { $form->redirect($msg); # saving the history if(!exists $form->{addition}) { + $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber}; $form->{addition} = "DELETED"; $form->save_history($form->dbconnect(\%myconfig)); } @@ -2241,7 +2259,7 @@ sub invoice { # locale messages $locale = new Locale "$myconfig{countrycode}", "$script"; - require "$form->{path}/$form->{script}"; + require "bin/mozilla/$form->{script}"; map { $form->{"select$_"} = "" } ($form->{vc}, currency); @@ -2322,7 +2340,6 @@ sub backorder_exchangerate { print qq| -{path}> {login}> {password}>
|; - &print_options; + print_options(); print qq| + text('button') . qq|> + text('button') . qq|>$ordlabel
| . $locale->text('Transaction description') . qq|
| . $locale->text("Project Number") . qq| $projectnumber | . $locale->text('Total') . qq|
| . $locale->text('Project Number') . qq| | + . $locale->text('Transaction description') . qq|
| @@ -1523,7 +1538,6 @@ $jsscript
-{path}> {login}> {password}> {vc}> @@ -1551,27 +1565,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}?path=$form->{path}&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}?path=$form->{path}&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}); @@ -1665,6 +1678,9 @@ sub orders { $column_header{employee} = qq|
$employee| + . $locale->text("Transaction description") . qq|$oe->{reqdate} {path}&action=$action&type=$form->{type}&id=$oe->{id}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&callback=$callback_escaped>$oe->{$ordnumber}{type}&id=$oe->{id}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&callback=$callback_escaped>$oe->{$ordnumber}$oe->{name}$oe->{employee} " . ($oe->{"delivered"} ? $locale->text("Yes") : $locale->text("No")) . "" . H($oe->{transaction_description}) . "