Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / SL / PriceSource / Price.pm
index 0ecc8b0..5255847 100644 (file)
@@ -4,8 +4,8 @@ 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) ],
+  scalar => [ qw(price description spec price_source invalid missing unknown) ],
+  'scalar --get_set_init' => [ qw(priority editable) ],
 );
 
 require SL::DB::Helper::Attr;
@@ -43,6 +43,10 @@ sub init_priority {
   3
 }
 
+sub init_editable {
+  0
+}
+
 1;
 
 __END__
@@ -119,6 +123,18 @@ A ref to the creating algorithm.
 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<editable>
+
+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<missing>
 
 OPTIONAL. Both indicator and localized message that the price with this spec
@@ -133,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<source>.
 
+=item C<unknown>
+
+OPTIONAL. Boolean indicator that this price was not computed for performance
+reasons. This is only valid for PriceSources flagged as C<fast>. This price
+must be ignored.
+
 =back
 
 =head1 SEE ALSO