OE->save() parst verschiedene Zahlen. Das ist beim Umwandeln in anderen Formulartypen...
[kivitendo-erp.git] / bin / mozilla / ic.pl
index 80e0bbc..63ce108 100644 (file)
@@ -313,7 +313,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>
@@ -2071,6 +2071,8 @@ sub edit {
 
   IC->get_part(\%myconfig, \%$form);
 
+  $form->{"original_partnumber"} = $form->{"partnumber"};
+
   $form->{title} = $locale->text('Edit ' . ucfirst $form->{item});
 
   &link_part;
@@ -2453,15 +2455,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>
@@ -2472,7 +2465,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=40 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=40 wrap=soft>$form->{formel}</textarea></layer><ilayer>|;
     $imagelinks = qq|
   <tr>
     <td>
@@ -2570,6 +2563,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>
@@ -2664,7 +2658,6 @@ sub form_header {
               $notdiscountable
               $vegv
               $shop
-              $alu
              $obsolete
            </table>
          </td>
@@ -3199,6 +3192,10 @@ sub save_as_new {
   $lxdebug->enter_sub();
 
   $form->{id} = 0;
+  if ($form->{"original_partnumber"} &&
+      ($form->{"partnumber"} eq $form->{"original_partnumber"})) {
+    $form->{partnumber} = "";
+  }
   &save;
 
   $lxdebug->leave_sub();