197 |
197 |
}
|
198 |
198 |
if ($rest_qty > 0) {
|
199 |
199 |
die SL::X::Inventory::Allocation->new(
|
200 |
|
error => 'not enough to allocate',
|
201 |
|
msg => t8("can not allocate #1 units of #2, missing #3 units", _format_number($qty), $part->displayable_name, _format_number($rest_qty)),
|
|
200 |
code => 'not enough to allocate',
|
|
201 |
message => t8("can not allocate #1 units of #2, missing #3 units", _format_number($qty), $part->displayable_name, _format_number($rest_qty)),
|
202 |
202 |
);
|
203 |
203 |
} else {
|
204 |
204 |
if ($params{constraints}) {
|
... | ... | |
238 |
238 |
if ('CODE' eq ref $constraints) {
|
239 |
239 |
if (!$constraints->(@$allocations)) {
|
240 |
240 |
die SL::X::Inventory::Allocation->new(
|
241 |
|
error => 'allocation constraints failure',
|
242 |
|
msg => t8("Allocations didn't pass constraints"),
|
|
241 |
code => 'allocation constraints failure',
|
|
242 |
message => t8("Allocations didn't pass constraints"),
|
243 |
243 |
);
|
244 |
244 |
}
|
245 |
245 |
} else {
|
... | ... | |
272 |
272 |
SL::DB::Bin->load_cached($_->bin_id)->full_description,
|
273 |
273 |
_format_number($_->qty), _format_number($needed), $_->chargenumber ? $_->chargenumber : '--') for @allocs;
|
274 |
274 |
die SL::X::Inventory::Allocation->new(
|
275 |
|
error => 'allocation constraints failure',
|
276 |
|
msg => $err,
|
|
275 |
code => 'allocation constraints failure',
|
|
276 |
message => $err,
|
277 |
277 |
);
|
278 |
278 |
}
|
279 |
279 |
}
|
... | ... | |
319 |
319 |
$allocations_by_part{ $assembly->parts_id } -= $assembly->qty * $qty;
|
320 |
320 |
}
|
321 |
321 |
|
322 |
|
die "allocations are insufficient for production" if any { $_ < 0 } values %allocations_by_part;
|
|
322 |
die SL::X::Inventory::Allocation->new(
|
|
323 |
code => "allocations are insufficient for production",
|
|
324 |
message => t8('can not allocate enough resources for production'),
|
|
325 |
) if any { $_ < 0 } values %allocations_by_part;
|
323 |
326 |
}
|
324 |
327 |
|
325 |
328 |
my @transfers;
|
Inventory: Exception Klassen korrigiert
Exception::Class behandelt message und error speziell, und dadurch
gingen im portierten Inventory Helper feature die exceptions kaputt.
In SL::X ist jetzt ein Kommentar der das beschreibt.