Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 096f9e3e

Von Bernd Blessmann vor mehr als 14 Jahren hinzugefügt

  • ID 096f9e3e06dc378bcc2f97df58c74cec02b9f7ff
  • Vorgänger 0e01f2fe
  • Nachfolger 9869ed81

Funktionalität für Mindesthaltbarkeitsdatum hinzugefügt.

Unterschiede anzeigen:

SL/DO.pm
258 258
  my $h_item = prepare_query($form, $dbh, $q_item);
259 259

  
260 260
  my $q_item_stock =
261
    qq|INSERT INTO delivery_order_items_stock (delivery_order_item_id, qty, unit, warehouse_id, bin_id, chargenumber)
262
       VALUES (?, ?, ?, ?, ?, ?)|;
261
    qq|INSERT INTO delivery_order_items_stock (delivery_order_item_id, qty, unit, warehouse_id, bin_id, chargenumber, bestbefore)
262
       VALUES (?, ?, ?, ?, ?, ?, ?)|;
263 263
  my $h_item_stock = prepare_query($form, $dbh, $q_item_stock);
264 264

  
265 265
  my $in_out       = $form->{type} =~ /^sales/ ? 'out' : 'in';
......
309 309

  
310 310
    foreach my $sinfo (@{ $stock_info }) {
311 311
      @values = ($item_id, $sinfo->{qty}, $sinfo->{unit}, conv_i($sinfo->{warehouse_id}),
312
                 conv_i($sinfo->{bin_id}), $sinfo->{chargenumber});
312
                 conv_i($sinfo->{bin_id}), $sinfo->{chargenumber}, conv_date($sinfo->{bestbefore}));
313 313
      do_statement($form, $h_item_stock, $q_item_stock, @values);
314 314
    }
315 315

  
......
693 693
    my $in_out = $form->{type} =~ /^sales/ ? 'out' : 'in';
694 694

  
695 695
    $query =
696
      qq|SELECT qty, unit, bin_id, warehouse_id, chargenumber
696
      qq|SELECT qty, unit, bin_id, warehouse_id, chargenumber, bestbefore
697 697
         FROM delivery_order_items_stock
698 698
         WHERE delivery_order_item_id = ?|;
699 699
    my $sth = prepare_query($form, $dbh, $query);
......
792 792
    qw(runningnumber number description longdescription qty unit
793 793
       partnotes serialnumber reqdate projectnumber
794 794
       si_runningnumber si_number si_description
795
       si_warehouse si_bin si_chargenumber si_qty si_unit);
795
       si_warehouse si_bin si_chargenumber si_bestbefore si_qty si_unit);
796 796

  
797 797
  map { $form->{TEMPLATE_ARRAYS}->{$_} = [] } (@arrays);
798 798

  
......
875 875
        push @{ $form->{TEMPLATE_ARRAYS}{si_warehouse}[$position-1] },     $bin_wh->{warehouse};
876 876
        push @{ $form->{TEMPLATE_ARRAYS}{si_bin}[$position-1] },           $bin_wh->{bin};
877 877
        push @{ $form->{TEMPLATE_ARRAYS}{si_chargenumber}[$position-1] },  $si->{chargenumber};
878
        push @{ $form->{TEMPLATE_ARRAYS}{si_bestbefore}[$position-1] },    $si->{bestbefore};
878 879
        push @{ $form->{TEMPLATE_ARRAYS}{si_qty}[$position-1] },           $form->format_amount($myconfig, $si->{qty} * 1);
879 880
        push @{ $form->{TEMPLATE_ARRAYS}{si_unit}[$position-1] },          $si->{unit};
880 881
      }
......
944 945
  my $myconfig  = \%main::myconfig;
945 946

  
946 947
  my $query     =
947
    qq|SELECT i.warehouse_id, i.bin_id, i.chargenumber, SUM(qty) AS qty, i.parts_id,
948
    qq|SELECT i.warehouse_id, i.bin_id, i.chargenumber, i.bestbefore, SUM(qty) AS qty, i.parts_id,
948 949
         w.description AS warehousedescription,
949 950
         b.description AS bindescription
950 951
       FROM inventory i
951 952
       LEFT JOIN warehouse w ON (i.warehouse_id = w.id)
952 953
       LEFT JOIN bin b       ON (i.bin_id       = b.id)
953 954
       WHERE (i.parts_id IN (| . join(', ', ('?') x scalar(@parts_ids)) . qq|))
954
       GROUP BY i.warehouse_id, i.bin_id, i.chargenumber, i.parts_id, w.description, b.description
955
       GROUP BY i.warehouse_id, i.bin_id, i.chargenumber, i.bestbefore, i.parts_id, w.description, b.description
955 956
       HAVING SUM(qty) > 0
956
       ORDER BY LOWER(w.description), LOWER(b.description), LOWER(i.chargenumber)
957
       ORDER BY LOWER(w.description), LOWER(b.description), LOWER(i.chargenumber), i.bestbefore
957 958
|;
958 959
  my $contents = selectall_hashref_query($form, $form->get_standard_dbh($myconfig), $query, @parts_ids);
959 960

  
......
991 992
    foreach my $row (@contents) {
992 993
      next if (($row->{bin_id}       != $sinfo->{bin_id}) ||
993 994
               ($row->{warehouse_id} != $sinfo->{warehouse_id}) ||
994
               ($row->{chargenumber} ne $sinfo->{chargenumber}));
995
               ($row->{chargenumber} ne $sinfo->{chargenumber}) ||
996
               ($row->{bestbefore}   ne $sinfo->{bestbefore}));
995 997

  
996 998
      $found       = 1;
997 999

  
......
1039 1041
      "${prefix}_warehouse_id" => $request->{warehouse_id},
1040 1042
      "${prefix}_bin_id"       => $request->{bin_id},
1041 1043
      'chargenumber'           => $request->{chargenumber},
1044
      'bestbefore'             => $request->{bestbefore},
1042 1045
      'qty'                    => $request->{qty},
1043 1046
      'unit'                   => $request->{unit},
1044 1047
      'oe_id'                  => $form->{id},
SL/WH.pm
73 73

  
74 74
  my ($now)     = selectrow_query($form, $dbh, qq|SELECT current_date|);
