Revision 982ea316
Von Sven Schöling vor fast 4 Jahren hinzugefügt
SL/Helper/Inventory.pm | ||
---|---|---|
253 | 253 |
sub produce_assembly { |
254 | 254 |
my (%params) = @_; |
255 | 255 |
|
256 |
my $part = $params{part} or Carp::croak('allocate needs a part');
|
|
257 |
my $qty = $params{qty} or Carp::croak('allocate needs a qty');
|
|
256 |
my $part = $params{part} or Carp::croak('produce_assembly needs a part');
|
|
257 |
my $qty = $params{qty} or Carp::croak('produce_assembly needs a qty');
|
|
258 | 258 |
|
259 | 259 |
my $allocations = $params{allocations}; |
260 |
if (!$allocations && $params{auto_allocate}) { |
|
260 |
if ($params{auto_allocate}) { |
|
261 |
Carp::croak("produce_assembly: can't have both allocations and auto_allocate") if $params{allocations}; |
|
261 | 262 |
$allocations = [ allocate_for_assembly(part => $part, qty => $qty) ]; |
262 | 263 |
} else { |
263 |
Carp::croak("need allocations or auto_allocate to produce something") unless $allocations; |
|
264 |
Carp::croak("produce_assembly: need allocations or auto_allocate to produce something") if !$params{allocations}; |
|
265 |
$allocations = $params{allocations}; |
|
264 | 266 |
} |
265 | 267 |
|
266 | 268 |
my $bin = $params{bin} or Carp::croak("need target bin"); |
Auch abrufbar als: Unified diff
Inventory Helper: Parametercheck verbessert