]> wagnertech.de Git - mfinanz.git/blobdiff - bin/mozilla/ar.pl
Projektauswahl in Debitoren- und Kreditorenbuchungen per Drop-Down-Box. Bei der Buchu...
[mfinanz.git] / bin / mozilla / ar.pl
index 291ad068d5eff4b991c0f0221fdc1a8dc3ab75a2..9ca39fdd370d92d09611e893292d74df58bf0235 100644 (file)
@@ -421,6 +421,21 @@ sub form_header {
 |;
   }
 
+  my @old_project_ids = ();
+  map({ push(@old_project_ids, $form->{"project_id_$_"})
+          if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"}));
+
+  $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
+                                   "all" => 0,
+                                   "old_id" => \@old_project_ids });
+
+  my %project_labels = ();
+  my @project_values = ("");
+  foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
+    push(@project_values, $item->{"id"});
+    $project_labels{$item->{"id"}} = $item->{"projectnumber"};
+  }
+
   $form->{fokus} = "arledger.customer";
 
   # use JavaScript Calendar or not
@@ -582,6 +597,12 @@ $jsscript
       qq|<td><select id="taxchart_$i" name="taxchart_$i" style="width:200px">$tax</select></td>|;
     $korrektur_checked = ($form->{"korrektur_$i"} ? 'checked' : '');
 
+    my $projectnumber =
+      NTI($cgi->popup_menu('-name' => "project_id_$i",
+                           '-values' => \@project_values,
+                           '-labels' => \%project_labels,
+                           '-default' => $form->{"project_id_$i"} ));
+
     print qq|
        <tr>
           <td width=50%><select name="AR_amount_$i" onChange="setTaxkey(this, $i)" style="width:100%">$selectAR_amount</select></td>
@@ -589,9 +610,7 @@ $jsscript
           <td><input name="tax_$i" size=10 value=$form->{"tax_$i"}></td>
           <td><input type="checkbox" name="korrektur_$i" value="1" $korrektur_checked></td>
           $tax
-         <td><input name="projectnumber_$i" size=20 value="$form->{"projectnumber_$i"}">
-             <input type=hidden name="project_id_$i" value=$form->{"project_id_$i"}>
-             <input type=hidden name="oldprojectnumber_$i" value="$form->{"oldprojectnumber_$i"}"></td>
+          <td>$projectnumber</td>
        </tr>
 |;
     $amount  = "";
@@ -870,8 +889,6 @@ sub update {
   &check_name(customer);
   $form->{AR} = $save_AR;
 
-  &check_project;
-
   $form->{invtotal} =
     ($form->{taxincluded}) ? $form->{invtotal} : $form->{invtotal} + $totaltax;