X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FPriceSource%2FBase.pm;h=513f3d44e86c89a1d506ec270a710fbe8390fa16;hb=2d975c005034c80400abd22cfd6cd737d172045a;hp=b095684cfd1597f458314b2c0b983039085414e3;hpb=418f0e7084b02c1c057e4f10b858b6bffc25e354;p=kivitendo-erp.git diff --git a/SL/PriceSource/Base.pm b/SL/PriceSource/Base.pm index b095684cf..513f3d44e 100644 --- a/SL/PriceSource/Base.pm +++ b/SL/PriceSource/Base.pm @@ -13,14 +13,22 @@ sub description { die 'description needs to be implemented' } sub available_prices { die 'available_prices needs to be implemented' } +sub available_discounts { die 'available_discounts needs to be implemented' } + sub best_price { die 'best_price needs to be implemented' } +sub best_discounts { die 'best_discounts needs to be implemented' } + sub price_from_source { die 'price_from_source needs to be implemented:' . "@_" } sub part { $_[0]->record_item->part; } +sub customer_vendor { + $_[0]->record->is_sales ? $_[0]->record->customer : $_[0]->record->vendor; +} + 1; __END__ @@ -98,6 +106,10 @@ anything and do not save those. Shortcut to C<< record_item->part >> +=item C + +Shortcut to C<< record->is_sales ? record->customer : record->vendor >> + =back =head1 INTERFACE METHODS @@ -121,16 +133,30 @@ for the current situation. Each price must have a unique spec that can be used to recreate it later. Try to be brief, no one needs 20 different price suggestions. +=item C + +Must return a list of all prices that you algorithm can recommend the user +for the current situation. Each discount must have a unique spec that can be +used to recreate it later. Try to be brief, no one needs 20 different discount +suggestions. + =item C Must return what you think of as the best matching price in your C. This does not have to be the lowest price, but it will be compared later to other price sources, and the lowest will be set. +=item C + +Must return what you think of as the best matching discount in your +C. This does not have to be the highest discount, but it +will be compared later to other price sources, and the highest will be set. + =item C -Must recreate the price from C and return. For reference, the complete -C entry from C is included. +Must recreate the price or discount from C and return. For reference, the +complete C entry from C or +C is included. Note that constraints from the rest of the C do not apply anymore. If information needed for the retrieval can be deleted elsewhere, then you must @@ -183,6 +209,8 @@ The price field in purchase records is still C. C and C are tainted. If you store data directly in C, sanitize. +=back + =head1 SEE ALSO L,