[OFBiz] Users - generating minimum stock requirements

Si Chen sichen at opensourcestrategies.com
Tue Jul 26 20:09:57 EDT 2005


Jacopo -

Found what I think might be the issue:

in checkCreateStockRequirement, you have this if statement:

<if-compare-field field-name="quantityOnHandTotal" 
to-field-name="productFacility.minimumStock" operator="greater-equals" 
type="Double">

So basically you are making sure that the QOH total starts out being 
greater than minimum stock before issuing a requirement.  Thus, if the 
item is already below minimum stock, no more requirements will be created.

I think we should change this code so that:
1.  We should always calculate what the new QOH will be
2.  If the new QOH is below the minimum stock, then first see if a 
requirement for this facility and product already exists and is in the 
state of CREATED.  If it is, then update this requirement with the new 
quantity.  If not, then create a new requirement.

That way, as an item is continuously ordered, the amount required is 
added to, until a person can intervene and order it.

Also, do you think the Requirements should have the facilityId field 
filled in.

Finally, in the order manager, are you using the requirement status to 
control which requirements can be used to add to the order?  If not, 
should we do that?


Si


Jacopo Cappellato wrote:

> Hi Si,
>
> first of all: I'm very happy to see you are interested in the auto 
> requirement stuff.
> Second: I've developed the "minimum stock requirement" stuff to 
> provide richer auto requirement features to the OFBiz community but 
> (at least until now) I'm not using it so I've made just a few test 
> (I've only used the "auto requirement for every sales order" method so 
> far)... so it's great  to get your help over this!
> Third: your setup seems good. You can set the requirement generation 
> method both at product level or at product store level.
>
> Here are some details:
>
> The service is called "checkCreateStockRequirement" and is defined in 
> the order/servicedef/services.xml file
> The simple method implementation is in the 
> order/script/org/ofbiz/order/order/OrderServices.xml file
>
> The service is triggered thru the following two secas defined in 
> order/servicedef/secas.xml file:
>
>     <!-- Requirement / stock level -->
>     <eca service="createItemIssuance" event="invoke">
>         <condition field-name="quantity" value="0" operator="greater" 
> type="Double"/>
>         <action service="checkCreateStockRequirement" mode="sync"/>
>     </eca>
>     <eca service="updateItemIssuance" event="invoke">
>         <condition field-name="quantity" value="0" operator="greater" 
> type="Double"/>
>         <action service="checkCreateStockRequirement" mode="sync"/>
>     </eca>
>
>
> Please, let me know if you need more information.
>
> Jacopo
>
>
> Si Chen wrote:
>
>> Hi Jacopo,
>>
>> I'm trying out the new requirements feature.  The feature to gnerate 
>> requirement automatically for every sales order works very well 
>> (thank you!)  However, I can't get it to generate requirements when 
>> QOH quantities fall below minimum.
>>
>> I set the Product's requirement enum Id to "When QOH reaches minimum 
>> stock for product-facility" and then for the warehouse facility the 
>> minimum stock and reorder quantities are 5 and 50, respectively.  
>> Then I order the item but even though the QOH is now negative no 
>> requirements are generated.
>>
>> Which service is supposed to create the requirements?  How is it 
>> supposed to be set up (configured as a SECA)?  If it's not a problem 
>> with the way I've set it up above, I'd like to look through and find 
>> out what happened to it.
>>
>> Thanks!
>>
>> Si
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.ofbiz.org
>> http://lists.ofbiz.org/mailman/listinfo/users
>>
>>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.ofbiz.org
> http://lists.ofbiz.org/mailman/listinfo/users
>


More information about the Users mailing list