OE->save() parst verschiedene Zahlen. Das ist beim Umwandeln in anderen Formulartypen...
[kivitendo-erp.git] / bin / mozilla / ic.pl
index 51be87c..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;
@@ -2222,7 +2224,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=50 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>|;
@@ -2256,27 +2258,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}) {
@@ -2474,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>
@@ -2493,8 +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=60 wrap=soft>$form->{formel}</textarea></layer><ilayer>|;
-  $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>') . qq|')"><textarea name=formel rows=4 cols=40 wrap=soft>$form->{formel}</textarea></layer><ilayer>|;
     $imagelinks = qq|
   <tr>
     <td>
@@ -2592,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>
@@ -2629,16 +2601,19 @@ sub form_header {
                 <table>
                   $buchungsgruppe
                   $linkaccounts
-                  $adr
                 </table>
               </td>
               <tr>
                 <th align="left">| . $locale->text('Notes') . qq|</th>
+                <th align="left">| . $locale->text('Formula') . qq|</th>
               </tr>
               <tr>
                 <td>
                   $notes
                 </td>
+                <td>
+                  $formel
+                </td>
               </tr>
               <tr>
                 <td colspan=2>
@@ -2683,7 +2658,6 @@ sub form_header {
               $notdiscountable
               $vegv
               $shop
-              $alu
              $obsolete
            </table>
          </td>
@@ -3218,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();