Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision e9e60985

Von Moritz Bunkus vor fast 8 Jahren hinzugefügt

  • ID e9e60985f22a94e8148cd5bbac281d31721f4f7c
  • Vorgänger a8459f49
  • Nachfolger 5d497700

Lager: Einlagernfunktionalität aus wh.pl entfernt

Diese wird inzwischen von SL::Controller::Inventory zur Verfügung
gestellt.

Unterschiede anzeigen:

bin/mozilla/wh.pl
112 112
    $form->{title}   = $locale->text('Removal from Warehouse');
113 113
    $content         = $form->parse_html_template('wh/warehouse_selection');
114 114

  
115
  } elsif ($form->{trans_type} eq 'stock') {
116
    $form->{title} = $locale->text('Stock');
117
    $content       = $form->parse_html_template('wh/warehouse_selection_stock');
118

  
119 115
  } elsif (!$form->{trans_type} || ($form->{trans_type} eq 'transfer')) {
120 116
    $form->{nextsub} = "transfer_parts_selection";
121 117
    $form->{title}   = $locale->text('Transfer');
......
308 304
# Transfer: stock
309 305
# --------------------------------------------------------------------
310 306

  
311
sub transfer_stock_update_part {
312
  $main::lxdebug->enter_sub();
313

  
314
  my $form     = $main::form;
315
  my %myconfig = %main::myconfig;
316
  my $locale   = $main::locale;
317

  
318
  $form->{trans_type} = 'stock';
319
  $form->{qty}        = $form->parse_amount(\%myconfig, $form->{qty});
320

  
321
  if (!$form->{partnumber} && !$form->{description} && !$form->{ean}) {
322
    delete @{$form}{qw(parts_id partunit ean)};
323
    transfer_warehouse_selection();
324

  
325
  } elsif (($form->{partnumber} && ($form->{partnumber} ne $form->{old_partnumber})) || $form->{description} || $form->{ean}) {
326

  
327
#    $form->{no_services}   = 1; # services may now be transfered. fix for Bug 1383.
328
    $form->{no_assemblies} = 0; # assemblies duerfen eingelagert werden (z.B. bei retouren)
329

  
330
    my $parts = Common->retrieve_parts(\%myconfig, $form, 'description', 1);
331

  
332
    if (!scalar @{ $parts }) {
333
      new_item(action => "transfer_stock_update_part");
334
    } elsif (scalar @{ $parts } == 1) {
335
      @{$form}{qw(parts_id partnumber description ean warehouse_id bin_id)} = @{$parts->[0]}{qw(id partnumber description ean warehouse_id bin_id)};
336
      transfer_stock_get_partunit();
337
      transfer_warehouse_selection();
338

  
339
    } else {
340
      select_part('transfer_stock_part_selected', @{ $parts });
341
    }
342

  
343
  } else {
344
    transfer_stock_get_partunit();
345
    transfer_warehouse_selection();
346
  }
347

  
348
  $main::lxdebug->leave_sub();
349
}
350

  
351 307
# --------------------------------------------------------------------
352 308
# Transfer: assemblies
353 309
# Dies ist die Auswahlmaske für ein assembly.
......
486 442
  $main::lxdebug->leave_sub();
487 443
}
488 444

  
489
sub transfer_stock {
490
  $main::lxdebug->enter_sub();
491

  
492
  my $form     = $main::form;
493
  my %myconfig = %main::myconfig;
494
  my $locale   = $main::locale;
495

  
496
  $form->{qty} = $form->parse_amount(\%myconfig, $form->{qty});
497

  
498
  if ($form->{qty} <= 0) {
499
    $form->show_generic_error($locale->text('Invalid quantity.'));
500
  }
501

  
502
  if (!$form->{warehouse_id} || !$form->{bin_id}) {
503
    $form->error($locale->text('The warehouse or the bin is missing.'));
504
  }
505

  
506
  my $transfer = {
507
    'transfer_type'    => 'stock',
508
    'dst_warehouse_id' => $form->{warehouse_id},
509
    'dst_bin_id'       => $form->{bin_id},
510
    'chargenumber'     => $form->{chargenumber},
511
    'bestbefore'       => $form->{bestbefore},
512
    'parts_id'         => $form->{parts_id},
513
    'qty'              => $form->{qty},
514
    'unit'             => $form->{unit},
515
    'comment'          => $form->{comment},
516
  };
517

  
518
  WH->transfer($transfer);
519

  
520
  delete @{$form}{qw(parts_id partnumber description qty unit chargenumber bestbefore comment ean)};
521

  
522
  $form->{saved_message} = $locale->text('The parts have been stocked.');
523
  $form->{trans_type}    = 'stock';
524

  
525
  transfer_warehouse_selection();
526

  
527
  $main::lxdebug->leave_sub();
528
}
529

  
530 445
# --------------------------------------------------------------------
531 446
# Transfer: removal
532 447
# --------------------------------------------------------------------
locale/de/all
3009 3009
  'The parts for this delivery order have already been transferred in.' => 'Die Artikel dieses Lieferscheins wurden bereits eingelagert.',
