Login  Register

[OFBiz] Users - Change to ProductPrice to support ProductPricePurpose

Posted by David E. Jones on Sep 03, 2005; 1:28pm
URL: http://ofbiz.116.s1.nabble.com/OFBiz-Users-Change-to-ProductPrice-to-support-ProductPricePurpose-tp135781.html


I just committed some changes in the ProductPrice table and the way  
calculateProductPrice works (rev 5638).

In the past we had an over-use of the productPriceTypeId and have  
come up with a need to use some of those other price types, but along  
with the price calculation and such. The solution is to introduce the  
concept of the ProductPricePurpose, so we have a new table for that  
and a new field on the ProductPrice entity for the  
productPricePurposeId.

Previous calculated prices are now considered to have the PURCHASE  
purpose, and for the calculateProductPrice service if you don't pass  
in the purpose you want it defaults to PURCHASE. Some previous  
ProductPriceTypes are no longer used as such and are now  
ProductPricePurposes, namely RECURRING_CHARGE, USAGE_CHARGE, and  
COMPONENT_PRICE. The real driving force behind this change is a need  
to support price calculation for RECURRING_CHARGE and  
COMPONENT_PRICE, and other custom or future price purposes.

NOTE: this did require a primary key change for the ProductPrice  
table, the calculateProductPrice service will still support a null  
productPricePurposeId so that after an upgrade the whole system won't  
be useless, but that table or the pk on that table should be rebuilt  
right away for this change. All ProductPrice seed data has been  
updated to support this change.

DOUBLE NOTE: if you are using COMPONENT_PRICE type prices you'll need  
to change those prices (or create equivalent new ones) such that the  
productPricePurposeId=COMPONENT_PRICE and the  
productPriceTypeId=DEFAULT_PRICE.

-David


 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users