SEPA: single-dbh
[kivitendo-erp.git] / SL / PriceSource / Price.pm
index 71bd1ff..0ecc8b0 100644 (file)
@@ -5,6 +5,7 @@ use strict;
 use parent 'SL::DB::Object';
 use Rose::Object::MakeMethods::Generic (
   scalar => [ qw(price 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 ]}, price: @{[ $_[0]->price ]}, description: @{[ $_[0]->description ]}"
 }
 
+sub init_priority {
+  3
+}
+
 1;
 
 __END__
@@ -46,7 +51,7 @@ __END__
 
 =head1 NAME
 
-SL::PriceSource::Price - contrainer to pass calculated prices around
+SL::PriceSource::Price - container to pass calculated prices around
 
 =head1 SYNOPSIS
 
@@ -109,6 +114,11 @@ A localized short description of the origins of this price.
 
 A ref to the creating algorithm.
 
+=item C<priority>
+
+OPTIONAL. Prices may supply a numerical priority. Higher will trump lower, even when
+supplying higher prices. Defaults to 3 (as in middle of 1-5).
+
 =item C<missing>
 
 OPTIONAL. Both indicator and localized message that the price with this spec