Standardlagerplatz direkt beim Umlagern ändern, falls entsprechend angehakt
authorJan Büren <jan@kivitendo-premium.de>
Fri, 31 May 2013 07:22:49 +0000 (09:22 +0200)
committerJan Büren <jan@kivitendo-premium.de>
Fri, 31 May 2013 07:22:49 +0000 (09:22 +0200)
SL/WH.pm
bin/mozilla/wh.pl
templates/webpages/wh/transfer_parts_selection.html

index 28e836e..f7ca693 100644 (file)
--- a/SL/WH.pm
+++ b/SL/WH.pm
@@ -132,7 +132,13 @@ sub transfer {
           bin       => $dst_bin->id,
           qty       => $qty,
         )->save;
-      }
+        # Standardlagerplatz in Stammdaten gleich mitverschieben
+        if (defined($transfer->{change_default_bin})){
+          my $part = SL::DB::Part->new(id        => conv_i($transfer->{parts_id}))->load;
+          $part->update_attributes(warehouse_id  => conv_i($transfer->{dst_warehouse_id}));
+          $part->update_attributes(bin_id        => conv_i($transfer->{dst_bin_id}));
+        }
+     }
 
       push @trans_ids, $trans_id;
     }
index 5caee54..f76b4e9 100644 (file)
@@ -282,6 +282,7 @@ sub transfer_parts {
     }
 
     $transfer->{comment} = $form->{comment};
+    $transfer->{change_default_bin} = $form->{change_default_bin};
 
     push @transfers, $transfer;
 
index 62ded76..5a7aabf 100644 (file)
      <td>[% 'Optional comment' | $T8 %]:</td>
      <td><input name="comment" size="20"></td>
     </tr>
+    <tr>
+     <td>[% 'Change default bin for this parts' | $T8 %]:</td>
+    <td><input type="checkbox" name="change_default_bin"<td>
+    </tr>
    </table>
   </p>