3010 3010
  'The parts for this delivery order have already been transferred out.' => 'Die Artikel dieses Lieferscheins wurden bereits ausgelagert.',
3011 3011
  'The parts have been removed.' => 'Die Waren wurden aus dem Lager entnommen.',
3012
  'The parts have been stocked.' => 'Die Artikel wurden eingelagert.',
3013 3012
  'The parts have been transferred.' => 'Die Waren wurden umgelagert.',
3014 3013
  'The partsgroup has been created.' => 'Die Warengruppe wurde erstellt.',
3015 3014
  'The partsgroup has been deleted.' => 'Die Warengruppe wurde gelöscht.',
templates/webpages/wh/warehouse_selection_stock.html
1
[%- USE T8 %]
2
[%- USE L %]
3
[%- USE HTML %][%- USE JavaScript %][%- USE LxERP %]
4
<h1>[% title %]</h1>
5

  
6
 <script type="text/javascript" src="js/common.js"></script>
7
 <script type="text/javascript" src="js/part_selection.js"></script>
8
 <script type="text/javascript">
9
  <!--
10
      warehouses = new Array();
11
      [%- USE WAREHOUSES_it = Iterator(WAREHOUSES) %][%- FOREACH warehouse = WAREHOUSES_it %]
12
      warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array();
13
      warehouses[[% WAREHOUSES_it.count - 1 %]]['id'] = [% warehouse.id %];
14
      warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'] = new Array();
15
      [% USE BINS_it = Iterator(warehouse.BINS) %][% FOREACH bin = BINS_it %]
16
      warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]] = new Array();
17
      warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]]['description'] = "[% JavaScript.escape(bin.description) %]";
18
      warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]]['id'] = [% bin.id %];
19
      [% END %]
20
      [% END %]
21

  
22
      function warehouse_selected(warehouse_id, bin_id) {
23
        var control = document.getElementById("bin_id");
24

  
25
        for (var i = control.options.length - 1; i >= 0; i--) {
26
          control.options[i] = null;
27
        }
28

  
29
        var warehouse_index = 0;
30

  
31
        for (i = 0; i < warehouses.length; i++)
32
          if (warehouses[i]['id'] == warehouse_id) {
33
            warehouse_index = i;
34
            break;
35
          }
36

  
37
        var warehouse = warehouses[warehouse_index];
38
        var bin_index = 0;
39

  
40
        for (i = 0; i < warehouse['bins'].length; i++)
41
          if (warehouse['bins'][i]['id'] == bin_id) {
42
            bin_index = i;
43
            break;
44
          }
45

  
46
        for (i = 0; i < warehouse['bins'].length; i++) {
47
          control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']);
48
        }
49

  
50

  
51
        control.options[bin_index].selected = true;
52
      }
53

  
54
      $(function() {
55
        warehouse_selected([% warehouse_id %], [% bin_id %]);
56
      })
