$form->{title} = $locale->text('Removal from Warehouse');
$content = $form->parse_html_template('wh/warehouse_selection');
- } elsif ($form->{trans_type} eq 'stock') {
- $form->{title} = $locale->text('Stock');
- $content = $form->parse_html_template('wh/warehouse_selection_stock');
-
} elsif (!$form->{trans_type} || ($form->{trans_type} eq 'transfer')) {
$form->{nextsub} = "transfer_parts_selection";
$form->{title} = $locale->text('Transfer');
# Transfer: stock
# --------------------------------------------------------------------
-sub transfer_stock_update_part {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
-
- $form->{trans_type} = 'stock';
- $form->{qty} = $form->parse_amount(\%myconfig, $form->{qty});
-
- if (!$form->{partnumber} && !$form->{description} && !$form->{ean}) {
- delete @{$form}{qw(parts_id partunit ean)};
- transfer_warehouse_selection();
-
- } elsif (($form->{partnumber} && ($form->{partnumber} ne $form->{old_partnumber})) || $form->{description} || $form->{ean}) {
-
-# $form->{no_services} = 1; # services may now be transfered. fix for Bug 1383.
- $form->{no_assemblies} = 0; # assemblies duerfen eingelagert werden (z.B. bei retouren)
-
- my $parts = Common->retrieve_parts(\%myconfig, $form, 'description', 1);
-
- if (!scalar @{ $parts }) {
- new_item(action => "transfer_stock_update_part");
- } elsif (scalar @{ $parts } == 1) {
- @{$form}{qw(parts_id partnumber description ean warehouse_id bin_id)} = @{$parts->[0]}{qw(id partnumber description ean warehouse_id bin_id)};
- transfer_stock_get_partunit();
- transfer_warehouse_selection();
-
- } else {
- select_part('transfer_stock_part_selected', @{ $parts });
- }
-
- } else {
- transfer_stock_get_partunit();
- transfer_warehouse_selection();
- }
-
- $main::lxdebug->leave_sub();
-}
-
# --------------------------------------------------------------------
# Transfer: assemblies
# Dies ist die Auswahlmaske für ein assembly.
$main::lxdebug->leave_sub();
}
-sub transfer_stock {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
-
- $form->{qty} = $form->parse_amount(\%myconfig, $form->{qty});
-
- if ($form->{qty} <= 0) {
- $form->show_generic_error($locale->text('Invalid quantity.'));
- }
-
- if (!$form->{warehouse_id} || !$form->{bin_id}) {
- $form->error($locale->text('The warehouse or the bin is missing.'));
- }
-
- my $transfer = {
- 'transfer_type' => 'stock',
- 'dst_warehouse_id' => $form->{warehouse_id},
- 'dst_bin_id' => $form->{bin_id},
- 'chargenumber' => $form->{chargenumber},
- 'bestbefore' => $form->{bestbefore},
- 'parts_id' => $form->{parts_id},
- 'qty' => $form->{qty},
- 'unit' => $form->{unit},
- 'comment' => $form->{comment},
- };
-
- WH->transfer($transfer);
-
- delete @{$form}{qw(parts_id partnumber description qty unit chargenumber bestbefore comment ean)};
-
- $form->{saved_message} = $locale->text('The parts have been stocked.');
- $form->{trans_type} = 'stock';
-
- transfer_warehouse_selection();
-
- $main::lxdebug->leave_sub();
-}
-
# --------------------------------------------------------------------
# Transfer: removal
# --------------------------------------------------------------------
'The parts for this delivery order have already been transferred in.' => 'Die Artikel dieses Lieferscheins wurden bereits eingelagert.',
'The parts for this delivery order have already been transferred out.' => 'Die Artikel dieses Lieferscheins wurden bereits ausgelagert.',
'The parts have been removed.' => 'Die Waren wurden aus dem Lager entnommen.',
- 'The parts have been stocked.' => 'Die Artikel wurden eingelagert.',
'The parts have been transferred.' => 'Die Waren wurden umgelagert.',
'The partsgroup has been created.' => 'Die Warengruppe wurde erstellt.',
'The partsgroup has been deleted.' => 'Die Warengruppe wurde gelöscht.',
+++ /dev/null
-[%- USE T8 %]
-[%- USE L %]
-[%- USE HTML %][%- USE JavaScript %][%- USE LxERP %]
-<h1>[% title %]</h1>
-
- <script type="text/javascript" src="js/common.js"></script>
- <script type="text/javascript" src="js/part_selection.js"></script>
- <script type="text/javascript">
- <!--
- warehouses = new Array();
- [%- USE WAREHOUSES_it = Iterator(WAREHOUSES) %][%- FOREACH warehouse = WAREHOUSES_it %]
- warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array();
- warehouses[[% WAREHOUSES_it.count - 1 %]]['id'] = [% warehouse.id %];
- warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'] = new Array();
- [% USE BINS_it = Iterator(warehouse.BINS) %][% FOREACH bin = BINS_it %]
- warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]] = new Array();
- warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]]['description'] = "[% JavaScript.escape(bin.description) %]";
- warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]]['id'] = [% bin.id %];
- [% END %]
- [% END %]
-
- function warehouse_selected(warehouse_id, bin_id) {
- var control = document.getElementById("bin_id");
-
- for (var i = control.options.length - 1; i >= 0; i--) {
- control.options[i] = null;
- }
-
- var warehouse_index = 0;
-
- for (i = 0; i < warehouses.length; i++)
- if (warehouses[i]['id'] == warehouse_id) {
- warehouse_index = i;
- break;
- }
-
- var warehouse = warehouses[warehouse_index];
- var bin_index = 0;
-
- for (i = 0; i < warehouse['bins'].length; i++)
- if (warehouse['bins'][i]['id'] == bin_id) {
- bin_index = i;
- break;
- }
-
- for (i = 0; i < warehouse['bins'].length; i++) {
- control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']);
- }
-
-
- control.options[bin_index].selected = true;
- }
-
- $(function() {
- warehouse_selected([% warehouse_id %], [% bin_id %]);
- })
- -->
- </script>
-
- <form name="Form" method="post" action="wh.pl">
-
- <input type="hidden" name="nextsub" value="transfer_stock">
- <input type="hidden" name="update_nextsub" value="transfer_stock_update_part">
-
- [% IF saved_message %]
- <p>[% saved_message %]</p>
- [% END %]
-
- <p>
- <table>
- <tr>
- <th align="right" nowrap>[% 'Destination warehouse' | $T8 %]</th>
- <td>
- <select name="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)">
- [%- FOREACH warehouse = WAREHOUSES %]
- <option value="[% HTML.escape(warehouse.id) %]"[% IF warehouse_id == warehouse.id %] selected[% END %]>[% warehouse.description %]</option>
- [%- END %]
- </select>
- </td>
- </tr>
-
- <tr>
- <th align="right" nowrap>[% 'Destination bin' | $T8 %]:</th>
- <td><select id="bin_id" name="bin_id"></select></td>
- </tr>
-
- <tr>
- <th align="right" nowrap>[% 'Part Number' | $T8 %]</th>
- <td>
- <input type="hidden" name="parts_id" id="parts_id" value="[% HTML.escape(parts_id) %]">
- <input type="hidden" name="old_partnumber" id="old_partnumber" value="[% HTML.escape(partnumber) %]">
- <input name="partnumber" size="30" value="[% HTML.escape(partnumber) %]">
- </td>
- </tr>
-
- <tr>
- <th align="right" nowrap>[% 'Part Description' | $T8 %]</th>
- <td>
- <input name="description" size="30" value="[% HTML.escape(description) %]">
- <input type="button" onclick="part_selection_window('partnumber', 'description', 'parts_id', 0, 'Form', 'click_button=update_button')" value="?">
- </td>
- </tr>
-
- <tr>
- <th align="right" nowrap>[% 'Charge number' | $T8 %]</th>
- <td><input name="chargenumber" size="30" value="[% HTML.escape(chargenumber) %]"></td>
- </tr>
-
- [% IF INSTANCE_CONF.get_show_bestbefore %]
- <tr>
- <th align="right" nowrap>[% 'Best Before' | $T8 %]</th>
- <td>
- [% L.date_tag('bestbefore', bestbefore) %]
- </td>
- </tr>
- [% END %]
-
- <tr>
- <th align="right" nowrap>[% 'EAN' | $T8 %]</th>
- <td><input name="ean" size="30" value="[% HTML.escape(ean) %]"></td>
- </tr>
-
- <tr>
- <th align="right" nowrap>[% 'Quantity' | $T8 %]</th>
- <td>
- <input name="qty" size="10" value="[% HTML.escape(LxERP.format_amount(qty)) %]">
- <select name="unit">
- [%- FOREACH unit = UNITS %]<option[% IF unit.selected %] selected[% END %]>[% HTML.escape(unit.name) %]</option>[% END %]
- </select>
- </td>
- </tr>
-
- <tr>
- <th align="right" nowrap>[% 'Optional comment' | $T8 %]</th>
- <td><input name="comment" size="60" value="[% HTML.escape(comment) %]"></td>
- </tr>
-
- </table>
- </p>
-
- <p>
- <input type="submit" class="submit" name="action" id="update_button" value="[% 'Update' | $T8 %]">
- [%- IF parts_id %]
- <input type="submit" class="submit" name="action" value="[% 'Stock' | $T8 %]">
- [%- END %]
- </p>
- </form>
-