75 75

  
76
  $query = qq|INSERT INTO inventory (warehouse_id, bin_id, parts_id, chargenumber, oe_id, orderitems_id, shippingdate,
76
  $query = qq|INSERT INTO inventory (warehouse_id, bin_id, parts_id, chargenumber, bestbefore,
77
                                     oe_id, orderitems_id, shippingdate,
77 78
                                     employee_id, project_id, trans_id, trans_type_id, comment, qty)
78
              VALUES (?, ?, ?, ?, ?, ?, ?, (SELECT id FROM employee WHERE login = ?), ?, ?, ?, ?, ?)|;
79
              VALUES (?, ?, ?, ?, ?, ?, ?, ?, (SELECT id FROM employee WHERE login = ?), ?, ?, ?, ?, ?)|;
79 80

  
80 81
  $sth   = prepare_query($form, $dbh, $query);
81 82

  
......
90 91
    $direction |= 1 if ($transfer->{src_warehouse_id} && $transfer->{src_bin_id});
91 92
    $direction |= 2 if ($transfer->{dst_warehouse_id} && $transfer->{dst_bin_id});
92 93

  
93
    push @values, conv_i($transfer->{parts_id}), "$transfer->{chargenumber}", conv_i($transfer->{oe_id}), conv_i($transfer->{orderitems_id});
94
    push @values, conv_i($transfer->{parts_id}), "$transfer->{chargenumber}", conv_date($transfer->{bestbefore}), conv_i($transfer->{oe_id}), conv_i($transfer->{orderitems_id});
94 95
    push @values, $transfer->{shippingdate} eq 'current_date' ? $now : conv_date($transfer->{shippingdate}), $form->{login}, conv_i($transfer->{project_id}), $trans_id;
95 96

  
96 97
    if ($transfer->{transfer_type_id}) {
......
131 132

  
132 133
  my $self     = shift;
133 134
  my %params   = @_;
134
  Common::check_params(\%params, qw(assembly_id dst_warehouse_id login qty unit dst_bin_id chargenumber comment));
135
  Common::check_params(\%params, qw(assembly_id dst_warehouse_id login qty unit dst_bin_id chargenumber bestbefore comment));
135 136

  
136 137
#  my $maxcreate=WH->check_assembly_max_create(assembly_id =>$params{'assembly_id'}, dbh => $my_dbh);
137 138

  
......
163 164
  my $sth_part_qty_assembly = prepare_execute_query($form, $dbh, $query, $params{assembly_id});
164 165

  
165 166
  # Hier wird das prepared Statement für die Schleife über alle Lagerplätze vorbereitet
166
  my $transferPartSQL = qq|INSERT INTO inventory (parts_id, warehouse_id, bin_id, chargenumber, comment, employee_id, qty, trans_id, trans_type_id)
167
                           VALUES (?, ?, ?, ?, ?,(SELECT id FROM employee WHERE login = ?), ?, nextval('id'),
167
  my $transferPartSQL = qq|INSERT INTO inventory (parts_id, warehouse_id, bin_id, chargenumber, bestbefore, comment, employee_id, qty, trans_id, trans_type_id)
168
                           VALUES (?, ?, ?, ?, ?, ?, (SELECT id FROM employee WHERE login = ?), ?, nextval('id'),
168 169
                           (SELECT id FROM transfer_type WHERE direction = 'out' AND description = 'used'))|;
169 170
  my $sthTransferPartSQL   = prepare_query($form, $dbh, $transferPartSQL);
170 171

  
......
191 192
      next; # die weiteren Überprüfungen sind unnötig, daher das nächste elemente prüfen (genaue Ausgabe, was noch fehlt)
192 193
    }
193 194

  
194
    # Eine kurze Vorabfrage, um den Lagerplatz und die Chargennummber zu bestimmen
195
    # Eine kurze Vorabfrage, um den Lagerplatz, Chargennummer und die Mindesthaltbarkeit zu bestimmen
195 196
    # Offen: Die Summe über alle Lagerplätze wird noch nicht gebildet
196 197
    # Gelöst: Wir haben vorher schon die Abfrage durchgeführt, ob wir fertigen können.
197 198
    # Noch besser gelöst: Wir laufen durch alle benötigten Waren zum Fertigen und geben eine Rückmeldung an den Benutzer was noch fehlt
198 199
    # und lösen den Rest dann so wie bei xplace im Barcode-Programm
199 200
    # S.a. Kommentar im bin/mozilla-Code mb übernimmt und macht das in ordentlich
200 201

  
201
    my $tempquery = qq|SELECT SUM(qty), bin_id, chargenumber   FROM inventory  
202
                       WHERE warehouse_id = ? AND parts_id = ?  GROUP BY bin_id, chargenumber having SUM(qty)>0|;
202
    my $tempquery = qq|SELECT SUM(qty), bin_id, chargenumber, bestbefore   FROM inventory  
203
                       WHERE warehouse_id = ? AND parts_id = ?  GROUP BY bin_id, chargenumber, bestbefore having SUM(qty)>0|;
203 204
    my $tempsth   = prepare_execute_query($form, $dbh, $tempquery, $params{dst_warehouse_id}, $currentPart_ID);
204 205

  
205 206
    # Alle Werte zu dem einzelnen Artikel, die wir später auslagern
......
208 209
    while (my $temphash_ref = $tempsth->fetchrow_hashref()) {
209 210
      my $temppart_bin_id       = $temphash_ref->{bin_id}; # kann man hier den quelllagerplatz beim verbauen angeben?
210 211
      my $temppart_chargenumber = $temphash_ref->{chargenumber};
212
      my $temppart_bestbefore   = $temphash_ref->{bestbefore};
211 213
      my $temppart_qty          = $temphash_ref->{sum};
212 214

  
213 215
      if ($tmpPartsQTY > $temppart_qty) {  # wir haben noch mehr waren zum wegbuchen. 
......
218 220
                                            # Dieser Wert IST und BLEIBT positiv!! Hilfe. 
219 221
                                            # Liegt das daran, dass dieser Wert aus einem SQL-Statement stammt?
220 222
        do_statement($form, $sthTransferPartSQL, $transferPartSQL, $currentPart_ID, $params{dst_warehouse_id}, 
221
                     $temppart_bin_id, $temppart_chargenumber, 'Verbraucht für ' .
223
                     $temppart_bin_id, $temppart_chargenumber, $temppart_bestbefore, 'Verbraucht für ' .
222 224
                     $self->get_part_description(parts_id => $params{assembly_id}), $params{login}, $temppart_qty);
223 225

  
224 226
        # hier ist noch ein fehler am besten mit definierten erzeugnissen debuggen 02/2009 jb
......
228 230
      } else { # okay, wir haben weniger oder gleich Waren die wir wegbuchen müssen, wir können also aufhören
229 231
        $tmpPartsQTY *=-1;
230 232
        do_statement($form, $sthTransferPartSQL, $transferPartSQL, $currentPart_ID, $params{dst_warehouse_id},
231
                     $temppart_bin_id, $temppart_chargenumber, 'Verbraucht für ' .
233
                     $temppart_bin_id, $temppart_chargenumber, $temppart_bestbefore, 'Verbraucht für ' .
232 234
                     $self->get_part_description(parts_id => $params{assembly_id}), $params{login}, $tmpPartsQTY);
233 235
        last; # beendet die schleife (springt zum letzten element)
234 236
      }
235
    }  # ende while SELECT SUM(qty), bin_id, chargenumber   FROM inventory  WHERE warehouse_id
237
    }  # ende while SELECT SUM(qty), bin_id, chargenumber, bestbefore   FROM inventory  WHERE warehouse_id
236 238
  } #ende while select parts_id,qty from assembly where id = ?
