X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FPriceSource%2FPrice.pm;h=52558470c9deaed41c0b3f8343fc21347ff3bf55;hb=f8fff60be1abb9986486cc7367747ee16d829116;hp=71bd1ff4f0e42d42f21e62a1736ed3dda92f1bde;hpb=89b2668811eac6023ad58322e2f9970ddb6a27c9;p=kivitendo-erp.git diff --git a/SL/PriceSource/Price.pm b/SL/PriceSource/Price.pm index 71bd1ff4f..52558470c 100644 --- a/SL/PriceSource/Price.pm +++ b/SL/PriceSource/Price.pm @@ -4,7 +4,8 @@ use strict; use parent 'SL::DB::Object'; use Rose::Object::MakeMethods::Generic ( - scalar => [ qw(price description spec price_source invalid missing) ], + scalar => [ qw(price description spec price_source invalid missing unknown) ], + 'scalar --get_set_init' => [ qw(priority editable) ], ); require SL::DB::Helper::Attr; @@ -38,6 +39,14 @@ sub to_str { "source: @{[ $_[0]->source ]}, price: @{[ $_[0]->price ]}, description: @{[ $_[0]->description ]}" } +sub init_priority { + 3 +} + +sub init_editable { + 0 +} + 1; __END__ @@ -46,7 +55,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 +118,23 @@ A localized short description of the origins of this price. A ref to the creating algorithm. +=item C + +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 + +OPTIONAL. Prices may flag themselves as editable. An editable price will still +be subject to checks for higher or lower prices, but will be rendered in a +fashion that allows the user to overwrite it. + +This is potentially very distracting if the price is usually a default price +and will be changed in a lot of instances so use with caution. + +On the other hand it can provide the capability that users unfamiliar with the +system will intuitively expect so it can be a good way to introduce the system. + =item C OPTIONAL. Both indicator and localized message that the price with this spec @@ -123,6 +149,12 @@ price are no longer valid, and that the price should be changed. If price is missing, you do not need to supply anything except C. +=item C + +OPTIONAL. Boolean indicator that this price was not computed for performance +reasons. This is only valid for PriceSources flagged as C. This price +must be ignored. + =back =head1 SEE ALSO