Preisgruppen Kommentar entfernt, nach Perltidy formatiert
[kivitendo-erp.git] / SL / OE.pm
index 334355d..ac507d0 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -182,6 +182,7 @@ sub save {
     $query = qq|DELETE FROM shipto
                 WHERE trans_id = $form->{id}|;
     $dbh->do($query) || $form->dberror($query);
+    $delete_oe_id = 0;
 
   } else {
 
@@ -199,6 +200,7 @@ sub save {
                 WHERE o.ordnumber = '$uid'|;
     $sth = $dbh->prepare($query);
     $sth->execute || $form->dberror($query);
+    $delete_oe_id = 1;
 
     ($form->{id}) = $sth->fetchrow_array;
     $sth->finish;
@@ -225,6 +227,9 @@ sub save {
     map {
       $form->{"${_}_$i"} = $form->parse_amount($myconfig, $form->{"${_}_$i"})
     } qw(qty ship);
+    if ($delete_oe_id) {
+      $form->{"orderitems_id_$i"} = "";
+    }
 
     if ($form->{"qty_$i"}) {
 
@@ -313,6 +318,7 @@ sub save {
 
       # get pricegroup_id and save ist
       ($null, my $pricegroup_id) = split /--/, $form->{"sellprice_drag_$i"};
+      $pricegroup_id *= 1;
 
       # save detail record in orderitems table
       $query = qq|INSERT INTO orderitems (|;
@@ -856,6 +862,9 @@ sub order_details {
         }
       }
 
+      $tax_rate = $taxrate*100;
+      push(@{ $form->{tax_rate} }, qq|$tax_rate|);
+
       if ($form->{"assembly_$i"}) {
         $sameitem = "";