Bei Dienstleistungen auch den Einkaufspreis parsen, wenn auf "Erneuern" gedrückt...
[kivitendo-erp.git] / bin / mozilla / ic.pl
index d190a48..7ecd3a2 100644 (file)
@@ -185,7 +185,7 @@ sub search {
                <td width=5%>&nbsp;</td>
                <th>| . $locale->text('From') . qq|</th>
                 $button1
-               <th>| . $locale->text('To') . qq|</th>
+               <th>| . $locale->text('To (time)') . qq|</th>
                 $button2
              </tr>
            </table>
@@ -235,7 +235,7 @@ sub search {
                    <tr>
                      <th>| . $locale->text('From') . qq|</th>
                      $button1
-                     <th>| . $locale->text('To') . qq|</th>
+                     <th>| . $locale->text('To (time)') . qq|</th>
                      $button2
                    </tr>
                  </table>
@@ -269,6 +269,8 @@ sub search {
         <tr>
           <th align=right nowrap>| . $locale->text('Part Number') . qq|</th>
           <td><input name=partnumber size=20></td>
+          <th align=right nowrap>| . $locale->text('EAN') . qq|</th>
+          <td><input name=ean size=20></td>
         </tr>
         <tr>
           <th align=right nowrap>|
@@ -313,7 +315,7 @@ sub search {
           <td colspan=3>
             <table>
               <tr>
-                <td><input name=l_partnumber class=checkbox type=checkbox value=Y>&nbsp;|
+                <td><input name=l_partnumber class=checkbox type=checkbox value=Y checked>&nbsp;|
     . $locale->text('Part Number') . qq|</td>
                <td><input name=l_description class=checkbox type=checkbox value=Y checked>&nbsp;|
     . $locale->text('Part Description') . qq|</td>
@@ -395,7 +397,6 @@ $jsscript
   $lxdebug->leave_sub();
 }    #end search()
 
-
 sub search_update_prices {
   $lxdebug->enter_sub();
 
@@ -1028,6 +1029,10 @@ sub addtop100 {
     $callback .= "&partnumber=$form->{partnumber}";
     $option   .= $locale->text('Part Number') . qq| : $form->{partnumber}<br>|;
   }
+  if ($form->{ean}) {
+    $callback .= "&partnumber=$form->{ean}";
+    $option   .= $locale->text('EAN') . qq| : $form->{ean}<br>|;
+  }
   if ($form->{partsgroup}) {
     $callback .= "&partsgroup=$form->{partsgroup}";
     $option   .= $locale->text('Group') . qq| : $form->{partsgroup}<br>|;
@@ -1067,7 +1072,7 @@ sub addtop100 {
   }
 
   @columns = $form->sort_columns(
-    qw(number 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(number partnumber ean description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber quonumber name serialnumber soldtotal)
   );
 
   if ($form->{l_linetotal}) {
@@ -1303,7 +1308,7 @@ sub addtop100 {
 
     $column_data{number} =
         "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{number}, '', "&nbsp;")
+      . $form->format_amount(\%myconfig, $ref->{number})
       . "</td>";
     $column_data{partnumber} =
       "<td align=$align>$ref->{partnumber}&nbsp;</a></td>";
@@ -1312,32 +1317,29 @@ sub addtop100 {
 
     $column_data{onhand} =
         "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{onhand}, '', "&nbsp;")
+      . $form->format_amount(\%myconfig, $ref->{onhand})
       . "</td>";
     $column_data{sellprice} =
         "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{sellprice}, 2, "&nbsp;")
+      . $form->format_amount(\%myconfig, $ref->{sellprice})
       . "</td>";
     $column_data{listprice} =
         "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{listprice}, 2, "&nbsp;")
+      . $form->format_amount(\%myconfig, $ref->{listprice})
       . "</td>";
     $column_data{lastcost} =
         "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{lastcost}, 2, "&nbsp;")
+      . $form->format_amount(\%myconfig, $ref->{lastcost})
       . "</td>";
 
     $column_data{linetotalsellprice} = "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{sellprice},
-                             2, "&nbsp;")
+      . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{sellprice}, 2)
       . "</td>";
     $column_data{linetotallastcost} = "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{lastcost},
-                             2, "&nbsp;")
+      . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{lastcost}, 2)
       . "</td>";
     $column_data{linetotallistprice} = "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{listprice},
-                             2, "&nbsp;")
+      . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{listprice}, 2)
       . "</td>";
 
     if (!$ref->{assemblyitem}) {
@@ -1353,10 +1355,10 @@ sub addtop100 {
 
     $column_data{rop} =
       "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{rop}, '', "&nbsp;") . "</td>";
+      . $form->format_amount(\%myconfig, $ref->{rop}) . "</td>";
     $column_data{weight} =
         "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{weight}, '', "&nbsp;")
+      . $form->format_amount(\%myconfig, $ref->{weight})
       . "</td>";
     $column_data{unit}        = "<td>$ref->{unit}&nbsp;</td>";
     $column_data{bin}         = "<td>$ref->{bin}&nbsp;</td>";
@@ -1413,15 +1415,15 @@ sub addtop100 {
     map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
     $column_data{linetotalsellprice} =
         "<th class=listtotal align=right>"
-      . $form->format_amount(\%myconfig, $totalsellprice, 2, "&nbsp;")
+      . $form->format_amount(\%myconfig, $totalsellprice, 2)
       . "</th>";
     $column_data{linetotallastcost} =
         "<th class=listtotal align=right>"
-      . $form->format_amount(\%myconfig, $totallastcost, 2, "&nbsp;")
+      . $form->format_amount(\%myconfig, $totallastcost, 2)
       . "</th>";
     $column_data{linetotallistprice} =
         "<th class=listtotal align=right>"
-      . $form->format_amount(\%myconfig, $totallistprice, 2, "&nbsp;")
+      . $form->format_amount(\%myconfig, $totallistprice, 2)
       . "</th>";
 
     print "<tr class=listtotal>";
@@ -1471,14 +1473,8 @@ sub addtop100 {
     <input type=hidden name=ndxs_counter value="$form->{ndxs_counter}">
 
     <input class=submit type=submit name=action value="|
-    . $locale->text('choice') . qq|">|;
-
-  if ($form->{menubar}) {
-    require "$form->{path}/menu.pl";
-    &menubar;
-  }
+    . $locale->text('choice') . qq|">
 
-  print qq|
   </form>
 
 </body>
@@ -1596,7 +1592,7 @@ sub generate_report {
     if ($form->{transdateto}) {
       $callback .= "&transdateto=$form->{transdateto}";
       $option   .= "\n<br>"
-        . $locale->text('To')
+        . $locale->text('To (time)')
         . "&nbsp;"
         . $locale->date(\%myconfig, $form->{transdateto}, 1);
     }
@@ -1861,32 +1857,29 @@ sub generate_report {
 
     $column_data{onhand} =
         "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{onhand}, '', "&nbsp;")
+      . $form->format_amount(\%myconfig, $ref->{onhand})
       . "</td>";
     $column_data{sellprice} =
         "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{sellprice}, 2, "&nbsp;")
+      . $form->format_amount(\%myconfig, $ref->{sellprice}, -2)
       . "</td>";
     $column_data{listprice} =
         "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{listprice}, 2, "&nbsp;")
+      . $form->format_amount(\%myconfig, $ref->{listprice}, -2)
       . "</td>";
     $column_data{lastcost} =
         "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{lastcost}, 2, "&nbsp;")
+      . $form->format_amount(\%myconfig, $ref->{lastcost}, -2)
       . "</td>";
 
     $column_data{linetotalsellprice} = "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{sellprice},
-                             2, "&nbsp;")
+      . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{sellprice}, 2)
       . "</td>";
     $column_data{linetotallastcost} = "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{lastcost},
-                             2, "&nbsp;")
+      . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{lastcost}, 2)
       . "</td>";
     $column_data{linetotallistprice} = "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{listprice},
-                             2, "&nbsp;")
+      . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{listprice}, 2)
       . "</td>";
 
     if (!$ref->{assemblyitem}) {
@@ -1902,10 +1895,10 @@ sub generate_report {
 
     $column_data{rop} =
       "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{rop}, '', "&nbsp;") . "</td>";
+      . $form->format_amount(\%myconfig, $ref->{rop}) . "</td>";
     $column_data{weight} =
         "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{weight}, '', "&nbsp;")
+      . $form->format_amount(\%myconfig, $ref->{weight})
       . "</td>";
     $column_data{unit}        = "<td>$ref->{unit}&nbsp;</td>";
     $column_data{bin}         = "<td>$ref->{bin}&nbsp;</td>";
@@ -1943,7 +1936,7 @@ sub generate_report {
 
     $column_data{soldtotal} =
         "<td align=right>"
-      . $form->format_amount(\%myconfig, $ref->{soldtotal}, '', "&nbsp;")
+      . $form->format_amount(\%myconfig, $ref->{soldtotal})
       . "</td>";
 
     $column_data{deliverydate} = "<td>$ref->{deliverydate}</td>";
@@ -1968,15 +1961,15 @@ sub generate_report {
     map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
     $column_data{linetotalsellprice} =
         "<th class=listtotal align=right>"
-      . $form->format_amount(\%myconfig, $totalsellprice, 2, "&nbsp;")
+      . $form->format_amount(\%myconfig, $totalsellprice, 2)
       . "</th>";
     $column_data{linetotallastcost} =
         "<th class=listtotal align=right>"
-      . $form->format_amount(\%myconfig, $totallastcost, 2, "&nbsp;")
+      . $form->format_amount(\%myconfig, $totallastcost, 2)
       . "</th>";
     $column_data{linetotallistprice} =
         "<th class=listtotal align=right>"
-      . $form->format_amount(\%myconfig, $totallistprice, 2, "&nbsp;")
+      . $form->format_amount(\%myconfig, $totallistprice, 2)
       . "</th>";
 
     print "<tr class=listtotal>";
@@ -2009,14 +2002,8 @@ sub generate_report {
 
   print qq|
   <input class=submit type=submit name=action value="|
-    . $locale->text('Add') . qq|">|;
+    . $locale->text('Add') . qq|">
 
-  if ($form->{menubar}) {
-    require "$form->{path}/menu.pl";
-    &menubar;
-  }
-
-  print qq|
   </form>
 
 </body>
@@ -2034,20 +2021,20 @@ sub parts_subtotal {
 
   $column_data{onhand} =
       "<th class=listsubtotal align=right>"
-    . $form->format_amount(\%myconfig, $subtotalonhand, '', "&nbsp;")
+    . $form->format_amount(\%myconfig, $subtotalonhand)
     . "</th>";
 
   $column_data{linetotalsellprice} =
       "<th class=listsubtotal align=right>"
-    . $form->format_amount(\%myconfig, $subtotalsellprice, 2, "&nbsp;")
+    . $form->format_amount(\%myconfig, $subtotalsellprice, 2)
     . "</th>";
   $column_data{linetotallistprice} =
       "<th class=listsubtotal align=right>"
-    . $form->format_amount(\%myconfig, $subtotallistprice, 2, "&nbsp;")
+    . $form->format_amount(\%myconfig, $subtotallistprice, 2)
     . "</th>";
   $column_data{linetotallastcost} =
       "<th class=listsubtotal align=right>"
-    . $form->format_amount(\%myconfig, $subtotallastcost, 2, "&nbsp;")
+    . $form->format_amount(\%myconfig, $subtotallastcost, 2)
     . "</th>";
 
   $subtotalonhand    = 0;
@@ -2068,9 +2055,13 @@ sub parts_subtotal {
 
 sub edit {
   $lxdebug->enter_sub();
-
+  # show history button
+  $form->{javascript} = qq|<script type="text/javascript" src="js/show_history.js"></script>|;
+  #/show hhistory button
   IC->get_part(\%myconfig, \%$form);
 
+  $form->{"original_partnumber"} = $form->{"partnumber"};
+
   $form->{title} = $locale->text('Edit ' . ucfirst $form->{item});
 
   &link_part;
@@ -2085,8 +2076,8 @@ sub link_part {
   IC->create_links("IC", \%myconfig, \%$form);
 
   # currencies
-  map { $form->{selectcurrency} .= "<option>$_\n" } split /:/,
-    $form->{currencies};
+  map({ $form->{selectcurrency} .= "<option>$_\n" }
+      split(/:/, $form->{currencies}));
 
   # parts and assemblies have the same links
   $item = $form->{item};
@@ -2174,31 +2165,8 @@ sub link_part {
 sub form_header {
   $lxdebug->enter_sub();
 
-  my $dec = '';
-
-  #decimalplaces for listprice
-  ($dec) = ($form->{listprice} =~ /\.(\d+)/);
-  $dec = length $dec;
-  my $decimalplaces = ($dec == 2) ? $dec : 2;
-  $form->{listprice} =
-    $form->format_amount(\%myconfig, $form->{listprice}, $decimalplaces);
-
-  #decimalplaces for sellprice and gv
-  ($dec) = ($form->{sellprice} =~ /\.(\d+)/);
-  $dec = length $dec;
-  my $decimalplaces = ($dec == 2) ? $dec : 2;
-
-  map {
-    $form->{$_} =
-      $form->format_amount(\%myconfig, $form->{$_}, $decimalplaces)
-  } qw(sellprice gv);
-
-  ($dec) = ($form->{lastcost} =~ /\.(\d+)/);
-  $dec = length $dec;
-  my $decimalplaces = ($dec == 2) ? $dec : 2;
-
-  $form->{lastcost} =
-    $form->format_amount(\%myconfig, $form->{lastcost}, $decimalplaces);
+  map({ $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}, -2) }
+      qw(sellprice listprice lastcost gv));
 
   map { $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}) }
     qw(weight rop stock);
@@ -2222,7 +2190,7 @@ sub form_header {
   }
 
   $notes =
-    qq|<textarea name=notes rows=$rows cols=60 wrap=soft>$form->{notes}</textarea>|;
+    qq|<textarea name=notes rows=$rows cols=45 wrap=soft>$form->{notes}</textarea>|;
   if (($rows = $form->numtextrows($form->{description}, 40)) > 1) {
     $description =
       qq|<textarea name="description" rows=$rows cols=40 wrap=soft>$form->{description}</textarea>|;
@@ -2231,6 +2199,8 @@ sub form_header {
       qq|<input name=description size=40 value="$form->{description}">|;
   }
 
+  $ean =  qq|<input name=ean size=40 value="$form->{ean}">|;
+
   foreach $item (split / /, $form->{taxaccounts}) {
     $form->{"IC_tax_$item"} = ($form->{"IC_tax_$item"}) ? "checked" : "";
   }
@@ -2256,27 +2226,6 @@ sub form_header {
              </tr>|;
 
 
-  $form->{selectadr} = "<option></option>";
-  if (@{ $form->{ADR} }) {
-    foreach $item (@{ $form->{ADR} }) {
-      if ($item->{id} == $form->{adr_id}) {
-        $form->{selectadr} .=
-          "<option value=$item->{id} selected>$item->{adr_code}\n";
-      } else {
-        $form->{selectadr} .=
-          "<option value=$item->{id}>$item->{adr_code}\n";
-      }
-
-    }
-  }
-
-  $adr = qq|
-             <tr>
-               <th align=right>| . $locale->text('ADR') . qq|</th>
-               <td><select name=adr_id>$form->{selectadr}</select></td>
-             </tr>|;
-
-
   # set option
   foreach $item (qw(IC IC_income IC_expense)) {
     if ($form->{$item}) {
@@ -2353,11 +2302,6 @@ sub form_header {
                      <td>
                        <input name=weight size=10 value=$form->{weight}>
                      </td>
-                     <th>
-                       &nbsp;
-                       $form->{weightunit}
-                       <input type=hidden name=weightunit value=$form->{weightunit}>
-                     </th>
                    </tr>
                  </table>
                </td>
@@ -2388,11 +2332,6 @@ sub form_header {
                        &nbsp;$form->{weight}
                        <input type=hidden name=weight value=$form->{weight}>
                      </td>
-                     <th>
-                       &nbsp;
-                       $form->{weightunit}
-                       <input type=hidden name=weightunit value=$form->{weightunit}>
-                     </th>
                    </tr>
                  </table>
                </td>
@@ -2474,15 +2413,6 @@ sub form_header {
                <td><input name=gv size=10 value=$form->{gv}></td>
              </tr>
 |;
-    $aluok = $form->{alu} == 1 ? "checked" : "";
-
-    $alu .= qq|
-              <tr>
-                <th align=right nowrap>|
-    . $locale->text('Aluartikel') . qq|</th>
-                <td><input class=checkbox type=checkbox name=alu value=1 $aluok></td>
-             </tr>|;
-
     $notdiscountableok = ($form->{not_discountable}) == 1 ? "checked" : "";
     $notdiscountable .= qq|
               <tr>
@@ -2493,7 +2423,7 @@ sub form_header {
 |;
 
   $formel =
-    qq|<ilayer><layer  onmouseover="this.T_STICKY=true;this.T_STATIC=true;return escape('| . $locale->text('The formula needs the following syntax:<br>For regular article:<br>Variablename= Variable Unit;<br>Variablename2= Variable2 Unit2;<br>...<br>###<br>Variable + ( Variable2 / Variable )<br><b>Please be beware of the spaces in the formula</b><br><br>For alu article:<br>Length:<br>Weight/m:<br>Length ist total length of article and weight/m ist the weight pro meter') . qq|')"><textarea name=formel rows=4 cols=60 wrap=soft>$form->{formel}</textarea></layer><ilayer>|;
+    qq|<ilayer><layer  onmouseover="this.T_STICKY=true;this.T_STATIC=true;return escape('| . $locale->text('The formula needs the following syntax:<br>For regular article:<br>Variablename= Variable Unit;<br>Variablename2= Variable2 Unit2;<br>...<br>###<br>Variable + ( Variable2 / Variable )<br><b>Please be beware of the spaces in the formula</b><br>') . qq|')"><textarea name=formel rows=4 cols=30 wrap=soft>$form->{formel}</textarea></layer><ilayer>|;
     $imagelinks = qq|
   <tr>
     <td>
@@ -2591,6 +2521,7 @@ sub form_header {
 <input name=rowcount type=hidden value=$form->{rowcount}>
 <input name=eur type=hidden value=$eur>
 <input name=language_values type=hidden value="$form->{language_values}">
+<input name="original_partnumber" type="hidden" value="| . $form->quote($form->{"original_partnumber"}) . qq|">
 
 <table width="100%">
   <tr>
@@ -2628,7 +2559,6 @@ sub form_header {
                 <table>
                   $buchungsgruppe
                   $linkaccounts
-                  $adr
                 </table>
               </td>
               <tr>
@@ -2644,9 +2574,16 @@ sub form_header {
                 </td>
               </tr>
               <tr>
-                <td colspan=2>
+                <th align="left"></th>
+                <th align="left">| . $locale->text('EAN-Code') . qq|</th>
+              </tr>
+              <tr>
+                <td>
                   <button type="button" onclick="parts_language_selection_window('language_values')">| . $locale->text('Set Language Values') . qq|</button>
                 </td>
+               <td>
+                 $ean  
+               </td>
               </tr>
               <tr>
               <td colspan=2>
@@ -2686,7 +2623,6 @@ sub form_header {
               $notdiscountable
               $vegv
               $shop
-              $alu
              $obsolete
            </table>
          </td>
@@ -2785,10 +2721,20 @@ sub form_footer {
       &menubar;
     }
   }
-
+# button for saving history
+  if($form->{id} ne "") {
+       print qq|
+               <input type=button class=submit onclick=set_history_window(|
+               . $form->{id} 
+               . qq|); name=history id=history value=|
+               . $locale->text('history') 
+               . qq|>|;
+  }
+# /button for saving history
   print qq|
 
 </form>
+
 <script type="text/javascript" src="js/wz_tooltip.js"></script>
 
 </body>
@@ -3054,8 +3000,8 @@ sub update {
   }
 
   if ($form->{item} eq 'service') {
-    map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
-      qw(sellprice listprice);
+    map({ $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
+        qw(sellprice listprice lastcost));
     &form_header;
     &price_row;
     &form_footer;
@@ -3078,7 +3024,7 @@ sub save {
       $locale->text(
         "Inventory quantity must be zero before you can set this $form->{item} obsolete!"
       ))
-      if ($form->{onhand});
+      if ($form->{onhand} * 1);
   }
 
   if (!$form->{buchungsgruppen_id}) {
@@ -3104,6 +3050,12 @@ sub save {
   if ($rc == 3) {
     $form->error($locale->text('Partnumber not unique!'));
   }
+  # saving the history
+  if(!exists $form->{addition}) {
+       $form->{addition} = "SAVED";
+       $form->save_history($form->dbconnect(\%myconfig));
+  }
+  # /saving the history
   $parts_id = $form->{id};
 
   # load previous variables
@@ -3220,15 +3172,29 @@ sub save {
 sub save_as_new {
   $lxdebug->enter_sub();
 
+  # saving the history
+  if(!exists $form->{addition}) {
+       $form->{addition} = "SAVED AS NEW";
+       $form->save_history($form->dbconnect(\%myconfig));
+  }
+  # /saving the history
   $form->{id} = 0;
+  if ($form->{"original_partnumber"} &&
+      ($form->{"partnumber"} eq $form->{"original_partnumber"})) {
+    $form->{partnumber} = "";
+  }
   &save;
-
   $lxdebug->leave_sub();
 }
 
 sub delete {
   $lxdebug->enter_sub();
-
+  # saving the history
+  if(!exists $form->{addition}) {
+       $form->{addition} = "DELETED";
+       $form->save_history($form->dbconnect(\%myconfig));
+  }
+  # /saving the history
   $rc = IC->delete(\%myconfig, \%$form);
 
   # redirect
@@ -3238,181 +3204,6 @@ sub delete {
   $lxdebug->leave_sub();
 }
 
-sub stock_assembly {
-  $lxdebug->enter_sub();
-
-  $form->{title} = $locale->text('Stock Assembly');
-
-  $form->header;
-
-  print qq|
-<body>
-
-<form method=post action=$form->{script}>
-
-<table width="100%">
-  <tr>
-    <th class=listtop>$form->{title}</th>
-  </tr>
-  <tr height="5"></tr>
-  <tr valign=top>
-    <td>
-      <table>
-        <tr>
-          <th align="right" nowrap="true">|
-    . $locale->text('Part Number') . qq|</th>
-          <td><input name=partnumber size=20></td>
-          <td>&nbsp;</td>
-        </tr>
-        <tr>
-          <th align="right" nowrap="true">|
-    . $locale->text('Part Description') . qq|</th>
-          <td><input name=description size=40></td>
-        </tr>
-      </table>
-    </td>
-  </tr>
-  <tr><td><hr size=3 noshade></td></tr>
-</table>
-
-<input type=hidden name=path value=$form->{path}>
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
-
-<input type=hidden name=nextsub value=list_assemblies>
-
-<br>
-<input class=submit type=submit name=action value="|
-    . $locale->text('Continue') . qq|">
-</form>
-
-</body>
-</html>
-|;
-
-  $lxdebug->leave_sub();
-}
-
-sub list_assemblies {
-  $lxdebug->enter_sub();
-
-  IC->retrieve_assemblies(\%myconfig, \%$form);
-
-  $column_header{partnumber} =
-    qq|<th class=listheading>| . $locale->text('Part Number') . qq|</th>|;
-  $column_header{description} =
-    qq|<th class=listheading>| . $locale->text('Part Description') . qq|</th>|;
-  $column_header{bin} =
-    qq|<th class=listheading>| . $locale->text('Bin') . qq|</th>|;
-  $column_header{onhand} =
-    qq|<th class=listheading>| . $locale->text('Qty') . qq|</th>|;
-  $column_header{rop} =
-    qq|<th class=listheading>| . $locale->text('ROP') . qq|</th>|;
-  $column_header{stock} =
-    qq|<th class=listheading>| . $locale->text('Add') . qq|</th>|;
-
-  @column_index = (qw(partnumber description bin onhand rop stock));
-
-  $form->{title} = $locale->text('Stock Assembly');
-
-  $form->{callback} =
-    "$form->{script}?action=stock_assembly&path=$form->{path}&login=$form->{login}&password=$form->{password}";
-
-  $form->header;
-
-  $colspan = $#column_index + 1;
-
-  print qq|
-<body>
-
-<form method=post action=$form->{script}>
-
-<table width=100%>
-  <tr>
-    <th class=listtop colspan=$colspan>$form->{title}</th>
-  </tr>
-  <tr size=5></tr>
-  <tr class=listheading>|;
-
-  map { print "\n$column_header{$_}" } @column_index;
-
-  print qq|
-  </tr>
-|;
-
-  $i = 1;
-  foreach $ref (@{ $form->{assembly_items} }) {
-
-    map { $ref->{$_} =~ s/\"/&quot;/g } qw(partnumber description);
-
-    $column_data{partnumber}  = qq|<td width=20%>$ref->{partnumber}</td>|;
-    $column_data{description} =
-      qq|<td width=50%>$ref->{description}&nbsp;</td>|;
-    $column_data{bin}    = qq|<td>$ref->{bin}&nbsp;</td>|;
-    $column_data{onhand} =
-        qq|<td align=right>|
-      . $form->format_amount(\%myconfig, $ref->{onhand}, '', "&nbsp;")
-      . qq|</td>|;
-    $column_data{rop} =
-        qq|<td align=right>|
-      . $form->format_amount(\%myconfig, $ref->{rop}, '', "&nbsp;")
-      . qq|</td>|;
-    $column_data{stock} = qq|<td width=10%><input name="qty_$i" size=10></td>|;
-
-    $j++;
-    $j %= 2;
-    print
-      qq|<tr class=listrow$j><input name="id_$i" type=hidden value=$ref->{id}>\n|;
-
-    map { print "\n$column_data{$_}" } @column_index;
-
-    print qq|
-    </tr>
-|;
-
-    $i++;
-
-  }
-
-  $i--;
-  print qq|
-  <tr>
-    <td colspan=6><hr size=3 noshade>
-  </tr>
-</table>
-<input name=rowcount type=hidden value="$i">
-
-<input type=hidden name=path value=$form->{path}>
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
-
-<input name=callback type=hidden value="$form->{callback}">
-
-<input type=hidden name=nextsub value=restock_assemblies>
-
-<br>
-<input class=submit type=submit name=action value="|
-    . $locale->text('Continue') . qq|">
-
-</form>
-
-</body>
-</html>
-|;
-
-  $lxdebug->leave_sub();
-}
-
-sub restock_assemblies {
-  $lxdebug->enter_sub();
-
-  $form->redirect($locale->text('Assemblies restocked!'))
-    if (IC->restock_assemblies(\%myconfig, \%$form));
-  $form->error($locale->text('Cannot stock assemblies!'));
-
-  $lxdebug->leave_sub();
-}
-
 sub price_row {
   $lxdebug->enter_sub();
 
@@ -3446,7 +3237,6 @@ sub price_row {
   $lxdebug->leave_sub();
 }
 
-
 sub parts_language_selection {
   $lxdebug->enter_sub();