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:

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'));

Auch abrufbar als: Unified diff