commit 6d8f12f14d85bd1a445afa13f443bace3ac9a5ff
Author: Moritz Bunkus <m.bunkus@linet.de>
Date:   Tue Jun 2 08:49:27 2009 +0000

    Revisionen und 4167 und 4192:4194 rückgängig gemacht (Kundenauswahl in Rechnungen via Multibox)
    
    Grund: Hat Bug 1022 verursacht. Das ist releasekritisch; muss nach dem
    Release anständig gefixt werden.
    
    Fix für Bug 1022.

diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl
index d53f69958..9bc225e88 100644
--- a/bin/mozilla/is.pl
+++ b/bin/mozilla/is.pl
@@ -354,24 +354,25 @@ sub form_header {
     </tr>|;
 
 
-  $form->{selectcustomer} = $myconfig{vclimit} > scalar(@{ $form->{ALL_CUSTOMERS} });
+  %labels = ();
+  @values = ();
+  foreach my $item (@{ $form->{"ALL_CUSTOMERS"} }) {
+    push(@values, $item->{name}.qq|--|.$item->{"id"});
+    $labels{$item->{name}.qq|--|.$item->{"id"}} = $item->{"name"};
+  }
+
+  $form->{selectcustomer} = ($myconfig{vclimit} > scalar(@values));
 
   my $customers = qq|
       <th align="right">| . $locale->text('Customer') . qq|</th>
-      <td>|
-      . $form->parse_html_template('generic/multibox',
-                                   { 'name'          => 'customer',
-                                     'default'       => $form->{oldcustomer},
-                                     'style'         => 'width: 250px',
-                                     'DATA'          => $form->{ALL_CUSTOMERS},
-                                     'id_sub'        => 'vc_keys',
-                                     'vc_keys'       => sub { "$_[0]->{name}--$_[0]->{id}" },
-                                     'label_key'     => 'name',
-                                     'select'        => 'customer_or_vendor_selection_window(\'customer\', \'\', 0, 0);',
-                                     'limit'         => $myconfig{vclimit},
-                                     'allow_textbox' => 1,
-                                     'onChange'      => "document.getElementById('update_button').click();" })
-      . qq| <input type="button" value="| . $locale->text('Details (one letter abbreviation)') . qq|" onclick="show_vc_details('customer')"></td>|;
+      <td>| .
+        (($myconfig{vclimit} <=  scalar(@values))
+              ? qq|<input type="text" value="| . H($form->{customer}) . qq|" name="customer">|
+              : (NTI($cgi->popup_menu('-name' => 'customer', '-default' => $form->{oldcustomer},
+                             '-onChange' => 'document.getElementById(\'update_button\').click();',
+                             '-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px')))) . qq|
+        <input type="button" value="| . $locale->text('Details (one letter abbreviation)') . qq|" onclick="show_vc_details('customer')">
+      </td>|;
 
   %labels = ();
   @values = ("");
@@ -556,7 +557,7 @@ sub form_header {
     #write Trigger
     $jsscript =
       Form->write_trigger(\%myconfig,     "3",
-                          "invdate",      "BL", "trigger1",
+                          "invdate",      "BL", "trigger1", 
                           "duedate",      "BL", "trigger2",
                           "deliverydate", "BL", "trigger3");
   }
@@ -590,7 +591,7 @@ sub form_header {
 <body onLoad="$onload">
 <script type="text/javascript" src="js/common.js"></script>
 <script type="text/javascript" src="js/delivery_customer_selection.js"></script>
-<script type="text/javascript" src="js/customer_or_vendor_selection.js"></script>
+<script type="text/javascript" src="js/vendor_selection.js"></script>
 <script type="text/javascript" src="js/calculate_qty.js"></script>
 <script type="text/javascript" src="js/follow_up.js"></script>
 
@@ -600,11 +601,11 @@ sub form_header {
   $form->hide_form(qw(id action type media format queued printed emailed title vc discount
                       creditlimit creditremaining tradediscount business closedto locked shipped storno storno_id
                       max_dunning_level dunning_amount
-                      shiptoname shiptostreet shiptozipcode shiptocity shiptocountry  shiptocontact shiptophone shiptofax
+                      shiptoname shiptostreet shiptozipcode shiptocity shiptocountry  shiptocontact shiptophone shiptofax 
                       shiptoemail shiptodepartment_1 shiptodepartment_2 message email subject cc bcc taxaccounts cursor_fokus
                       convert_from_do_ids convert_from_oe_ids),
                       map { $_.'_rate', $_.'_description', $_.'_taxnumber' } split / /, $form->{taxaccounts} );
-
+   
   print qq|<p>$form->{saved_message}</p>| if $form->{saved_message};
 
   print qq|
@@ -699,7 +700,7 @@ if ($form->{type} eq "credit_note") {
 print qq|     <tr>
 		<th align="right" nowrap>| . $locale->text('Credit Note Number') . qq|</th>
 		<td> |.
-	        $cgi->textfield("-name" => "invnumber", "-size" => 11, "-value" => $form->{invnumber}) .
+	        $cgi->textfield("-name" => "invnumber", "-size" => 11, "-value" => $form->{invnumber}) .	
       qq|	</td>
 	      </tr>
 	      <tr>
@@ -710,7 +711,7 @@ print qq|     <tr>
 print qq|     <tr>
 		<th align="right" nowrap>| . $locale->text('Invoice Number') . qq|</th>
 		<td> |.
-	        $cgi->textfield("-name" => "invnumber", "-size" => 11, "-value" => $form->{invnumber}) .
+	        $cgi->textfield("-name" => "invnumber", "-size" => 11, "-value" => $form->{invnumber}) .	
       qq|	</td>
 	      </tr>
 	      <tr>
@@ -724,7 +725,7 @@ print qq|     <tr>
 	      <tr>
 		<th align="right" nowrap>| . $locale->text('Delivery Order Number') . qq|</th>
 		<td> |.
-	        $cgi->textfield("-name" => "donumber", "-size" => 11, "-value" => $form->{donumber}) .
+	        $cgi->textfield("-name" => "donumber", "-size" => 11, "-value" => $form->{donumber}) .	
       qq|	</td>
 	      </tr>
 	      <tr>
@@ -735,7 +736,7 @@ print qq|     <tr>
 print qq|     <tr>
 		<th align="right" nowrap>| . $locale->text('Order Number') . qq|</th>
 		<td> |.
-	        $cgi->textfield("-name" => "ordnumber", "-size" => 11, "-value" => $form->{ordnumber}) .
+	        $cgi->textfield("-name" => "ordnumber", "-size" => 11, "-value" => $form->{ordnumber}) .	
       qq|	</td>
 	      </tr>
         <tr>
@@ -746,7 +747,7 @@ print qq|     <tr>
 	      <tr>
 		<th align="right" nowrap>| . $locale->text('Quotation Number') . qq|</th>
 		<td> |.
-	        $cgi->textfield("-name" => "quonumber", "-size" => 11, "-value" => $form->{quonumber}) .
+	        $cgi->textfield("-name" => "quonumber", "-size" => 11, "-value" => $form->{quonumber}) .	
       qq|	</td>
 	      </tr>
         <tr>
@@ -757,7 +758,7 @@ print qq|     <tr>
 	      <tr>
 		<th align="right" nowrap>| . $locale->text('Customer Order Number') . qq|</th>
 		<td> |.
-	        $cgi->textfield("-name" => "cusordnumber", "-size" => 11, "-value" => $form->{cusordnumber}) .
+	        $cgi->textfield("-name" => "cusordnumber", "-size" => 11, "-value" => $form->{cusordnumber}) .	
       qq|	</td>
 	      </tr>
 	      <tr>
@@ -773,7 +774,7 @@ print qq|     <tr>
   <tr>
     <td>
     </td>
-  </tr>
+  </tr> 
   $jsscript
 |;
   print qq|<input type="hidden" name="webdav" value="$webdav">|;
@@ -1186,10 +1187,10 @@ if ($form->{type} eq "credit_note") {
   	  . qq|"> |;
   }
   # /button for saving history
-
-  # mark_as_paid button
-  if($form->{id} ne "") {
-    print qq|<input type="submit" class="submit" name="action" value="|
+  
+  # mark_as_paid button 
+  if($form->{id} ne "") {  
+    print qq|<input type="submit" class="submit" name="action" value="| 
           . $locale->text('mark as paid') . qq|">|;
   }
   # /mark_as_paid button
@@ -1218,7 +1219,7 @@ sub mark_as_paid {
 
   $auth->assert('invoice_edit');
 
-  &mark_as_paid_common(\%myconfig,"ar");
+  &mark_as_paid_common(\%myconfig,"ar");  
 
   $lxdebug->leave_sub();
 }
@@ -1283,7 +1284,7 @@ sub update {
 
         map { $form->{item_list}[$i]{$_} =~ s/\"/&quot;/g } qw(partnumber description unit);
         map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} } keys %{ $form->{item_list}[0] };
-
+        
         $form->{payment_id}    = $form->{"part_payment_id_$i"} if $form->{"part_payment_id_$i"} ne "";
         $form->{"discount_$i"} = 0                             if $form->{"not_discountable_$i"};
 
