Preisgruppen: Bei Zeilen mit noch nicht zugewiesenem Artikel wird gar keine Drop...
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 24 Nov 2006 14:38:44 +0000 (14:38 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 24 Nov 2006 14:38:44 +0000 (14:38 +0000)
SL/IS.pm
SL/OE.pm
bin/mozilla/io.pl
locale/de/all
locale/de/cn
locale/de/dn
locale/de/ic
locale/de/io
locale/de/ir
locale/de/is
locale/de/oe

index 686f864..6656434 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;
 
@@ -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"};
               }
             }
index 2e5c8d6..7813f33 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -351,7 +351,7 @@ sub save {
         ($form->{"reqdate_$i"}) ? qq|'$form->{"reqdate_$i"}'| : "NULL";
 
       # get pricegroup_id and save ist
-      ($null, my $pricegroup_id) = split /--/, $form->{"sellprice_drag_$i"};
+      ($null, my $pricegroup_id) = split /--/, $form->{"sellprice_pg_$i"};
       $pricegroup_id *= 1;
       $subtotal = $form->{"subtotal_$i"} * 1;
 
index b88d36d..bbdbeaf 100644 (file)
@@ -112,7 +112,7 @@ sub display_row {
       or (($form->{level} =~ /Sales/) and ($form->{type} =~ /invoice/))
       or (($form->{level} eq undef) and ($form->{type} =~ /invoice/))
       or ($form->{type} =~ /sales_order/)) {
-    push @column_index, qw(sellprice_drag);
+    push @column_index, qw(sellprice_pg);
   }
 
   push @column_index, qw(sellprice);
@@ -172,7 +172,7 @@ sub display_row {
       qq|<th align=left nowrap width=15 class=listheading>|
     . $locale->text('Price')
     . qq|</th>|;
-  $column_data{sellprice_drag} =
+  $column_data{sellprice_pg} =
       qq|<th align=left nowrap width=15 class=listheading>|
     . $locale->text('Pricegroup')
     . qq|</th>|;
@@ -329,7 +329,7 @@ sub display_row {
                             $is_assigned ? $form->{"unit_$i"} : undef))
       . "</td>";
 
-    # build in dragdrop for pricesgroups
+    # build in drop down list for pricesgroups
     if ($form->{"prices_$i"}) {
       if  ($form->{"new_pricegroup_$i"} != $form->{"old_pricegroup_$i"}) {
         $price_tmp = $form->format_amount(\%myconfig, $form->{"price_new_$i"}, $decimalplaces);
@@ -337,31 +337,27 @@ sub display_row {
         $price_tmp = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces);
       }
 
-      $column_data{sellprice_drag} =
-        qq|<td align=right><select name="sellprice_drag_$i">$form->{"prices_$i"}</select></td>|;
+      $column_data{sellprice_pg} =
+        qq|<td align=right><select name="sellprice_pg_$i">$form->{"prices_$i"}</select></td>|;
       $column_data{sellprice} =
         qq|<td><input name="sellprice_$i" size=10 value=$price_tmp></td>|;
     } else {
 
       # for last row and report
-      # set pricegroup dragdrop from report menu
+      # set pricegroup drop down list from report menu
       if ($form->{"sellprice_$i"} != 0) {
         $prices =
           qq|<option value="$form->{"sellprice_$i"}--$form->{"pricegroup_id_$i"}" selected>$form->{"pricegroup_$i"}</option>\n|;
 
         $form->{"pricegroup_old_$i"} = $form->{"pricegroup_id_$i"};
 
-        $column_data{sellprice_drag} =
-          qq|<td align=right><select name="sellprice_drag_$i">$prices</select></td>|;
+        $column_data{sellprice_pg} =
+          qq|<td align=right><select name="sellprice_pg_$i">$prices</select></td>|;
 
       } else {
 
         # for last row
-        $column_data{sellprice_drag} =
-          qq|<td align=right><input name="sellprice_$i" size=9 value=|
-          . $form->format_amount(\%myconfig, $form->{"prices_$i"},
-                                 $decimalplaces)
-          . qq|></td>|;
+        $column_data{sellprice_pg} = qq|<td align=right>&nbsp;</td>|;
       }
 
       $column_data{sellprice} =
@@ -504,13 +500,16 @@ sub display_row {
 # build html-code for pricegroups in variable $form->{prices_$j}
 
 sub set_pricegroup {
-  my $rowcount = shift;
   $lxdebug->enter_sub();
+  my $rowcount = shift;
+  $lxdebug->dump(0, "holy luja!", $form->{PRICES});
   for $j (1 .. $rowcount) {
     my $pricegroup_old = $form->{"pricegroup_old_$i"};
+    $lxdebug->message(0, "klaus1 for j $j");
     if ($form->{PRICES}{$j}) {
+      $lxdebug->message(0, "klaus2");
       $len    = 0;
-      $prices = '';
+      $prices = '<option value="--">' . $locale->text("none (pricegroup)") . '</option>';
       $price  = 0;
       foreach $item (@{ $form->{PRICES}{$j} }) {
 
@@ -520,7 +519,7 @@ sub set_pricegroup {
         $pricegroup_id = $item->{pricegroup_id};
         $pricegroup    = $item->{pricegroup};
 
-        # build dragdrop for pricegroups
+        # build drop down list for pricegroups
         $prices .=
           qq|<option value="$price--$pricegroup_id"$item->{selected}>$pricegroup</option>\n|;
 
@@ -540,10 +539,8 @@ sub set_pricegroup {
         if ($pricegroup_id == 0) {
           $form->{"price_new_$j"} = $form->{"sellprice_$j"};
         }
-        if ($len > 1) {
-          $form->{"prices_$j"} = $prices;
-        }
       }
+      $form->{"prices_$j"} = $prices;
     }
   }
   $lxdebug->leave_sub();
index 9973da2..28ad31b 100644 (file)
@@ -1092,6 +1092,7 @@ gestartet',
   'list'                        => 'auflisten',
   'localhost'                   => 'lokaler Rechner',
   'month'                       => 'monatliche Abgabe',
+  'none (pricegroup)'           => 'keine',
   'number'                      => 'Nummer',
   'posted!'                     => 'gebucht',
   'prices updated!'             => ' Preise aktualisiert!',
index 2a2484c..4147e6b 100644 (file)
@@ -179,6 +179,7 @@ $self{texts} = {
   'button'                      => '?',
   'ea'                          => 'St.',
   'emailed to'                  => 'gemailt an',
+  'none (pricegroup)'           => 'keine',
   'posted!'                     => 'gebucht',
   'sent'                        => 'gesendet',
   'sent to printer'             => 'an Drucker geschickt',
index 478c616..4f7068f 100644 (file)
@@ -171,6 +171,7 @@ gestartet',
   'eMail Send?'                 => 'eMail-Versand?',
   'eMail?'                      => 'eMail?',
   'emailed to'                  => 'gemailt an',
+  'none (pricegroup)'           => 'keine',
   'sent'                        => 'gesendet',
   'sent to printer'             => 'an Drucker geschickt',
 };
index b5346ae..d9dc721 100644 (file)
@@ -218,6 +218,7 @@ aktualisieren wollen?',
   'ea'                          => 'St.',
   'emailed to'                  => 'gemailt an',
   'list'                        => 'auflisten',
+  'none (pricegroup)'           => 'keine',
   'number'                      => 'Nummer',
   'prices updated!'             => ' Preise aktualisiert!',
   'sent'                        => 'gesendet',
index f3b7c37..a7a413b 100644 (file)
@@ -114,6 +114,7 @@ $self{texts} = {
   'What type of item is this?'  => 'Was ist dieser Artikel?',
   'Zipcode'                     => 'PLZ',
   'emailed to'                  => 'gemailt an',
+  'none (pricegroup)'           => 'keine',
   'sent'                        => 'gesendet',
   'sent to printer'             => 'an Drucker geschickt',
 };
index 1f54d75..626ac7c 100644 (file)
@@ -169,6 +169,7 @@ $self{texts} = {
   'button'                      => '?',
   'ea'                          => 'St.',
   'emailed to'                  => 'gemailt an',
+  'none (pricegroup)'           => 'keine',
   'posted!'                     => 'gebucht',
   'sent'                        => 'gesendet',
   'sent to printer'             => 'an Drucker geschickt',
index a6b765c..7c1d80a 100644 (file)
@@ -194,6 +194,7 @@ $self{texts} = {
   'button'                      => '?',
   'ea'                          => 'St.',
   'emailed to'                  => 'gemailt an',
+  'none (pricegroup)'           => 'keine',
   'posted!'                     => 'gebucht',
   'sent'                        => 'gesendet',
   'sent to printer'             => 'an Drucker geschickt',
index 9a4236b..e067681 100644 (file)
@@ -232,6 +232,7 @@ $self{texts} = {
   'days'                        => 'Tage',
   'ea'                          => 'St.',
   'emailed to'                  => 'gemailt an',
+  'none (pricegroup)'           => 'keine',
   'saved!'                      => 'gespeichert',
   'sent'                        => 'gesendet',
   'sent to printer'             => 'an Drucker geschickt',