X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/2bdd0bc580210b18c1b76a0d0bd4fc3bd3fceca2..418f0e7084b02c1c057e4f10b858b6bffc25e354:/SL/PriceSource/Price.pm diff --git a/SL/PriceSource/Price.pm b/SL/PriceSource/Price.pm index 593c5ff90..23d3a9ec2 100644 --- a/SL/PriceSource/Price.pm +++ b/SL/PriceSource/Price.pm @@ -4,7 +4,7 @@ use strict; use parent 'SL::DB::Object'; use Rose::Object::MakeMethods::Generic ( - scalar => [ qw(price description spec price_source) ], + scalar => [ qw(price description spec price_source invalid missing) ], array => [ qw(depends_on) ] ); @@ -32,3 +32,104 @@ sub to_str { } 1; + +__END__ + +=encoding utf-8 + +=head1 NAME + +SL::PriceSource::Price - contrainer to pass calculated prices around + +=head1 SYNOPSIS + + # in PriceSource::Base implementation + $price = SL::PriceSource::Price->new( + price => 10.3, + spec => '10.3', # something you can easily parse later + description => t8('Fix price 10.3'), + price_source => $self, + ) + + # special empty price in SL::PriceSource + SL::PriceSource::Price->new( + description => t8('None (PriceSource)'), + ); + + # invalid price + SL::PriceSource::Price->new( + price => $original_price, + spec => $original_spec, + description => $original_description, + invalid => t8('Offer expired #1 weeks ago', $dt->delta_weeks), + price_source => $self, + ); + + # missing price + SL::PriceSource::Price->new( + price => $original_price, # will keep last entered price + spec => $original_spec, + description => '', + missing => t8('Um, sorry, cannot find that one'), + price_source => $self, + ); + + +=head1 DESCRIPTION + +See L for information about the mechanism. + +This is a container for prices that are generated by L +implementations. + +=head1 CONSTRUCTOR FIELDS + +=over 4 + +=item C + +The price. A price of 0 is special and is considered undesirable. If passed as +part of C it will be filtered out. If returned as +C or C it will be warned about. + +=item C + +A unique string that can later be understood by the creating implementation. +Can be empty if the implementation only supports one price for a given +record_item. + +=item C + +A localized short description of the origins of this price. + +=item C + +A ref to the creating algorithm. + +=item C + +OPTIONAL. Both indicator and localized message that the price with this spec +could not be reproduced and should be changed. + +=item C + +OPTIONAL. Both indicator and localized message that the conditions for this +price are no longer valid, and that the price should be changed. + +=back + +=head1 SEE ALSO + +L, +L, +L + +=head1 BUGS + +None yet. :) + +=head1 AUTHOR + +Sven Schoeling Es.schoeling@linet-services.deE + +=cut