Facebooktwittergoogle_plusredditpinterestlinkedin

Hi Everyone,

There are times when you need to create many replenish records at once. By having replenish records for each product, you can include these products in your Replenish Report. This situation is particularly handy for high-volume wholesale distribution.

This post shows a convenient way to mass produce your records. The below statement will return your replenish insert statements for the two warehouses specified. You can run this query and send the results to a file. All you need to do is modify the WHERE clause or the product JOIN clause to meet your specific needs.

select 'INSERT INTO m_replenish VALUES (' 
 || p.m_product_id || ', ' || wh.m_warehouse_id || ', ' || p.ad_client_id || ', ' 
 || p.ad_org_id || ', ' || '''' || p.isactive ||'''' || ', current_date , ' 
 || 1058279 || ', current_date , ' 
 || 1058279 || ', ' || '''1''' || ', ' || 0 || ', ' || 0 || ', ' 
 || 'null' || ', ' || loc.m_locator_id 
 || ');'
 as insertSmt
from m_product p
 inner join m_warehouse wh on 
  (wh.m_warehouse_id = 1000015 or wh.m_warehouse_id = 1000014)
 inner join m_locator loc on (wh.m_warehouse_id = loc.m_warehouse_id)
where loc.m_locator_id in (1000013, 1000014)
 and p.ad_client_id = 1000000
--limit 10

Then, use PSQL to pipe the results into your database:

psql -h 10.1.1.99 -U adempiere -d adempiere -f AboveResultsSentToFile.sql

I used the above statement to create about 1M replenishment records in a couple of minutes. I hope this helps!!

Please note that ADempiere, iDempiere and Openbravo are forks or copies from Compiere. Therefore, they have similar abilities mentioned above. The biggest difference is that ADempiere and iDempiere are pure open source. There are no features held behind a commercial or paid license. This is especially true for open source manufacturing (MRP).

About Chuck Boecking: I am an ERP educator. I believe that open source ERP have achieved mainstream capabilities, and as a result, more companies can create greater efficiency across their organization. I started using the iDempiere code base in 2003. Back then, it was called Compiere. In 2006, I started my first multi-million dollar installation. Since then, ADempiere has helped me create great success with distribution and manufacturing companies all over the world. My vision of success is to find companies that can best use open source ERP to help them achieve a single, global instance that drives a discontinuous increase in profitability. I believe that organizations win when they own their technology.

If you have questions, comments or concerns, let me know. I definitely want your feedback.

You can contact me by phone using 512.850.6068.

My email is chuck@chuboe.com.

You can complete the form on this page.

Thank you for taking the time. I look forward to speaking with you.

Regards,
Chuck Boecking
http://www.linkedin.com/pub/chuck-boecking/10/970/17b

 

 

Facebooktwittergoogle_plusredditpinterestlinkedin

Leave a Reply

Your email address will not be published. Required fields are marked *