X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FPriceRule.pm;h=1c43d4a966ce96acd12006392f92c73324657c19;hb=5349a1ed016ae603b39d73747eccc6792707db1c;hp=e33b3a3e4e7a8a613d1737d2bb1981fa91a9aa8c;hpb=305907229bc616658513b73604fc61c3e6613094;p=kivitendo-erp.git diff --git a/SL/DB/PriceRule.pm b/SL/DB/PriceRule.pm index e33b3a3e4..1c43d4a96 100644 --- a/SL/DB/PriceRule.pm +++ b/SL/DB/PriceRule.pm @@ -7,7 +7,6 @@ use strict; use SL::DB::MetaSetup::PriceRule; use SL::DB::Manager::PriceRule; -use Rose::DB::Object::Helpers qw(clone_and_reset); use SL::Locale::String qw(t8); __PACKAGE__->meta->add_relationship( @@ -96,7 +95,8 @@ sub validate { my @errors; push @errors, $::locale->text('The name must not be empty.') if !$self->name; push @errors, $::locale->text('Price or discount must not be zero.') if !$self->price && !$self->discount && !$self->reduction; - push @errors, $::locale->text('Pirce rules must have at least one rule.') if !@{[ $self->items ]}; + push @errors, $::locale->text('Price rules must have at least one rule.') if !@{[ $self->items ]}; + push @errors, $_->validate for $self->items; return @errors; }