projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Inventory: Exception Klassen korrigiert
[kivitendo-erp.git]
/
SL
/
Helper
/
Inventory.pm
diff --git
a/SL/Helper/Inventory.pm
b/SL/Helper/Inventory.pm
index
da3e5b1
..
147bc7d
100644
(file)
--- a/
SL/Helper/Inventory.pm
+++ b/
SL/Helper/Inventory.pm
@@
-197,8
+197,8
@@
sub allocate {
}
if ($rest_qty > 0) {
die SL::X::Inventory::Allocation->new(
}
if ($rest_qty > 0) {
die SL::X::Inventory::Allocation->new(
-
error
=> 'not enough to allocate',
- m
sg
=> t8("can not allocate #1 units of #2, missing #3 units", _format_number($qty), $part->displayable_name, _format_number($rest_qty)),
+
code
=> 'not enough to allocate',
+ m
essage
=> t8("can not allocate #1 units of #2, missing #3 units", _format_number($qty), $part->displayable_name, _format_number($rest_qty)),
);
} else {
if ($params{constraints}) {
);
} else {
if ($params{constraints}) {
@@
-238,8
+238,8
@@
sub check_constraints {
if ('CODE' eq ref $constraints) {
if (!$constraints->(@$allocations)) {
die SL::X::Inventory::Allocation->new(
if ('CODE' eq ref $constraints) {
if (!$constraints->(@$allocations)) {
die SL::X::Inventory::Allocation->new(
-
error
=> 'allocation constraints failure',
- m
sg
=> t8("Allocations didn't pass constraints"),
+
code
=> 'allocation constraints failure',
+ m
essage
=> t8("Allocations didn't pass constraints"),
);
}
} else {
);
}
} else {
@@
-272,8
+272,8
@@
sub check_constraints {
SL::DB::Bin->load_cached($_->bin_id)->full_description,
_format_number($_->qty), _format_number($needed), $_->chargenumber ? $_->chargenumber : '--') for @allocs;
die SL::X::Inventory::Allocation->new(
SL::DB::Bin->load_cached($_->bin_id)->full_description,
_format_number($_->qty), _format_number($needed), $_->chargenumber ? $_->chargenumber : '--') for @allocs;
die SL::X::Inventory::Allocation->new(
-
error
=> 'allocation constraints failure',
- m
sg
=> $err,
+
code
=> 'allocation constraints failure',
+ m
essage
=> $err,
);
}
}
);
}
}
@@
-319,7
+319,10
@@
sub produce_assembly {
$allocations_by_part{ $assembly->parts_id } -= $assembly->qty * $qty;
}
$allocations_by_part{ $assembly->parts_id } -= $assembly->qty * $qty;
}
- die "allocations are insufficient for production" if any { $_ < 0 } values %allocations_by_part;
+ die SL::X::Inventory::Allocation->new(
+ code => "allocations are insufficient for production",
+ message => t8('can not allocate enough resources for production'),
+ ) if any { $_ < 0 } values %allocations_by_part;
}
my @transfers;
}
my @transfers;