X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=cfbb216addf9ca53d594189252df2fa77a118313;hb=2c5603bb853ba7892d98c295e1f00641d7c13ef3;hp=0a2c93d8de5b753a1c6ca46eda3b2f770e3e6cf1;hpb=f6124ea6b4ad154625d1fbce3485884e5f2ce82c;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 0a2c93d8d..cfbb216ad 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -162,9 +162,8 @@ sub order_links { ($form->{vc} eq 'customer') ? "AR" : "AP"); # retrieve order/quotation - $form->{webdav} = $webdav; - # set jscalendar - $form->{jscalendar} = $jscalendar; + $form->{webdav} = $webdav; + $form->{jsscript} = 1; my $editing = $form->{id}; @@ -331,36 +330,24 @@ sub form_header { shiptophone shiptofax shiptodepartment_1 shiptodepartment_2); # use JavaScript Calendar or not - $form->{jsscript} = $form->{jscalendar}; + $form->{jsscript} = 1; $jsscript = ""; - if ($form->{jsscript}) { - - # with JavaScript Calendar - $button1 = qq| - - text('button') . qq|> - |; - $button2 = qq| - - text('button') . qq|> - |; - - #write Trigger - $jsscript = - Form->write_trigger(\%myconfig, "2", "transdate", "BL", "trigger1", - "reqdate", "BL", "trigger2"); - - } else { - - # without JavaScript Calendar - $button1 = qq| - |; - $button2 = qq| - |; - } + $button1 = qq| + + text('button') . qq|> + |; + $button2 = qq| + + text('button') . qq|> + |; + + #write Trigger + $jsscript = + Form->write_trigger(\%myconfig, "2", "transdate", "BL", "trigger1", + "reqdate", "BL", "trigger2"); my @tmp; @@ -403,6 +390,7 @@ sub form_header { map({ push(@old_project_ids, $form->{"project_id_$_"}) if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"})); + my $vc = $form->{vc} eq "customer" ? "customers" : "vendors"; $form->get_lists("contacts" => "ALL_CONTACTS", "shipto" => "ALL_SHIPTO", "projects" => { "key" => "ALL_PROJECTS", @@ -411,11 +399,9 @@ sub form_header { "employees" => "ALL_SALESMEN", "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")); - + "currencies" => "ALL_CURRENCIES", + $vc => "ALL_" . uc($vc)); + my %labels; my @values = (undef); foreach my $item (@{ $form->{"ALL_CONTACTS"} }) { @@ -423,9 +409,19 @@ sub form_header { $labels{$item->{"cp_id"}} = $item->{"cp_name"} . ($item->{"cp_abteilung"} ? " ($item->{cp_abteilung})" : ""); } - my $contact = - NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values, - '-labels' => \%labels, '-default' => $form->{"cp_id"})); + + my $contact; + if (scalar @values > 1) { + $contact = qq| + + | . $locale->text('Contact Person') . qq| + | . + NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values, + '-labels' => \%labels, '-default' => $form->{"cp_id"})) + . qq| + + |; + } %labels = (); @values = (); @@ -435,7 +431,8 @@ sub form_header { $labels{$item->{"id"}} = $item->{name}.qq|--|.$item->{"id"}; } - my $vc = qq| + $vc = qq| + {vc}_id"}) . qq|"> {vc}"}) . qq|"> | . $locale->text(ucfirst($form->{vc})) . qq| | . @@ -444,6 +441,7 @@ sub form_header { : (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|">|; @@ -469,12 +467,16 @@ sub form_header { $item->{"shiptoname"} . " " . $item->{"shiptodepartment_1"}; } - my $shipto = qq| - | . $locale->text('Shipping Address') . qq| - | . - NTI($cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values, - '-labels' => \%labels, '-default' => $form->{"shipto_id"})) + my $shipto; + if (scalar @values > 1) { + $shipto = qq| + + | . $locale->text('Shipping Address') . qq| + | . + NTI($cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values, + '-labels' => \%labels, '-default' => $form->{"shipto_id"})) . qq||; + } %labels = (); @values = (""); @@ -545,9 +547,11 @@ sub form_header { push(@values, $item); $labels{$item} = $item; } - - $form->{currency} = $form->{defaultcurrency} unless $form->{currency}; - my $currencies = qq| + + $form->{currency} = $form->{defaultcurrency} unless $form->{currency}; + my $currencies; + if (scalar @values) { + $currencies = qq| | . $locale->text('Currency') . qq| | . @@ -555,7 +559,7 @@ sub form_header { '-values' => \@values, '-labels' => \%labels)) . qq| |; - + } $form->{exchangerate} = $form->format_amount(\%myconfig, $form->{exchangerate}); @@ -594,32 +598,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| + + |; } @@ -653,20 +650,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 { @@ -752,41 +740,26 @@ sub form_header { # show history button js $form->{javascript} .= qq||; #/show history button js + $form->{javascript} .= qq||; + $form->header; print qq|
{script}> + +|; -{id}> -{action}> - -{type}> -{formname}> -{media}> -{format}> -{proforma}> - - - - - -{vc}> - - - -{discount}> -{creditlimit}> -{creditremaining}> + $form->hide_form(qw(id action type vc formname media format proforma queued printed emailed + title discount creditlimit creditremaining tradediscount business + max_dunning_level dunning_amount)); -{tradediscount}> -{business}> - + print qq| @@ -801,10 +774,7 @@ sub form_header {
$vc - - - + $contact $creditremaining $business $dunning @@ -1071,9 +1041,7 @@ sub form_footer { print $webdav_list; } - print qq| -{jscalendar}> -|; + print qq| - |; - $button2 = qq| - - |; - - #write Trigger - $jsscript = - Form->write_trigger(\%myconfig, "2", "transdatefrom", "BR", "trigger3", - "transdateto", "BL", "trigger4"); - } else { - # without JavaScript Calendar - $button1 = qq| - |; - $button2 = qq| - |; - } + $button1 = qq| + + |; + $button2 = qq| + + |; + + #write Trigger + $jsscript = + Form->write_trigger(\%myconfig, "2", "transdatefrom", "BR", "trigger3", + "transdateto", "BL", "trigger4"); + + my $vc = $form->{vc} eq "customer" ? "customers" : "vendors"; $form->get_lists("projects" => { "key" => "ALL_PROJECTS", - "all" => 1 }); + "all" => 1 }, + $vc => "ALL_" . uc($vc)); my %labels = (); my @values = (""); @@ -1442,6 +1403,24 @@ sub search { NTI($cgi->popup_menu('-name' => 'project_id', '-values' => \@values, '-labels' => \%labels)); + %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_label = $form->{vc} eq "customer" ? $locale->text('Customer') : $locale->text('Vendor'); + $vc = + $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)); + $form->header; print qq| @@ -1458,7 +1437,8 @@ sub search {
| - . $locale->text('Contact Person') . qq|$contact
@@ -1400,37 +1368,30 @@ sub search { } # use JavaScript Calendar or not - $form->{jsscript} = $jscalendar; + $form->{jsscript} = 1; $jsscript = ""; - if ($form->{jsscript}) { - - # with JavaScript Calendar - $button1 = qq| - - text('button') . qq|> - text('button') . qq|> + text('button') . qq|> + text('button') . qq|> - $vc + + $department @@ -1557,12 +1537,6 @@ $jsscript sub orders { $lxdebug->enter_sub(); - # split vendor / customer - ($form->{ $form->{vc} }, $form->{"$form->{vc}_id"}) = - split(/--/, $form->{ $form->{vc} }); - - OE->transactions(\%myconfig, \%$form); - $ordnumber = ($form->{type} =~ /_order$/) ? "ordnumber" : "quonumber"; # construct href @@ -1570,11 +1544,18 @@ sub orders { qw(type vc login password transdatefrom transdateto open closed notdelivered delivered department transaction_description); + push @fields, $form->{vc}; $href = "$form->{script}?action=orders&" . join("&", map { "${_}=" . E($form->{$_}) } @fields) . "&${ordnumber}=" . E($form->{$ordnumber}); $callback = $href; + # split vendor / customer + ($form->{ $form->{vc} }, $form->{"$form->{vc}_id"}) = + split(/--/, $form->{ $form->{vc} }); + + OE->transactions(\%myconfig, \%$form); + @columns = ( "transdate", "reqdate", "id", "$ordnumber",
$vc_label$vc