Revision 7fc41a37
Von Moritz Bunkus vor fast 2 Jahren hinzugefügt
bin/mozilla/wh.pl | ||
---|---|---|
32 | 32 |
# |
33 | 33 |
####################################################################### |
34 | 34 |
|
35 |
use Carp; |
|
35 | 36 |
use List::Util qw(min max first); |
36 | 37 |
use POSIX qw(strftime); |
38 |
use Scalar::Util qw(blessed); |
|
37 | 39 |
|
38 | 40 |
use SL::Form; |
39 | 41 |
use SL::User; |
... | ... | |
396 | 398 |
$form->{bestbefore} = ''; |
397 | 399 |
} |
398 | 400 |
|
399 |
produce_assembly( |
|
401 |
eval { |
|
402 |
produce_assembly( |
|
400 | 403 |
part => $assembly, # target assembly |
401 | 404 |
qty => $form->{qty}, # qty |
402 | 405 |
auto_allocate => 1, |
... | ... | |
404 | 407 |
chargenumber => $form->{chargenumber}, # optional |
405 | 408 |
bestbefore => $form->{bestbefore}, |
406 | 409 |
comment => $form->{comment}, # optional |
407 |
); |
|
410 |
); |
|
411 |
1; |
|
412 |
|
|
413 |
} or do { |
|
414 |
my $ex = $@; |
|
415 |
die $ex unless blessed($ex) && $ex->isa('SL::X::Inventory::Allocation::Multi'); |
|
416 |
|
|
417 |
$form->{title} = $locale->text('Produce Assembly'); |
|
418 |
$form->header; |
|
419 |
print $form->parse_html_template( |
|
420 |
'wh/produce_assembly_error', |
|
421 |
{ |
|
422 |
missing_qty_exceptions => [ grep { $_->isa('SL::X::Inventory::Allocation::MissingQty') } @{ $ex->errors } ], |
|
423 |
other_exceptions => [ grep { !$_->isa('SL::X::Inventory::Allocation::MissingQty') } @{ $ex->errors } ], |
|
424 |
}); |
|
425 |
|
|
426 |
return $::lxdebug->leave_sub(); |
|
427 |
}; |
|
408 | 428 |
|
409 | 429 |
delete @{$form}{qw(parts_id partnumber description qty unit chargenumber bestbefore comment)}; |
410 | 430 |
|
Auch abrufbar als: Unified diff
Erzeugnis fertigen: alle möglichen Allokationsfehler auf einmal anzeigen