237 239
  if ($kannNichtFertigen) {
238 240
    return $kannNichtFertigen;
239 241
  }
240 242

  
241 243
  # soweit alles gut. Jetzt noch die wirkliche Lagerbewegung für das Erzeugnis ausführen ...
242
  my $transferAssemblySQL = qq|INSERT INTO inventory (parts_id, warehouse_id, bin_id, chargenumber, 
244
  my $transferAssemblySQL = qq|INSERT INTO inventory (parts_id, warehouse_id, bin_id, chargenumber, bestbefore,
243 245
                                                      comment, employee_id, qty, trans_id, trans_type_id)
244
                               VALUES (?, ?, ?, ?, ?, (SELECT id FROM employee WHERE login = ?), ?, nextval('id'),
246
                               VALUES (?, ?, ?, ?, ?, ?, (SELECT id FROM employee WHERE login = ?), ?, nextval('id'),
245 247
                               (SELECT id FROM transfer_type WHERE direction = 'in' AND description = 'stock'))|;
246 248
  my $sthTransferAssemblySQL   = prepare_query($form, $dbh, $transferAssemblySQL);
247 249
  do_statement($form, $sthTransferAssemblySQL, $transferAssemblySQL, $params{assembly_id}, $params{dst_warehouse_id}, 
248
               $params{dst_bin_id}, $params{chargenumber}, $params{comment}, $params{login}, $params{qty});
250
               $params{dst_bin_id}, $params{chargenumber}, $params{bestbefore}, $params{comment}, $params{login}, $params{qty});
249 251
  $dbh->commit();
250 252

  
251 253
  $main::lxdebug->leave_sub();
......
294 296
    push @filter_vars, '%' . $filter{chargenumber} . '%';
295 297
  }
296 298

  
299
  if ($form->{bestbefore}) {
300
    push @filter_ary, "?::DATE = i1.bestbefore::DATE";
301
    push @filter_vars, $form->{bestbefore};
302
  }
303

  
297 304
  if ($form->{fromdate}) {
298 305
    push @filter_ary, "?::DATE <= i1.itime::DATE";
299 306
    push @filter_vars, $form->{fromdate};
......
344 351
     "partdescription"      => "p.description",
345 352
     "bindescription"       => "b.description",
346 353
     "chargenumber"         => "i1.chargenumber",
354
     "bestbefore"           => "i1.bestbefore",
347 355
     "warehousedescription" => "w.description",
348 356
     "partunit"             => "p.unit",
349 357
     "bin_from"             => "b1.description",
......
512 520
#  - partsid      - will return matches with this parts_id only
513 521
#  - description  - will return only matches where the given string is a substring of the description
514 522
#  - chargenumber - will return only matches where the given string is a substring of the chargenumber
523
#  - bestbefore   - will return only matches with this bestbefore date
515 524
#  - ean          - will return only matches where the given string is a substring of the ean as stored in the table parts (article)
516 525
#  - charge_ids   - must be an arrayref. will return contents with these ids only
517 526
#  - expires_in   - will only return matches that expire within the given number of days
......
574 583
    push @filter_ary,  "i.chargenumber ILIKE ?";
575 584
    push @filter_vars, '%' . $filter{chargenumber} . '%';
576 585
  }
586

  
587
  if ($form->{bestbefore}) {
588
    push @filter_ary, "?::DATE = i.bestbefore::DATE";
589
    push @filter_vars, $form->{bestbefore};
590
  }
591

  
577 592
  if ($filter{ean}) {
578 593
    push @filter_ary,  "p.ean ILIKE ?";
579 594
    push @filter_vars, '%' . $filter{ean} . '%';
......
616 631
     "bindescription"       => "b.description",
617 632
     "binid"                => "b.id",
618 633
     "chargenumber"         => "i.chargenumber",
634
     "bestbefore"           => "i.bestbefore",
619 635
     "ean"                  => "p.ean",
620 636
     "chargeid"             => "c.id",
621 637
     "warehousedescription" => "w.description",
......
810 826

  
811 827
  my $dbh      = $params{dbh} || $form->get_standard_dbh();
812 828

  
813
  my $query = qq| SELECT SUM(qty), bin_id, chargenumber  FROM inventory where parts_id = ? AND warehouse_id = ? GROUP BY bin_id, chargenumber|;
829
  my $query = qq| SELECT SUM(qty), bin_id, chargenumber, bestbefore  FROM inventory where parts_id = ? AND warehouse_id = ? GROUP BY bin_id, chargenumber, bestbefore|;
814 830

  
815 831
  my $sth_QTY      = prepare_execute_query($form, $dbh, $query, ,$params{parts_id}, $params{warehouse_id}); #info: aufruf an DBUtils.pm
816 832

  
817 833
  my $max_qty_parts = 0; #Initialisierung mit 0
818
  while (my $ref = $sth_QTY->fetchrow_hashref()) {  # wir laufen über alle chargen und Lagerorte (s.a. SQL-Query oben)
834
  while (my $ref = $sth_QTY->fetchrow_hashref()) {  # wir laufen über alle Haltbarkeiten, chargen und Lagerorte (s.a. SQL-Query oben)
819 835
    $max_qty_parts += $ref->{sum};
820 836
  }
821 837

  
bin/mozilla/common.pl
76 76
    $has_charge = 1;
77 77
    map { $_->{has_charge} = 1; } @parts;
78 78
  }
79
  my $has_bestbefore = 0;
80
  if (defined($parts[0]->{bestbefore})) {
81
    $has_bestbefore = 1;
82
    map { $_->{has_bestbefore} = 1; } @parts;
83
  }
79 84
  my $has_ean = 0;
80 85
  if (defined($parts[0]->{ean})) {
81 86
    $has_ean = 1;
......
92 97
                                     "nextsub"          => "select_part_internal",
93 98
                                     "callback_sub"     => $callback_sub,
94 99
                                     "has_charge"       => $has_charge,
100
                                     "has_bestbefore"   => $has_bestbefore,
95 101
                                     "has_ean"          => $has_ean,
96 102
                                     "remap_parts_id"   => $remap_parts_id,
97 103
                                     "remap_partnumber" => $remap_partnumber });
