X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/226002b006db4254bc5585ce0a7a994d020abee8..2ecfde54bd40a15f430010faa28ec81383e4eec6:/SL/PriceSource/Discount.pm diff --git a/SL/PriceSource/Discount.pm b/SL/PriceSource/Discount.pm index ded123a81..ae4592bd9 100644 --- a/SL/PriceSource/Discount.pm +++ b/SL/PriceSource/Discount.pm @@ -5,6 +5,7 @@ use strict; use parent 'SL::DB::Object'; use Rose::Object::MakeMethods::Generic ( scalar => [ qw(discount description spec price_source invalid missing) ], + 'scalar --get_set_init' => [ qw(priority) ], ); require SL::DB::Helper::Attr; @@ -38,6 +39,10 @@ sub to_str { "source: @{[ $_[0]->source ]}, discount: @{[ $_[0]->discount ]}, description: @{[ $_[0]->description ]}" } +sub init_priority { + 3 +} + 1; __END__ @@ -46,7 +51,7 @@ __END__ =head1 NAME -SL::PriceSource::Discount - contrainer to pass calculated discounts around +SL::PriceSource::Discount - container to pass calculated discounts around =head1 SYNOPSIS @@ -70,7 +75,7 @@ SL::PriceSource::Discount - contrainer to pass calculated discounts around ); # invalid discount - SL::PriceSource::Dicount->new( + SL::PriceSource::Discount->new( discount => $original_discount, spec => $original_spec, description => $original_description, @@ -109,6 +114,11 @@ A localized short description of the origins of this discount. A ref to the creating algorithm. +=item C + +OPTIONAL. Discounts may supply a numerical priority. Higher will trump over lower, even when +supplying lower discounts. Defaults to 3 (as in middle of 1-5). + =item C OPTIONAL. Both indicator and localized message that the discount with this spec