Revision fa37b23d
Von Martin Helmling martin.helmling@octosoft.eu vor mehr als 4 Jahren hinzugefügt
SL/Helper/Inventory.pm | ||
---|---|---|
sub allocate {
|
||
my (%params) = @_;
|
||
|
||
my $part = $params{part} or Carp::croak('allocate needs a part');
|
||
my $qty = $params{qty} or Carp::croak('allocate needs a qty');
|
||
die SL::X::Inventory::Allocation->new(
|
||
error => 'allocate needs a part',
|
||
msg => t8("Method allocate needs the parameter 'part'"),
|
||
) unless $params{part};
|
||
die SL::X::Inventory::Allocation->new(
|
||
error => 'allocate needs a qty',
|
||
msg => t8("Method allocate needs the parameter 'qty'"),
|
||
) unless $params{qty};
|
||
|
||
my $part = $params{part};
|
||
my $qty = $params{qty};
|
||
|
||
return () if $qty <= 0;
|
||
|
Auch abrufbar als: Unified diff
Inventory Helper: Bessere Fehlermeldung bei fehlenden Parametern
Alle Fehler im allocate() des Inventory-Helpers werden nun per
SL::X::Inventory::Allocation Fehlermethode erzeugt,
damit es eine einheitliche Prüfung geben kann.
verbessert egw 12413