bin/mozilla/do.pl
1004 1004

  
1005 1005
  foreach my $i (1..$form->{rowcount}) {
1006 1006
    $form->{"qty_$i"} = $form->parse_amount(\%myconfig, $form->{"qty_$i"});
1007
    push @{ $stock_info }, { map { $_ => $form->{"${_}_${i}"} } qw(warehouse_id bin_id chargenumber qty unit) };
1007
    push @{ $stock_info }, { map { $_ => $form->{"${_}_${i}"} } qw(warehouse_id bin_id chargenumber bestbefore qty unit) };
1008 1008
  }
1009 1009

  
1010 1010
  display_stock_in_form($stock_info);
......
1033 1033
  my %myconfig = %main::myconfig;
1034 1034
  my $locale   = $main::locale;
1035 1035

  
1036
  $form->{jsscript} = 1;
1037

  
1036 1038
  $form->{title} = $locale->text('Stock');
1037 1039

  
1038 1040
  my $part_info  = IC->get_basic_part_info('id' => $form->{parts_id});
......
1068 1070

  
1069 1071
    next if ($form->{"qty_$i"} <= 0);
1070 1072

  
1071
    push @{ $stock_info }, { map { $_ => $form->{"${_}_${i}"} } qw(warehouse_id bin_id chargenumber qty unit) };
1073
    push @{ $stock_info }, { map { $_ => $form->{"${_}_${i}"} } qw(warehouse_id bin_id chargenumber bestbefore qty unit) };
1072 1074
  }
1073 1075

  
1074 1076
  $form->{stock} = YAML::Dump($stock_info);
......
1107 1109
      foreach my $sinfo (@{ $stock_info }) {
1108 1110
        next if (($row->{bin_id}       != $sinfo->{bin_id}) ||
1109 1111
                 ($row->{warehouse_id} != $sinfo->{warehouse_id}) ||
1110
                 ($row->{chargenumber} ne $sinfo->{chargenumber}));
1112
                 ($row->{chargenumber} ne $sinfo->{chargenumber}) ||
1113
                 ($row->{bestbefore}   ne $sinfo->{bestbefore}));
1111 1114

  
1112 1115
        map { $row->{"stock_$_"} = $sinfo->{$_} } qw(qty unit error);
1113 1116
      }
......
1147 1150
      'warehouse_id' => $form->{"warehouse_id_$i"},
1148 1151
      'bin_id'       => $form->{"bin_id_$i"},
1149 1152
      'chargenumber' => $form->{"chargenumber_$i"},
1153
      'bestbefore'   => $form->{"bestbefore_$i"},
1150 1154
      'qty'          => $form->{"qty_$i"},
1151 1155
      'unit'         => $form->{"unit_$i"},
1152 1156
      'row'          => $i,
......
1266 1270
        $request->{parts_id} = $form->{"id_$i"};
1267 1271
        $request->{base_qty} = $request->{qty} * $units->{$request->{unit}}->{factor} / $base_unit_factor;
1268 1272

  
1269
        my $map_key          = join '--', ($form->{"id_$i"}, @{$request}{qw(warehouse_id bin_id chargenumber)});
1273
        my $map_key          = join '--', ($form->{"id_$i"}, @{$request}{qw(warehouse_id bin_id chargenumber bestbefore)});
1270 1274

  
1271 1275
        $request_map{$map_key}                 ||= $request;
1272 1276
        $request_map{$map_key}->{sum_base_qty} ||= 0;
......
1292 1296
      my @contents     = DO->get_item_availability('parts_id' => \@part_ids);
