Kundenquelle (Leads) eingeführt
[kivitendo-erp.git] / SL / IS.pm
index 686f864..7c9d218 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -685,8 +685,8 @@ sub post_invoice {
         ? qq|'$form->{"deliverydate_$i"}'|
         : "NULL";
 
-      # get pricegroup_id and save ist
-      ($null, my $pricegroup_id) = split /--/, $form->{"sellprice_drag_$i"};
+      # get pricegroup_id and save it
+      ($null, my $pricegroup_id) = split /--/, $form->{"sellprice_pg_$i"};
       $pricegroup_id *= 1;
       my $subtotal = $form->{"subtotal_$i"} * 1;
 
@@ -1806,7 +1806,7 @@ sub get_customer {
   $sth->finish;
 
   # get shipping addresses
-  $query = qq|SELECT s.id,s.shiptoname
+  $query = qq|SELECT s.shipto_id,s.shiptoname,s.shiptodepartment_1
               FROM shipto s
              WHERE s.trans_id = $form->{customer_id}|;
   $sth = $dbh->prepare($query);
@@ -2062,12 +2062,15 @@ sub get_pricegroups_for_parts {
 
   my $dbh = $form->dbconnect($myconfig);
 
+  $form->{"PRICES"} = {};
+
   my $i  = 1;
   my $id = 0;
   my $dimension_units = AM->retrieve_units($myconfig, $form, "dimension");
   my $service_units = AM->retrieve_units($myconfig, $form, "service");
   my $all_units = AM->retrieve_units($myconfig, $form);
   while (($form->{"id_$i"}) or ($form->{"new_id_$i"})) {
+    $form->{"PRICES"}{$i} = [];
 
     $id = $form->{"id_$i"};
 
@@ -2077,7 +2080,7 @@ sub get_pricegroups_for_parts {
     }
 
     ($price, $selectedpricegroup_id) = split /--/,
-      $form->{"sellprice_drag_$i"};
+      $form->{"sellprice_pg_$i"};
 
     $pricegroup_old = $form->{"pricegroup_old_$i"};
     $form->{"new_pricegroup_$i"} = $selectedpricegroup_id;
@@ -2183,7 +2186,7 @@ sub get_pricegroups_for_parts {
                   and ($pkr->{price} == $form->{"sellprice_$i"})) {
 
                 # $pkr->{price}                         = $form->{"sellprice_$i"};
-                  } else {
+              } else {
                 $pkr->{price} = $form->{"sellprice_$i"};
               }
             }