X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=34870fea269936ec068bcee6bf99c08aad9f4df0;hb=15f549fdb43fba2d99817c659533dfa02638bf27;hp=cfd55a4043151f9d93f60738a58e57a604533dc0;hpb=b3501bdfd1971fd17d06e47cdf994c7545c3c13c;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index cfd55a404..34870fea2 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -110,6 +110,9 @@ sub add { sub edit { $lxdebug->enter_sub(); + # show history button + $form->{javascript} = qq||; + #/show hhistory button $form->{simple_save} = 0; @@ -205,7 +208,7 @@ sub order_links { $intnotes = $form->{intnotes}; # get customer / vendor - if ($form->{type} =~ /(purchase_order|request_quotation|receive_order)/) { + if ($form->{type} =~ /(purchase_order|request_quotation)/) { IR->get_vendor(\%myconfig, \%$form); #quote all_vendor Bug 133 @@ -214,7 +217,7 @@ sub order_links { } } - if ($form->{type} =~ /(sales|ship)_(order|quotation)/) { + if ($form->{type} =~ /sales_(order|quotation)/) { IS->get_customer(\%myconfig, \%$form); #quote all_vendor Bug 133 @@ -284,12 +287,8 @@ sub order_links { sub prepare_order { $lxdebug->enter_sub(); - $form->{format} = "pdf" unless ($form->{print_and_save} && $form->{format}); - $form->{media} = "screen"; $form->{formname} = $form->{type} unless $form->{formname}; - map { $form->{$_} =~ s/\"/"/g } - qw(ordnumber quonumber shippingpoint shipvia notes intnotes shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact); my $i = 0; foreach $ref (@{ $form->{form_details} }) { $form->{rowcount} = ++$i; @@ -331,8 +330,13 @@ sub prepare_order { sub form_header { $lxdebug->enter_sub(); - $checkedopen = ($form->{closed}) ? "" : "checked"; - $checkedclosed = ($form->{closed}) ? "checked" : ""; + my $checkedclosed = $form->{"closed"} ? "checked" : ""; + my $checkeddelivered = $form->{"delivered"} ? "checked" : ""; + + map { $form->{$_} =~ s/\"/"/g } + qw(ordnumber quonumber shippingpoint shipvia notes intnotes shiptoname + shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact + shiptophone shiptofax shiptodepartment_1 shiptodepartment_2); # use JavaScript Calendar or not $form->{jsscript} = $form->{jscalendar}; @@ -378,15 +382,20 @@ sub form_header { $openclosed = qq| - - - - - -
| - . $locale->text('Open') . qq| | - . $locale->text('Closed') . qq|
- + + +|; + + if (($form->{"type"} eq "sales_order") || + ($form->{"type"} eq "purchase_order")) { + $openclosed .= qq| + + +|; + } + + $openclosed .= qq| + |; } @@ -401,53 +410,51 @@ sub form_header { #quote select[customer|vendor] Bug 133 $form->{"select$form->{vc}"} = $form->quote($form->{"select$form->{vc}"}); - #build contacts - if ($form->{all_contacts}) { + my @old_project_ids = ($form->{"globalproject_id"}); + map({ push(@old_project_ids, $form->{"project_id_$_"}) + if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"})); - $form->{selectcontact} = ""; - foreach $item (@{ $form->{all_contacts} }) { - my $department = ($item->{cp_abteilung}) ? "--$item->{cp_abteilung}" : ""; - if ($form->{cp_id} == $item->{cp_id}) { - $form->{selectcontact} .= - ""; - } else { - $form->{selectcontact} .= ""; - } - } - } else { - $form->{selectcontact} =~ s/ selected//g; - if ($form->{cp_id} ne "") { - $form->{selectcontact} =~ s/value=$form->{cp_id}/value=$form->{cp_id} selected/; - } - } + $form->get_lists("contacts" => "ALL_CONTACTS", + "shipto" => "ALL_SHIPTO", + "projects" => { "key" => "ALL_PROJECTS", + "all" => 0, + "old_id" => \@old_project_ids }); + my (%labels, @values); + foreach my $item (@{ $form->{"ALL_CONTACTS"} }) { + push(@values, $item->{"cp_id"}); + $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"})); - if (@{ $form->{SHIPTO} }) { - $form->{selectshipto} = ""; - foreach $item (@{ $form->{SHIPTO} }) { - if ($item->{shipto_id} == $form->{shipto_id}) { - $form->{selectshipto} .= - ""; - } else { - $form->{selectshipto} .= - ""; - } - - } - } else { - $form->{selectshipto} =~ s/ selected//g; - if ($form->{shipto_id} ne "") { - $form->{selectshipto} =~ s/value=$form->{shipto_id}/value=$form->{shipto_id} selected/; - } + %labels = (); + @values = (""); + foreach my $item (@{ $form->{"ALL_SHIPTO"} }) { + push(@values, $item->{"shipto_id"}); + $labels{$item->{"shipto_id"}} = + $item->{"shiptoname"} . " " . $item->{"shiptodepartment_1"}; } - $shipto = qq| + my $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 = (""); + foreach my $item (@{ $form->{"ALL_PROJECTS"} }) { + push(@values, $item->{"id"}); + $labels{$item->{"id"}} = $item->{"projectnumber"}; + } + my $globalprojectnumber = + NTI($cgi->popup_menu('-name' => 'globalproject_id', '-values' => \@values, + '-labels' => \%labels, + '-default' => $form->{"globalproject_id"})); $form->{exchangerate} = $form->format_amount(\%myconfig, $form->{exchangerate}); @@ -463,11 +470,6 @@ sub form_header { $form->{creditremaining} = $form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0"); - $contact = - ($form->{selectcontact}) - ? qq|\n| - : qq||; - $exchangerate = qq| {forex}> |; @@ -491,13 +493,7 @@ sub form_header { $vclabel = ucfirst $form->{vc}; $vclabel = $locale->text($vclabel); - $terms = qq| - - | . $locale->text('Terms: Net') . qq| - {terms}> | - . $locale->text('days') . qq| - -|; + if ($form->{business}) { $business = qq| @@ -536,26 +532,21 @@ sub form_header { 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/; + $form->{selecttaxzone} =~ s/value=$form->{taxzone_id}>/value=$form->{taxzone_id} selected>/; } } - if ($form->{rowcount} >0) { - $form->{selecttaxzone} =~ /