is: Payment_terms und duedate ajax gefixt.
authorSven Schöling <s.schoeling@linet-services.de>
Fri, 30 Oct 2009 15:39:52 +0000 (16:39 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Fri, 30 Oct 2009 15:39:52 +0000 (16:39 +0100)
bin/mozilla/is.pl
templates/webpages/is/form_footer_de.html
templates/webpages/is/form_footer_master.html

index 0567e67..530c477 100644 (file)
@@ -45,7 +45,7 @@ require "bin/mozilla/drafts.pl";
 use strict;
 
 my $edit;
-my $payment;
+#my $payment;
 my $print_post;
 
 1;
@@ -289,15 +289,6 @@ sub form_header {
   $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
   $form->{radier}          = ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0;
 
-  $payment = qq|<option value=""></option>|;
-  foreach my $item (@{ $form->{payment_terms} }) {
-    if ($form->{payment_id} eq $item->{id}) {
-      $payment .= qq|<option value="$item->{id}" selected>$item->{description}</option>|;
-    } else {
-      $payment .= qq|<option value="$item->{id}">$item->{description}</option>|;
-    }
-  }
-
   my $set_duedate_url = "$form->{script}?action=set_duedate";
 
   push @ { $form->{AJAX} }, new CGI::Ajax( 'set_duedate' => $set_duedate_url );
index a96a904..7e2a7a3 100644 (file)
           <textarea name="intnotes" rows="[% rows %]" cols="35" wrap="soft">[% intnotes %]</textarea>
          </td>
          <td>
-          <select id='payment_id' name="payment_id">
-
-           $payment
-
-          </select>
-          <script type='text/javascript'>$('#payment_id').onchange(function(){
+            [%- INCLUDE 'generic/multibox.html'
+                 name          = 'payment_id',
+                 style         = 'width: 250px',
+                 DATA          = payment_terms,
+                 id_key        = 'id',
+                 label_key     = 'description',
+                 show_empty    = 1
+                 allow_textbox = 0 -%]
+          <script type='text/javascript'>$('#payment_id').change(function(){
             if (this.value) set_duedate(['payment_id__' + this.value, 'invdate__' + invdate.value],['duedate'])})
           </script>
          </td>
index b1719f4..a3d53fd 100644 (file)
           <textarea name="intnotes" rows="[% rows %]" cols="35" wrap="soft">[% intnotes %]</textarea>
          </td>
          <td>
-          <select id='payment_id' name="payment_id">
-
-           $payment
-
-          </select>
-          <script type='text/javascript'>$('#payment_id').onchange(function(){
+            [%- INCLUDE 'generic/multibox.html'
+                 name          = 'payment_id',
+                 style         = 'width: 250px',
+                 DATA          = payment_terms,
+                 id_key        = 'id',
+                 label_key     = 'description',
+                 show_empty    = 1
+                 allow_textbox = 0 -%]
+          <script type='text/javascript'>$('#payment_id').change(function(){
             if (this.value) set_duedate(['payment_id__' + this.value, 'invdate__' + invdate.value],['duedate'])})
           </script>
          </td>