Bugfix Tabindex in Kundenerfassenmaske fuer Preisgruppe
[kivitendo-erp.git] / bin / mozilla / ic.pl
index f6134db..b2a4da6 100644 (file)
@@ -33,6 +33,7 @@
 #$locale->text('ea');
 
 use SL::IC;
+
 #use SL::PE;
 
 require "$form->{path}/io.pl";
@@ -355,6 +356,8 @@ sub search {
     . $locale->text('Subtotal') . qq|</td>
                <td><input name=l_soldtotal class=checkbox type=checkbox value=Y>&nbsp;|
     . $locale->text('soldtotal') . qq|</td>
+               <td><input name=l_deliverydate class=checkbox type=checkbox value=Y>&nbsp;|
+    . $locale->text('deliverydate') . qq|</td>    
              </tr>
             </table>
           </td>
@@ -1418,8 +1421,12 @@ sub generate_report {
     $option   .= $locale->text('soldtotal') . qq| : $form->{soldtotal}<br>|;
   }
 
+  if ($form->{l_deliverydate}) {
+    $callback .= "&deliverydate=$form->{deliverydate}";
+  }
+
   @columns = $form->sort_columns(
-    qw(partnumber description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber quonumber name serialnumber soldtotal)
+    qw(partnumber description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber quonumber name serialnumber soldtotal deliverydate)
   );
 
   if ($form->{l_linetotal}) {
@@ -1556,6 +1563,11 @@ sub generate_report {
     . $locale->text('soldtotal')
     . qq|</a></th>|;
 
+  $column_header{deliverydate} =
+    qq|<th nowrap><a class=listheading href=$callback&sort=deliverydate&revers=$form->{revers}&lastsort=$form->{lastsort}>|
+    . $locale->text('deliverydate')
+    . qq|</a></th>|;
+
   $form->header;
   $colspan = $#column_index + 1;
 
@@ -1707,6 +1719,8 @@ sub generate_report {
       . $form->format_amount(\%myconfig, $ref->{soldtotal}, '', "&nbsp;")
       . "</td>";
 
+    $column_data{deliverydate} = "<td>$ref->{deliverydate}</td>";
+
     $i++;
     $i %= 2;
     print "<tr class=listrow$i>";
@@ -1934,7 +1948,7 @@ sub form_header {
   $lxdebug->enter_sub();
 
   my $dec = '';
-  
+
   #decimalplaces for listprice
   ($dec) = ($form->{listprice} =~ /\.(\d+)/);
   $dec = length $dec;
@@ -2045,7 +2059,7 @@ sub form_header {
                <input name=selectIC_income type=hidden value="$form->{selectIC_income}">
              </tr>
              <tr>
-               <th align=right>| . $locale->text('COGS') . qq|</th>
+               <th align=right>| . $locale->text('Expense') . qq|</th>
                <td><select name=IC_expense>$form->{selectIC_expense}</select></td>
                <input name=selectIC_expense type=hidden value="$form->{selectIC_expense}">
              </tr>
@@ -2611,6 +2625,8 @@ sub assembly_row {
 
     $column_data{total} = qq|<td align=right>$linetotal</td>|;
 
+    $column_data{deliverydate} = qq|<td align=right>$deliverydate</td>|;
+
     print qq|
         <tr>|;
 
@@ -2699,9 +2715,12 @@ sub update {
 sub save {
   $lxdebug->enter_sub();
 
-  # check if there is a part number
+  # check if there is a part number - commented out, cause there is an automatic allocation of numbers
   # $form->isblank("partnumber", $locale->text(ucfirst $form->{item}." Part Number missing!"));
 
+  # check if there is a description
+  $form->isblank("description", $locale->text("Part Description missing!"));
+
   if ($form->{obsolete}) {
     $form->error(
       $locale->text(
@@ -2718,7 +2737,8 @@ sub save {
   # $locale->text('Assembly Number missing!')
 
   # save part
-  $lxdebug->message(LXDebug::DEBUG1, "ic.pl: sellprice in save = $form->{sellprice}\n");
+  $lxdebug->message(LXDebug::DEBUG1,
+                    "ic.pl: sellprice in save = $form->{sellprice}\n");
   $rc = IC->save(\%myconfig, \%$form);
   if ($rc == 3) {
     $form->error($locale->text('Partnumber not unique!'));
@@ -2776,7 +2796,9 @@ sub save {
       if ($form->{exchangerate} != 0) {
         $form->{"sellprice_$i"} /= $form->{exchangerate};
       }
-      $lxdebug->message(LXDebug::DEBUG1, qq|sellprice_$i in previousform 2 = |.$form->{"sellprice_$i"}.qq|\n|);
+      $lxdebug->message(LXDebug::DEBUG1,
+                        qq|sellprice_$i in previousform 2 = |
+                          . $form->{"sellprice_$i"} . qq|\n|);
       map { $form->{"taxaccounts_$i"} .= "$_ " } split / /,
         $newform{taxaccount};
       chop $form->{"taxaccounts_$i"};
@@ -2797,10 +2819,12 @@ sub save {
 
       $form->{creditremaining} -= $amount;
 
-    # redo number formatting, because invoice parse them!
-    $i = $form->{rowcount};
-    map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}) }
-    qw(weight listprice sellprice rop);
+      # redo number formatting, because invoice parse them!
+      $i = $form->{rowcount};
+      map {
+        $form->{"${_}_$i"} =
+          $form->format_amount(\%myconfig, $form->{"${_}_$i"})
+      } qw(weight listprice sellprice rop);
     }
 
     $form->{"id_$i"} = $parts_id;
@@ -2822,7 +2846,10 @@ sub save {
     }
     $form->{callback} = $callback;
   }
-  $lxdebug->message(LXDebug::DEBUG1, qq|ic.pl: sellprice_$i nach sub save = |.$form->{"sellprice_$i"}.qq|\n|);
+  $lxdebug->message(LXDebug::DEBUG1,
+                    qq|ic.pl: sellprice_$i nach sub save = |
+                      . $form->{"sellprice_$i"} . qq|\n|);
+
   # redirect
   $form->redirect;