Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0845ca9d

Von Martin Helmling martin.helmling@octosoft.eu vor mehr als 3 Jahren hinzugefügt

  • ID 0845ca9d3bd7adc7689a34d562c3ff0371711514
  • Vorgänger 21b7295d
  • Nachfolger 2951ed30

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

Unterschiede anzeigen:

SL/Helper/Inventory.pm
167 167
sub allocate {
168 168
  my (%params) = @_;
169 169

  
170
  my $part = $params{part} or Carp::croak('allocate needs a part');
171
  my $qty  = $params{qty}  or Carp::croak('allocate needs a qty');
170
  die SL::X::Inventory::Allocation->new(
171
    error => 'allocate needs a part',
172
    msg => t8("Method allocate needs the parameter 'part'"),
173
  ) unless $params{part};
174
  die SL::X::Inventory::Allocation->new(
175
    error => 'allocate needs a qty',
176
    msg => t8("Method allocate needs the parameter 'qty'"),
177
  ) unless $params{qty};
178

  
179
  my $part = $params{part};
180
  my $qty  = $params{qty};
172 181

  
173 182
  return () if $qty <= 0;
174 183

  

Auch abrufbar als: Unified diff