[OFBiz] Dev - service for accessing supplier product information for purchase orders

Si Chen schen at graciousstyle.com
Thu Sep 23 13:56:44 EDT 2004


Dear David, Andy, Olivier, Jacopo:

I know you've been working on the purchase order component at some 
point, so I'd like to get your opinion on this.

It seems right now that there is the SupplierProduct entity defined and 
services for maintaining it.  I didn't find any services for getting 
information out of the SupplierProduct, such as price and description, 
to put on a purchase order.  Did I miss it?

If not, here is what I'm thinking about creating:
service findSuppliersforProduct
inputs: product (GenericEntity), productId (string), partyId (string).  
Later on, perhaps quantity, supplierPrefOrderId, supplierRatingTypeId 
can be added as well.
Service takes either product, or if not available, finds a product from 
productId, and gets all its SupplierProduct entities.  If there is a 
partyId, it checks that it is actually a supplier.  It then filters them 
out for the currently applicable ones returns a list of these 
SupplierProduct entities.  Later on, it can use quantity, 
supplierPrefOrderId, supplierRatingTypeId to filter the returned 
supplier product entities further.  For example, it can check that 
quantity is an allowed quantity (ie, exceeds the minimum quantity, is a 
fixed minimum quantity plus a multiple of the incremental order quantity.) 
The user of the service can then take this list and figure out which one 
to use for prices, product id, and product name on the purchase order.  
If the rules are very specific, there should only be one returned.  If 
not, the calling service (such as the order manager) can show the whole 
list to the user ask him/her to choose the right one.

If later the purchase order data is implemented with Agreement-related 
entities as well, this service can be re-factored to create 
SupplierProduct entities based on what is the Agreement-related 
entities.  Or it can maybe use a combination of Agreement-related and 
SupplierProduct entities, to maintain compatibility with existing data.

Does this sound like a good idea?  Please let me know, and I'll code it 
up and put it on the issue tracker. :-)

Si


More information about the Dev mailing list