2 Sicherheitschecks.
[kivitendo-erp.git] / bin / mozilla / ic.pl
index 2922cfa..f2ca8a9 100644 (file)
@@ -270,7 +270,7 @@ sub list {
   for ($j = 1; $j <= $i; $j++) {
 
     print qq|
-        <tr class=listrow1>|;
+        <tr class=listrow| . ($j % 2) . qq|>|;
     if ($j == 1) {
       print qq|
            <td><input name=ndx class=radio type=radio value=$j checked></td>|;
@@ -752,8 +752,8 @@ sub addtop100 {
     }    #rof
   }    #fi
        # build data for columns
+  my $i = 0;
   foreach my $ref (@{ $form->{parts} }) {
-    my $i = 0;
 
     if ($form->{l_subtotal} eq 'Y' && !$ref->{assemblyitem}) {
       if ($sameitem ne $ref->{ $form->{sort} }) {
@@ -1473,7 +1473,7 @@ sub form_header {
   $form->{notes_rows} = $rows;
 
   IC->retrieve_buchungsgruppen(\%myconfig, $form);
-  @{ $form->{BUCHUNGSGRUPPEN} } = grep { $_->{id} eq $form->{buchungsgruppen_id} || ($form->{id} && $form->{orphaned}) || $form->{id} } @{ $form->{BUCHUNGSGRUPPEN} };
+  @{ $form->{BUCHUNGSGRUPPEN} } = grep { $_->{id} eq $form->{buchungsgruppen_id} || ($form->{id} && $form->{orphaned}) || !$form->{id} } @{ $form->{BUCHUNGSGRUPPEN} };
 
   # use JavaScript Calendar or not (yes!)
   $form->{jsscript} = 1;
@@ -1954,6 +1954,8 @@ sub save {
 
       map { $form->{"${_}_$i"} = $newform{$_} } qw(partnumber description bin unit listprice inventory_accno income_accno expense_accno sellprice lastcost price_factor_id);
 
+      $form->{"longdescription_$i"} = $newform{notes};
+
       $form->{"sellprice_$i"} = $newform{lastcost} if ($form->{vendor_id});
 
       if ($form->{exchangerate} != 0) {
@@ -2067,30 +2069,13 @@ sub price_row {
 
   my ($numrows) = @_;
 
-  print qq|
-  <tr>
-    <td>
-      <table width=100%>
-        <tr>
-          <th class="listheading">| . $locale->text('Preisklasse') . qq|</th>
-          <th class="listheading">| . $locale->text('Preis') . qq|</th>
-        </tr>
-|;
-  for my $i (1 .. $numrows) {
-    print qq|
-        <tr>
-          <td width=50%><input type=hidden name="pricegroup_$i" size=30  value="$form->{"pricegroup_$i"}">$form->{"pricegroup_$i"}</td>
-          <td width=50%><input name="price_$i" size=11 value="$form->{"price_$i"}"></td>
-          <input type=hidden name="pricegroup_id_$i" value="$form->{"pricegroup_id_$i"}">
-        </tr>
-|;
-  }
+  my @PRICES = map +{
+    pricegroup    => $form->{"pricegroup_$_"},
+    pricegroup_id => $form->{"pricegroup_id_$_"},
+    price         => $form->{"price_$_"},
+  }, 1 .. $numrows;
 
-  print qq|
-      </table>
-    </td>
-  </tr>
-|;
+  print $form->parse_html_template('ic/price_row', { PRICES => \@PRICES });
 
   $lxdebug->leave_sub();
 }