1293 1297

  
1294 1298
      foreach my $inv (@contents) {
1295
        my $map_key = join '--', @{$inv}{qw(parts_id warehouse_id bin_id chargenumber)};
1299
        my $map_key = join '--', @{$inv}{qw(parts_id warehouse_id bin_id chargenumber bestbefore)};
1296 1300

  
1297 1301
        next unless ($request_map{$map_key});
1298 1302

  
......
1306 1310
        my $pinfo = $part_info_map{$request->{parts_id}};
1307 1311
        my $binfo = $bin_info_map{$request->{bin_id}};
1308 1312

  
1309
        push @{ $form->{ERRORS} }, $locale->text("There is not enough available of '#1' at warehouse '#2', bin '#3', #4, for the transfer of #5.",
1313
        push @{ $form->{ERRORS} }, $locale->text("There is not enough available of '#1' at warehouse '#2', bin '#3', #4, #5, for the transfer of #6.",
1310 1314
                                                 $pinfo->{description}, $binfo->{warehouse_description}, $binfo->{bin_description},
1311 1315
                                                 $request->{chargenumber} ? $locale->text('chargenumber #1', $request->{chargenumber}) : $locale->text('no chargenumber'),
1316
                                                 $request->{bestbefore} ? $locale->text('bestbefore #1', $request->{bestbefore}) : $locale->text('no bestbefore'),
1312 1317
                                                 $form->format_amount_units('amount'      => $request->{sum_base_qty},
1313 1318
                                                                            'part_unit'   => $pinfo->{unit},
1314 1319
                                                                            'conv_units'  => 'convertible_not_smaller'));
bin/mozilla/wh.pl
164 164

  
165 165
  $form->show_generic_error($locale->text("The source warehouse does not contain any bins.")) if (0 == scalar @{ $warehouse->{BINS} });
166 166

  
167
  map { $form->{"l_$_"} = 'Y' } qw(parts_id qty warehouseid binid partnumber partdescription bindescription chargenumber partunit ean);
167
  map { $form->{"l_$_"} = 'Y' } qw(parts_id qty warehouseid binid partnumber partdescription bindescription chargenumber bestbefore partunit ean);
168 168

  
169 169
  $form->{sort} = 'bindescription';
170 170
  my @contents  = WH->get_warehouse_report("warehouse_id" => $form->{warehouse_id},
171 171
                                           "bin_id"       => $form->{bin_id},
172 172
                                           "chargenumber" => $form->{chargenumber},
173
                                           "bestbefore"   => $form->{bestbefore},
173 174
                                           "partnumber"   => $form->{partnumber},
174 175
                                           "ean"          => $form->{ean},
175 176
                                           "description"  => $form->{description});
......
219 220

  
220 221
  $form->show_generic_error($locale->text("The source warehouse does not contain any bins.")) if (0 == scalar @{ $warehouse->{BINS} });
221 222

  
222
  map { $form->{"l_$_"} = 'Y' } qw(parts_id qty warehouseid binid partnumber partdescription bindescription chargenumber partunit);
223
  map { $form->{"l_$_"} = 'Y' } qw(parts_id qty warehouseid binid partnumber partdescription bindescription chargenumber bestbefore partunit);
223 224

  
224 225
  $form->{sort} = 'bindescription';
225 226
  my @contents  = WH->get_warehouse_report("warehouse_id" => $form->{warehouse_id});
......
243 244
      'transfer_type_id' => $form->{transfer_type_id},
244 245
    };
245 246

  
246
    map { $transfer->{$_} = $form->{"${_}_${row}"} } qw(src_bin_id chargenumber parts_id qty dst_warehouse_id dst_bin_id);
247
    map { $transfer->{$_} = $form->{"${_}_${row}"} } qw(src_bin_id chargenumber bestbefore parts_id qty dst_warehouse_id dst_bin_id);
247 248

  
248 249
    my $entry;
249 250

  
250 251
    foreach (@contents) {
251
      if (($_->{binid} == $transfer->{src_bin_id}) && ($_->{parts_id} == $transfer->{parts_id}) && ($_->{chargenumber} eq $transfer->{chargenumber})) {
252
      if (($_->{binid} == $transfer->{src_bin_id}) && ($_->{parts_id} == $transfer->{parts_id}) && ($_->{chargenumber} eq $transfer->{chargenumber}) && $_->{bestbefore} eq $transfer->{bestbefore}) {
252 253
        $entry = $_;
253 254
        last;
254 255
      }
......
441 442
    'dst_warehouse_id' => $form->{warehouse_id},
442 443
    'dst_bin_id'       => $form->{bin_id},
443 444
    'chargenumber'     => $form->{chargenumber},
445
    'bestbefore'       => $form->{bestbefore},
444 446
    'assembly_id'      => $form->{parts_id},
445 447
    'qty'              => $form->{qty},
446 448
    'unit'             => $form->{unit},
......
455 457
    $form->show_generic_error($ret, 'back_button' => 1);
456 458
  }
457 459

  
458
  delete @{$form}{qw(parts_id partnumber description qty unit chargenumber comment)};
460
  delete @{$form}{qw(parts_id partnumber description qty unit chargenumber bestbefore comment)};
459 461

  
460 462
  $form->{saved_message} = $locale->text('The assembly has been created.');
461 463
  $form->{trans_type}    = 'assembly';
......
487 489
    'dst_warehouse_id' => $form->{warehouse_id},
488 490
    'dst_bin_id'       => $form->{bin_id},
489 491
    'chargenumber'     => $form->{chargenumber},
492
    'bestbefore'       => $form->{bestbefore},
490 493
    'parts_id'         => $form->{parts_id},
491 494
    'qty'              => $form->{qty},
492 495
    'unit'             => $form->{unit},
......
495 498

  
496 499
  WH->transfer($transfer);
497 500

  
498
  delete @{$form}{qw(parts_id partnumber description qty unit chargenumber comment)};
501
  delete @{$form}{qw(parts_id partnumber description qty unit chargenumber bestbefore comment)};
499 502

  
500 503
  $form->{saved_message} = $locale->text('The parts have been stocked.');
501 504
  $form->{trans_type}    = 'stock';
......
546 549

  
547 550
  $form->show_generic_error($locale->text("The warehouse does not contain any bins.")) if (0 == scalar @{ $warehouse->{BINS} });
548 551

  
549
  map { $form->{"l_$_"} = 'Y' } qw(parts_id qty warehouseid binid partnumber partdescription bindescription chargenumber partunit);
552
  map { $form->{"l_$_"} = 'Y' } qw(parts_id qty warehouseid binid partnumber partdescription bindescription chargenumber bestbefore partunit);
550 553

  
551 554
  $form->{sort} = 'bindescription';
552 555
  my @contents  = WH->get_warehouse_report("warehouse_id" => $form->{warehouse_id});
......
570 573
      'transfer_type_id' => $form->{transfer_type_id},
571 574
    };
572 575

  
573
    map { $transfer->{$_} = $form->{"${_}_${row}"} } qw(src_bin_id chargenumber parts_id qty);
576
    map { $transfer->{$_} = $form->{"${_}_${row}"} } qw(src_bin_id chargenumber bestbefore parts_id qty);
574 577

  
575 578
    my $entry;
576 579

  
577 580
    foreach (@contents) {
578
      if (($_->{binid} == $transfer->{src_bin_id}) && ($_->{parts_id} == $transfer->{parts_id}) && ($_->{chargenumber} eq $transfer->{chargenumber})) {
581
      if (($_->{binid} == $transfer->{src_bin_id}) && ($_->{parts_id} == $transfer->{parts_id}) && ($_->{chargenumber} eq $transfer->{chargenumber}) && ($_->{bestbefore} eq $transfer->{bestbefore})) {
579 582
        $entry = $_;
580 583
        last;
581 584
      }
......
654 657
  $form->{sort}  ||= 'date';
655 658

  
656 659
  my %filter;
657
  my @columns = qw(trans_id date warehouse_from bin_from warehouse_to bin_to partnumber partdescription chargenumber trans_type comment qty employee oe_id projectnumber);
660
  my @columns = qw(trans_id date warehouse_from bin_from warehouse_to bin_to partnumber partdescription chargenumber bestbefore trans_type comment qty employee oe_id projectnumber);
658 661

  
659 662
  # filter stuff
660
  map { $filter{$_} = $form->{$_} if ($form->{$_}) } qw(warehouse_id bin_id partnumber description chargenumber);
663
  map { $filter{$_} = $form->{$_} if ($form->{$_}) } qw(warehouse_id bin_id partnumber description chargenumber bestbefore);
661 664

  
662 665
  $filter{qty_op} = WH->convert_qty_op($form->{qty_op});
663 666
  if ($filter{qty_op}) {
......
672 675
  my $report = SL::ReportGenerator->new(\%myconfig, $form);
673 676

  
674 677
  my @hidden_variables = map { "l_${_}" } @columns;
675
  push @hidden_variables, qw(warehouse_id bin_id partnumber description chargenumber qty_op qty qty_unit fromdate todate);
678
  push @hidden_variables, qw(warehouse_id bin_id partnumber description chargenumber bestbefore qty_op qty qty_unit fromdate todate);
676 679

  
677 680
  my %column_defs = (
678 681
    'date'            => { 'text' => $locale->text('Date'), },
......
686 689
    'partnumber'      => { 'text' => $locale->text('Part Number'), },
687 690
    'partdescription' => { 'text' => $locale->text('Description'), },
688 691
    'chargenumber'    => { 'text' => $locale->text('Charge Number'), },
692
    'bestbefore'      => { 'text' => $locale->text('Best Before'), },
689 693
    'qty'             => { 'text' => $locale->text('Qty'), },
690 694
    'employee'        => { 'text' => $locale->text('Employee'), },
691 695
    'projectnumber'   => { 'text' => $locale->text('Project Number'), },
......
777 781

  
778 782
  show_no_warehouses_error() if (!scalar @{ $form->{WAREHOUSES} });
779 783

  
780
  $form->{fokus}   = "partnumber";
781
  $form->{onload} .= "focus();";
784
  $form->{jsscript} = 1;
785

  
786
#  $form->{fokus}   = "partnumber";
787
#  $form->{onload} .= "focus();";
782 788
  $form->{title}   = $locale->text("Report about wareouse contents");
783 789

  
784 790
  $form->header();
......
804 810
  my $sort_col     = $form->{sort};
805 811

  
806 812
  my %filter;
807
  my @columns = qw(warehousedescription bindescription partnumber partdescription chargenumber qty stock_value);
813
  my @columns = qw(warehousedescription bindescription partnumber partdescription chargenumber bestbefore qty stock_value);
808 814

  
809 815
  # filter stuff
810
  map { $filter{$_} = $form->{$_} if ($form->{$_}) } qw(warehouse_id bin_id partnumber description chargenumber);
816
  map { $filter{$_} = $form->{$_} if ($form->{$_}) } qw(warehouse_id bin_id partnumber description chargenumber bestbefore);
811 817

  
812 818
  $filter{qty_op} = WH->convert_qty_op($form->{qty_op});
813 819
  if ($filter{qty_op}) {
......
824 830
  my $report = SL::ReportGenerator->new(\%myconfig, $form);
825 831

  
826 832
  my @hidden_variables = map { "l_${_}" } @columns;
827
  push @hidden_variables, qw(warehouse_id bin_id partnumber description chargenumber qty_op qty qty_unit l_warehousedescription l_bindescription);
833
  push @hidden_variables, qw(warehouse_id bin_id partnumber description chargenumber bestbefore qty_op qty qty_unit l_warehousedescription l_bindescription);
828 834
  push @hidden_variables, qw(include_empty_bins subtotal);
829 835

  
830 836
  my %column_defs = (
......
833 839
    'partnumber'           => { 'text' => $locale->text('Part Number'), },
834 840
    'partdescription'      => { 'text' => $locale->text('Description'), },
835 841
    'chargenumber'         => { 'text' => $locale->text('Charge Number'), },
842
    'bestbefore'           => { 'text' => $locale->text('Best Before'), },
836 843
    'qty'                  => { 'text' => $locale->text('Qty'), },
837 844
    'stock_value'          => { 'text' => $locale->text('Stock value'), },
838 845
  );
doc/dokumentenvorlagen-und-variablen.html
1212 1212
    <td><code>si_chargenumber</code></td>
1213 1213
    <td>Chargennummer</td>
1214 1214
   </tr>
1215
   <tr>
1216
    <td><code>si_bestbefore</code></td>
1217
    <td>Mindesthaltbarkeit</td>
1218
   </tr>
1215 1219
   <tr>
1216 1220
    <td><code>si_number</code></td>
1217 1221
    <td>Artikelnummer</td>
sql/Pg-upgrade2/warehouse_add_bestbefore.sql
1
-- @tag: warehouse_add_bestbefore
2
-- @description: Spalten für Mindesthaltbarkeitsdatum
3
-- @depends: release_2_6_0
4
ALTER TABLE inventory ADD COLUMN bestbefore date;
5
ALTER TABLE delivery_order_items_stock ADD COLUMN bestbefore date;
templates/webpages/do/stock_in_form_master.html
92 92
     <th class="listheading"><translate>Warehouse</translate></th>
93 93
     <th class="listheading"><translate>Bin</translate></th>
94 94
     <th class="listheading"><translate>Charge Number</translate></th>
95
     <th class="listheading"><translate>Best Before</translate></th>
95 96
     <th align="right" class="listheading"><translate>Qty</translate></th>
96 97
     <th align="right" class="listheading"><translate>Unit</translate></th>
97 98
    </tr>
......
105 106
     <td>[% HTML.escape(row.warehouse_description) %]</td>
106 107
     <td>[% HTML.escape(row.bin_description) %]</td>
107 108
     <td>[% HTML.escape(row.chargenumber) %]</td>
109
     <td>[% HTML.escape(row.bestbefore) %]</td>
108 110
     <td>[% HTML.escape(LxERP.format_amount(row.qty)) %]</td>
109 111
     <td>[% HTML.escape(row.unit) %]</td>
110 112

  
......
120 122

  
121 123
     <td><select name="bin_id_[% loop.count %]" id="bin_id_[% loop.count %]"></select></td>
122 124
     <td><input name="chargenumber_[% loop.count %]" value="[% HTML.escape(row.chargenumber) %]"></td>
125

  
126
     <td>
127
       <input name="bestbefore_[% loop.count %]" id="bestbefore_[% loop.count %]" value="[% HTML.escape(row.bestbefore) %]" size="11" title="[% myconfig_dateformat %]">
128
       <input type="button" name="b_bestbefore_[% loop.count %]" id="bestbefore_trigger_[% loop.count %]" value="?">
129
     </td>
130

  
123 131
     <td><input name="qty_[% loop.count %]" size="12" value="[% HTML.escape(LxERP.format_amount(row.qty)) %]"></td>
124 132

  
125 133
     <td>
......
149 157
  </p>
150 158
 </form>
151 159

  
160
 [%- IF NOT delivered %]
161
  <script type="text/javascript">
162
    <!--
163
    [%- FOREACH row = STOCK_INFO %]
164
    Calendar.setup( {
165
      inputField : "bestbefore_[% loop.count %]",
166
      ifFormat :"[% myconfig_jsc_dateformat %]",
167
      align : "BR",
168
      button : "bestbefore_trigger_[% loop.count %]"
169
    });
170
    [%- END %]
171
    //-->
172
  </script>
173
  [%- END %]
174

  
152 175
</body>
153 176
</html>
154 177

  
templates/webpages/do/stock_out_form_master.html
60 60
     <th class="listheading"><translate>Warehouse</translate></th>
61 61
     <th class="listheading"><translate>Bin</translate></th>
62 62
     <th class="listheading"><translate>Charge Number</translate></th>
63
     <th class="listheading"><translate>Best Before</translate></th>
63 64
     [%- UNLESS delivered %]
64 65
     <th align="right" class="listheading"><translate>Available qty</translate></th>
65 66
     [%- END %]
......
73 74
     <td>[% HTML.escape(row.warehousedescription) %]</td>
74 75
     <td>[% HTML.escape(row.bindescription) %]</td>
75 76
     <td>[% HTML.escape(row.chargenumber) %]</td>
77
     <td>[% HTML.escape(row.bestbefore) %]</td>
76 78

  
77 79
     [%- IF delivered %]
78 80

  
......
103 105
    <input type="hidden" name="warehouse_id_[% loop.count %]" value="[% HTML.escape(row.warehouse_id) %]">
104 106
    <input type="hidden" name="bin_id_[% loop.count %]"       value="[% HTML.escape(row.bin_id) %]">
105 107
    <input type="hidden" name="chargenumber_[% loop.count %]" value="[% HTML.escape(row.chargenumber) %]">
108
    <input type="hidden" name="bestbefore_[% loop.count %]" value="[% HTML.escape(row.bestbefore) %]">
106 109
    [%- END %]
107 110
   </table>
108 111
  </p>
templates/webpages/generic/select_part_master.html
20 20
     [% IF has_charge %]
21 21
     <th class="listheading"><translate>Charge number</translate></th>
22 22
     [% END %]
23
     [% IF has_bestbefore %]
24
     <th class="listheading"><translate>Best Before</translate></th>
25
     [% END %]
23 26
     [% IF has_ean %]
24 27
     <th class="listheading"><translate>EAN</translate></th>
25 28
     [% END %]
......
49 52
      [% HTML.escape(part.chargenumber) %]
50 53
     </td>
51 54
     [% END %]
55
     [% IF has_bestbefore %]
56
     <td>
57
      <input type="hidden" name="new_bestbefore_id_[% loop.count %]" value="[% HTML.escape(part.bestbefore_id) %]">
58
      <input type="hidden" name="new_bestbefore_[% loop.count %]" value="[% HTML.escape(part.bestbefore) %]">
59
      [% HTML.escape(part.bestbefore) %]
60
     </td>
61
     [% END %]
52 62
     [% IF has_ean %]
53 63
     <td>
54 64
      <input type="hidden" name="new_ean_[% loop.count %]" value="[% HTML.escape(part.ean) %]">
templates/webpages/wh/journal_filter_master.html
104 104
        <th align="right" nowrap><translate>Charge Number</translate>:</th>
105 105
        <td><input name="chargenumber" size=40></td>
106 106
       </tr>
107
       <tr>
108
        <th align="right" nowrap><translate>Best Before</translate>:</th>
109
        <td>
110
         <input name="bestbefore" id="bestbefore" size="11" title="[% myconfig_dateformat %]">
111
         <input type="button" name="b_bestbefore" id="bestbefore_trigger" value="?">
112
        </td>
113
       </tr>
107 114
       <tr>
108 115
        <th align="right" nowrap><translate>Transfer Quantity</translate>:</th>
109 116
        <td>
......
159 166
        <td nowrap><label for="l_partnumber"><translate>Part Number</translate></label></td>
160 167
        <td align="right"><input name="l_chargenumber" id="l_chargenumber" class="checkbox" type="checkbox" value="Y" checked></td>
161 168
        <td nowrap><label for="l_chargenumber"><translate>Charge Number</translate></label></td>
169
        <td align="right"><input name="l_bestbefore" id="l_bestbefore" class="checkbox" type="checkbox" value="Y" checked></td>
170
        <td nowrap><label for="l_bestbefore"><translate>Best Before</translate></label></td>
162 171
       </tr>
163 172
       <tr>
164 173
        <td align="right"><input name="l_trans_id" id="l_trans_id" class="checkbox" type="checkbox" value="Y"></td>
......
199 208

  
200 209
  <script type="text/javascript">
201 210
    <!--
211
    Calendar.setup( {
212
      inputField : "bestbefore",
213
      ifFormat :"[% myconfig_jsc_dateformat %]",
214
      align : "BR",
215
      button : "bestbefore_trigger"
216
    });
217

  
202 218
    Calendar.setup( {
203 219
      inputField : "fromdate",
204 220
      ifFormat :"[% myconfig_jsc_dateformat %]",
templates/webpages/wh/removal_parts_selection_master.html
34 34
     <th class="listheading"><translate>Part Number</translate></th>
35 35
     <th class="listheading"><translate>Part Description</translate></th>
36 36
     <th class="listheading"><translate>Charge Number</translate></th>
37
     <th class="listheading"><translate>Best Before</translate></th>
37 38
     <th class="listheading"><translate>EAN</translate></th>
38 39
     <th class="listheading"><translate>Available qty</translate></th>
39 40
     <th class="listheading"><translate>Removal qty</translate></th>
......
46 47
     <input type="hidden" name="partnumber_[% loop.count %]" value="[% HTML.escape(row.partnumber) %]">
47 48
     <input type="hidden" name="partdescription_[% loop.count %]" value="[% HTML.escape(row.partdescription) %]">
48 49
     <input type="hidden" name="chargenumber_[% loop.count %]" value="[% HTML.escape(row.chargenumber) %]">
50
     <input type="hidden" name="bestbefore_[% loop.count %]" value="[% HTML.escape(row.bestbefore) %]">
49 51
     <input type="hidden" name="ean_[% loop.count %]" value="[% HTML.escape(row.ean) %]">
50 52
     <td>[% HTML.escape(row.bindescription) %]</td>
51 53
     <td>[% HTML.escape(row.partnumber) %]</td>
52 54
     <td>[% HTML.escape(row.partdescription) %]</td>
53 55
     <td>[% HTML.escape(row.chargenumber) %]</td>
56
     <td>[% HTML.escape(row.bestbefore) %]</td>
54 57
     <td>[% HTML.escape(row.ean) %]</td>
55 58
     <td>[% HTML.escape(row.qty) %]</td>
56 59
     <td>
templates/webpages/wh/report_filter_master.html
104 104
        <th align="right" nowrap><translate>Charge Number</translate>:</th>
105 105
        <td><input name="chargenumber" size=40></td>
106 106
       </tr>
107
       <tr>
108
        <th align="right" nowrap><translate>Best Before</translate>:</th>
109
        <td>
110
         <input name="bestbefore" id="bestbefore" size="11" title="[% myconfig_dateformat %]">
111
         <input type="button" name="b_bestbefore" id="bestbefore_trigger" value="?">
112
        </td>
113
       </tr>
107 114
       <tr>
108 115
        <th align="right" nowrap><translate>Qty in stock</translate>:</th>
109 116
        <td>
......
147 154
        <td nowrap><label for="l_partnumber"><translate>Part Number</translate></label></td>
148 155
        <td align="right"><input name="l_chargenumber" id="l_chargenumber" class="checkbox" type="checkbox" value="Y" checked></td>
149 156
        <td nowrap><label for="l_chargenumber"><translate>Charge Number</translate></label></td>
157
        <td align="right"><input name="l_bestbefore" id="l_bestbefore" class="checkbox" type="checkbox" value="Y" checked></td>
158
        <td nowrap><label for="l_bestbefore"><translate>Best Before</translate></label></td>
150 159
       </tr>
151 160

  
152 161
       <tr><td colspan="4"><hr noshade height="1"></td></tr>
......
174 183
  </p>
175 184
 </form>
176 185

  
186
 <script type="text/javascript">
187
   <!--
188
     Calendar.setup( {
189
     inputField : "bestbefore",
190
     ifFormat :"[% myconfig_jsc_dateformat %]",
191
     align : "BR",
192
     button : "bestbefore_trigger"
193
     });
194
   //-->
195
 </script>
196

  
177 197
</body>
178 198
</html>
templates/webpages/wh/transfer_parts_selection_master.html
66 66
     <th class="listheading"><translate>Part Number</translate></th>
67 67
     <th class="listheading"><translate>Part Description</translate></th>
68 68
     <th class="listheading"><translate>Charge Number</translate></th>
69
     <th class="listheading"><translate>Best Before</translate></th>
69 70
     <th class="listheading"><translate>EAN</translate></th>
70 71
     <th class="listheading"><translate>Available qty</translate></th>
71 72
     <th class="listheading" colspan="2"><translate>Transfer qty</translate></th>
......
79 80
     <input type="hidden" name="partnumber_[% loop.count %]" value="[% HTML.escape(row.partnumber) %]">
80 81
     <input type="hidden" name="partdescription_[% loop.count %]" value="[% HTML.escape(row.partdescription) %]">
81 82
     <input type="hidden" name="chargenumber_[% loop.count %]" value="[% HTML.escape(row.chargenumber) %]">
83
     <input type="hidden" name="bestbefore_[% loop.count %]" value="[% HTML.escape(row.bestbefore) %]">
82 84
     <input type="hidden" name="ean_[% loop.count %]" value="[% HTML.escape(row.ean) %]">
83 85
     <td>[% HTML.escape(row.bindescription) %]</td>
84 86
     <td>[% HTML.escape(row.partnumber) %]</td>
85 87
     <td>[% HTML.escape(row.partdescription) %]</td>
86 88
     <td>[% HTML.escape(row.chargenumber) %]</td>
89
     <td>[% HTML.escape(row.bestbefore) %]</td>
87 90
     <td>[% HTML.escape(row.ean) %]</td>
88 91
     <td>[% HTML.escape(row.qty) %]</td>
89 92
     <td><input name="qty_[% loop.count %]" size="8" style="text-align: right"></td>
templates/webpages/wh/warehouse_selection_assembly_master.html
105 105
     <td><input name="chargenumber" size="30" value="[% HTML.escape(chargenumber) %]"></td>
106 106
    </tr>
107 107

  
108
    <tr>
109
     <th align="right" nowrap><translate>Best Before</translate></th>
110
     <td>
111
       <input name="bestbefore" id="bestbefore" size="11" value="[% HTML.escape(bestbefore) %]" title="[% myconfig_dateformat %]">
112
       <input type="button" name="b_bestbefore" id="bestbefore_trigger" value="?">
113
       </td>
114
    </tr>
115

  
108 116
    <tr>
109 117
     <th align="right" nowrap><translate>Quantity</translate></th>
110 118
     <td>
......
131 139
  </p>
132 140
 </form>
133 141

  
142
 <script type="text/javascript">
143
   <!--
144
     Calendar.setup( {
145
     inputField : "bestbefore",
146
     ifFormat :"[% myconfig_jsc_dateformat %]",
147
     align : "BR",
148
     button : "bestbefore_trigger"
149
     });
150
   //-->
151
 </script>
152

  
134 153
</body>
135 154
</html>
templates/webpages/wh/warehouse_selection_master.html
118 118
     <th align="right" nowrap><translate>Charge number</translate></th>
119 119
     <td><input name="chargenumber" size="30"></td>
120 120
    </tr>
121

  
122
    <tr>
123
     <th align="right" nowrap><translate>Best Before</translate></th>
124
     <td>
125
       <input name="bestbefore" id="bestbefore" size="11" title="[% myconfig_dateformat %]">
126
       <input type="button" name="b_bestbefore" id="bestbefore_trigger" value="?">
127
     </td>
128
    </tr>
129

  
121 130
    <tr>
122 131
     <th align="right" nowrap><translate>EAN</translate></th>
123 132
     <td><input name="ean" size="30"></td>
......
130 139
  </p>
131 140
 </form>
132 141

  
142
 <script type="text/javascript">
143
   <!--
144
     Calendar.setup( {
145
     inputField : "bestbefore",
146
     ifFormat :"[% myconfig_jsc_dateformat %]",
147
     align : "BR",
148
     button : "bestbefore_trigger"
149
     });
150
   //-->
151
 </script>
152

  
133 153
</body>
134 154
</html>
templates/webpages/wh/warehouse_selection_stock_master.html
104 104
     <th align="right" nowrap><translate>Charge number</translate></th>
105 105
     <td><input name="chargenumber" size="30" value="[% HTML.escape(chargenumber) %]"></td>
106 106
    </tr>
107

  
108
    <tr>
109
     <th align="right" nowrap><translate>Best Before</translate></th>
110
     <td>
111
       <input name="bestbefore" id="bestbefore" size="11" value="[% HTML.escape(bestbefore) %]" title="[% myconfig_dateformat %]">
112
       <input type="button" name="b_bestbefore" id="bestbefore_trigger" value="?">
113
     </td>
114
    </tr>
115

  
107 116
    <tr>
108 117
     <th align="right" nowrap><translate>EAN</translate></th>
109 118
     <td><input name="ean" size="30" value="[% HTML.escape(ean) %]"></td>
......
135 144
  </p>
136 145
 </form>
137 146

  
147
 <script type="text/javascript">
148
   <!--
149
     Calendar.setup( {
150
     inputField : "bestbefore",
151
     ifFormat :"[% myconfig_jsc_dateformat %]",
152
     align : "BR",
153
     button : "bestbefore_trigger"
154
     });
155
   //-->
156
 </script>
157

  
138 158
</body>
139 159
</html>

Auch abrufbar als: Unified diff