Bug bei Behandlung der 'alten' Variablenwerte in die neuen Variablennamen
[kivitendo-erp.git] / bin / mozilla / oe.pl
index 482b4c7..6c410c1 100644 (file)
@@ -115,6 +115,7 @@ sub order_links {
   # retrieve order/quotation
   $form->{webdav} = $webdav;
 
+
   # set jscalendar
   $form->{jscalendar} = $jscalendar;
 
@@ -220,6 +221,23 @@ sub prepare_order {
         qw(partnumber description unit);
       $form->{rowcount} = $i;
     }
+  } elsif ($form->{rowcount}) {
+    for my $i (1 .. $form->{rowcount}) {
+       $form->{"discount_$i"} =
+        $form->format_amount(\%myconfig, $form->{"discount_$i"} * 100);
+
+      ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
+      $dec           = length $dec;
+      $decimalplaces = ($dec > 2) ? $dec : 2;
+
+      $form->{"sellprice_$i"} =
+        $form->format_amount(\%myconfig, $form->{"sellprice_$i"},
+                             $decimalplaces);
+      $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"});
+
+      map { $form->{"${_}_$i"} =~ s/\"/"/g }
+        qw(partnumber description unit);
+    }
   }
 
   $lxdebug->leave_sub();
@@ -961,7 +979,7 @@ sub update {
         IS->get_pricegroups_for_parts(\%myconfig, \%$form);
 
         # build up html code for prices_$i
-        set_pricegroup();
+        &set_pricegroup($i);
       }
 
       &display_form;
@@ -987,6 +1005,8 @@ sub update {
       }
     }
   }
+
+
   $lxdebug->leave_sub();
 }