57
    -->
58
 </script>
59

  
60
 <form name="Form" method="post" action="wh.pl">
61

  
62
  <input type="hidden" name="nextsub" value="transfer_stock">
63
  <input type="hidden" name="update_nextsub" value="transfer_stock_update_part">
64

  
65
  [% IF saved_message %]
66
  <p>[% saved_message %]</p>
67
  [% END %]
68

  
69
  <p>
70
   <table>
71
    <tr>
72
     <th align="right" nowrap>[% 'Destination warehouse' | $T8 %]</th>
73
     <td>
74
      <select name="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)">
75
       [%- FOREACH warehouse = WAREHOUSES %]
76
       <option value="[% HTML.escape(warehouse.id) %]"[% IF warehouse_id == warehouse.id %] selected[% END %]>[% warehouse.description %]</option>
77
       [%- END %]
78
      </select>
79
     </td>
80
    </tr>
81

  
82
    <tr>
83
     <th align="right" nowrap>[% 'Destination bin' | $T8 %]:</th>
84
     <td><select id="bin_id" name="bin_id"></select></td>
85
    </tr>
86

  
87
    <tr>
88
     <th align="right" nowrap>[% 'Part Number' | $T8 %]</th>
89
     <td>
90
      <input type="hidden" name="parts_id" id="parts_id" value="[% HTML.escape(parts_id) %]">
91
      <input type="hidden" name="old_partnumber" id="old_partnumber" value="[% HTML.escape(partnumber) %]">
92
      <input name="partnumber" size="30" value="[% HTML.escape(partnumber) %]">
93
     </td>
94
    </tr>
95

  
96
    <tr>
97
     <th align="right" nowrap>[% 'Part Description' | $T8 %]</th>
98
     <td>
99
      <input name="description" size="30" value="[% HTML.escape(description) %]">
100
      <input type="button" onclick="part_selection_window('partnumber', 'description', 'parts_id', 0, 'Form', 'click_button=update_button')" value="?">
101
     </td>
102
    </tr>
103

  
104
    <tr>
105
     <th align="right" nowrap>[% 'Charge number' | $T8 %]</th>
106
     <td><input name="chargenumber" size="30" value="[% HTML.escape(chargenumber) %]"></td>
107
    </tr>
108

  
109
    [% IF INSTANCE_CONF.get_show_bestbefore %]
110
    <tr>
111
     <th align="right" nowrap>[% 'Best Before' | $T8 %]</th>
112
     <td>
113
       [% L.date_tag('bestbefore', bestbefore) %]
114
     </td>
115
    </tr>
116
    [% END %]
117

  
118
    <tr>
119
     <th align="right" nowrap>[% 'EAN' | $T8 %]</th>
120
     <td><input name="ean" size="30" value="[% HTML.escape(ean) %]"></td>
121
    </tr>
122

  
123
    <tr>
124
     <th align="right" nowrap>[% 'Quantity' | $T8 %]</th>
125
     <td>
126
      <input name="qty" size="10" value="[% HTML.escape(LxERP.format_amount(qty)) %]">
127
      <select name="unit">
128
       [%- FOREACH unit = UNITS %]<option[% IF unit.selected %] selected[% END %]>[% HTML.escape(unit.name) %]</option>[% END %]
129
      </select>
130
     </td>
131
    </tr>
132

  
133
    <tr>
134
     <th align="right" nowrap>[% 'Optional comment' | $T8 %]</th>
135
     <td><input name="comment" size="60" value="[% HTML.escape(comment) %]"></td>
136
    </tr>
137

  
138
   </table>
139
  </p>
140

  
141
  <p>
142
   <input type="submit" class="submit" name="action" id="update_button" value="[% 'Update' | $T8 %]">
143
   [%- IF parts_id %]
144
   <input type="submit" class="submit" name="action" value="[% 'Stock' | $T8 %]">
145
   [%- END %]
146
  </p>
147
 </form>
148

  

Auch abrufbar als: Unified diff