projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tests für access-String-Auswertung des Menüs.
[kivitendo-erp.git]
/
SL
/
PriceSource
/
Pricegroup.pm
diff --git
a/SL/PriceSource/Pricegroup.pm
b/SL/PriceSource/Pricegroup.pm
index
62fabf5
..
3bae2d0
100644
(file)
--- a/
SL/PriceSource/Pricegroup.pm
+++ b/
SL/PriceSource/Pricegroup.pm
@@
-51,7
+51,13
@@
sub price_from_source {
my $price = SL::DB::Manager::Price->find_by(pricegroup_id => $spec, parts_id => $self->part->id);
my $price = SL::DB::Manager::Price->find_by(pricegroup_id => $spec, parts_id => $self->part->id);
- # TODO: if someone deletes the prices entry, this fails. add a fallback
+ if (!$price) {
+ return SL::PriceSource::Price->new(
+ price_source => $self,
+ missing => t8('Could not find an entry for this part in the pricegroup.'),
+ );
+ }
+
return $self->make_price($price);
}
return $self->make_price($price);
}