Professional Documents
Culture Documents
W2r3house MGMT S3rvc
W2r3house MGMT S3rvc
originated by
E-EVOLUTION
MEXICO
IDEMPIERE INTEGRATION
by
REDHUAN D. OON
Version 0.1
Libero Warehouse Management (Part I)
A two-part plugin based on Libero series of modules for the best free ERP
The In-bound module and Smart-Browser integration into Info-Window will be in Part II
sponsored by
BANGLADESH
TABLE OF CONTENTS
Introduction
5
Basic Warehouse System
6
Definition of WMS
7
Outbound Handling
8
Setup
9
Pre-requisite Plugin
9
Download and Install
9
2Pack for Meta-data
10
Warehouse Setup
11
Area and Section Setup
11
Warehouse Structure
12
Strategy and Rule Definition
12
Strategy Window
13
Operations
15
Info-Window
15
Login in ZK
16
Outbound Process
18
Outbound Records
18
Outbound Order To Released
20
Release Outbound as Distribution Order
21
Outbound Order To Ship
24
Generate Shipments From Outbound Order To Ship
25
Developer Guide
26
2Pack PackOut
26
Warehouse Document Type
27
Source Code Layout
28
Info-Window
29
Rule Engine
33
ModelValidator
34
Part II Roadmap
34
Free As In Freedom 35
Libero WMS IDempiere Integration
INTRODUCTION
As the above cover diagram describing the module implies, the Warehouse Management System
or WMS is now a plugin into iDempiere ERP which powerfully utilises the OSGi framework for
hot deploy without impact to the core code. The Libero WMS is also backward compatible.
However the Libero WMS only caters for Outbound operations and not the Inbound portion. It
also uses its own Libero SmartBrowser which in iDempiere is partly Info-Window. Their differ-
ence is that SmartBrowser has embedded Process function and Info-Window has not. Thus this
first part uses the Info-Window as a workaround and the embedded processes are extracted to
work externally. In Part II we shall attempt to incorporate the embedded process way of Smart-
Browser into the Info-Window.
As you probably know, from the previous manual or documents I have written on the subject,
iDempiere OSGi framework purpose in life is to avoid JAR hell, difficult overlapping mainte-
nance and core code corruption. To avoid the later (core code corruption) the iDempiere source
of its core is presided over by its top two maintainers, Carlos Ruiz and Low Heng Sin. They alone
decide what constitute the core as it is so vital that the core remain stable and open as well as
highly adaptive to any external plugin that may occur in the free marketplace.
It is not their intent to restrict nor to stop progress but on the contrary their attention to such a
principle ensures the opposite - unabated progress of the project via external OSGi plugins with
embedded 2Packs (to carry the metadata Application Dictionary changes).
This point has to be made very clear as in the example of Libero SmartBrowser, there will be a
core change request for them to consider, which is the embedding of Process function into the
Info-Window. Thus Low Heng Sin has imparted to me his advice on how best to bring in such a
useful feature and he has given me some suggestions how to go about doing it.
Finally, under the core maintainer guidance there can be proper incorporation of changes into
the core that will not impact the principles stated above.
The WMS is a more elaborate extension of the prevailing product storage aspect of the ERP, as
can be seen in the same diagram below labelled as the BASIC horizontal layer.
When a Sales Order is made, we can have a shipment which picks from the locator chosen of the
required product quantity. Likewise during purchase, a quantity is putaway into the chosen lo-
cator.
With the extension from WMS, we have as the INTERMEDIATE layer which allows the process
of picking and putaway process to be further refined to include an Outbound and Inbound
process respectively.
The intent with this INTERMEDIATE layer is to keep things simple and well designed and
documented for easy extension or add-on in the very complex global and diverse usage by as
many applications as possible out there.
You will note the more business friendly terms, ‘ERP Business & Logistics Management’ and
‘Warehouse Storage Management’ to assist in lay-man understanding.
Definition of WMS
The INTERMEDIATE part extends the BASIC warehouse storage management to include more
detailed location specification according to Rules.
The Rules are defined under a set of Outbound/Inbound strategy definitions that are determined
according to parameters such as type of Product, Business Partner or user-defined groups.
During Outbound, there can be manufacturing (MFG Order) as well as Distribution handling
and picking of the required product.
The more detailed location specification simply extend the BASIC warehouse locator structure
to be further ‘located according to Area and Section’. Under BASIC, there is only Warehouse/
Locator structure. (Ignore the image showing the additional + Area / Section for the BASIC
layer).
As explained early on, the Libero WMS only has the Outbound handling and lacks
the corresponding Inbound handling which we will create later in Part II.
Outbound Handling
The Libero WMS only has the Outbound handling which defines the way Sales Orders are ful-
filled from the storage facility. It usually centers around the Picking List which specify the prod-
uct and its quantity to load up for delivery. The Pick List specifies the Locator to obtain such ma-
terial. In Libero WMS, the Locator will be defined further under Warehouse/Area/Section
structure instead of just Warehouse/Locator.
The way the Picking List is populated also depends on the preset WMS Strategy that depends on
Rules that determines what Locator was assigned to a certain product based on the criteria of the
Product, Business Partner (vendor and customer) or user-defined Groups.
After describing the new Libero WMS in general, we shall setup the module, and operate it ac-
cordingly. We shall go through each window and learn of its contents and usage. We shall use the
Info-Window to view some of the information and execute the Processes that operate the Out-
bound picking list and generate the final shipments.
SETUP
The Libero WMS requires another plugin Libero MFG to work as there is dependency from
WMS to MFG for the manufacturing aspect. You can refer to the earlier LiberoMFG.pdf for
steps on setting it up. It should be simple and backward compatible without any further steps
other than install and start of the plugins. Send me an email red1@red1.org if you find anything
broken due to version changes in iDempiere.
Pre-requisite Plugin
You need to have an earlier LiberoMFG plugin installed before proceeding. Refer to the guide
from http://sourceforge.net/projects/red1/files/ADempiere%20PDFs/LiberoMFG.pdf/download.
Once the 2Pack in LiberoMFG has finished its 2Pack pack-in process, you may continue.
http://sourceforge.net/projects/red1/files/p2/WMS/org.idempiere.WMS_1.0.0.201401090821.jar/download
3. Then either use the Felix console when iDempiere is running under System login or go to the
native OSGi console and type in:
Then you will get a new bundle ID assigned to it and you can ‘start <id no>’ to get it going.
Sometimes you need to abort and redo your install or test the 2Packs again. You may have to re-
store your database to original fresh condition. You can do that via idempiere-server/utils/
RUN_ImportIdempiere routine as show below.
As usual, the 2Pack for the Application Dictionary menu and windows is already included in the
plugin. After you start the bundle ID in the OSGi console, you will see the name of the package
installed prompted there. You can launch the Java client and open up the Pack In window to con-
firm it is installed. In case the embedded 2Pack cannot work you can install it separately and
manually. Download the 2Pack from:
http://sourceforge.net/projects/red1/files/p2/WMS/LiberoWMS.zip/download
http://sourceforge.net/projects/red1/files/p2/WMS/WMSdata.zip/download
Warehouse Setup
Warehouse Structure
Above is showing the Structure set to Default Store Central for the Area and Section setting at
the Store Central warehouse. Later, we shall see how the WMS can apply such structure accord-
ing to a dynamic rule engine.
Strategy Window
Then we go to the Strategy window which acts as a header to hold the defined Rule. You can have
subsequent rules that will be referred in case the initial rule is not fulfilled or is false.
Note the Store Central setting to fit into our test case as we go along.
Definition Window
Now we come to the most exciting part of the setting up of the WMS, where we apply the defined
Strategy Rules to any Product item, Business Partner, Categories or Groups.
Note that the settings of Trees and Staff is to fit the later process setting needed during this test.
You can define as many assignments and they will be applied in order of a sort combination.
Each assignment will look at the selection setting to decide accordingly which Strategy Rule is
for it. (In our testing, we again need to set BPartner to Store Default (Central) which is of the
Staff Category as that has Linked OrgBP which is needed during Release Outbound Order)
With that last bit of setting which the sample data is already done for you, we can go ahead to op-
erate the WMS.
(Take note that in the year 2014, the initial database seed may not have the new calendar periods
defined. You can easily do that at the Calendar Window)
OPERATIONS
The present operations is only for Outbound shipments. I intend to finish the Inbound so as to
make this complete but as a later part two to this module.
Info-Window
The Info-Window is some kind of special window which we allows a set of criteria to access the
database records. In Libero WMS it has the Libero SmartBrowser which is like the Info-Window
but has an additional process button that will act on the displayed selection of records. Below is
an example of the Info-Window in action:
The SmartBrowser is not used in present iDempiere and thus the workaround is by using the
Process outside the InfoWindow. The way to deselect any displayed item is via the IsActive
checkbox of the record. Any inactive record will not be processed in the corresponding Process.
How the InfoWindows used in WMS are setup is shown under the Developer Guide.
Another limitation of iDempiere Info-Window is that it can only be used under the ZK Ajax User
Interface and it will not work under the Java Client.
Login in ZK
After launching the idempiere-server where you have the org.idempiere.WMS plugin installed,
at the browser, calling localhost:8080 (port setup in idempiere properties).
The credentials on the left, in the darker blue panel shows the version that is used in this demo.
Login into GardenWorld. At the Menu button pull down at the top of the screen:
Select the Sales Orders to Picking item. Click on the bottom left refresh icon.
It will refresh with present Sales Orders (SO) that has no Outbound corresponding records.
If you see 3 lines appearing as above, it is a prove that your WMS is working. However they are
old SOs and are already completed thus without any item quantities to pick. Processing them
later will not result in any Distribution or Shipping results. We will thus create a fresh present
day SO to test it out. There are certain other settings in later notes so do read ahead first and not
rely entirely on the screen-shots here which may be prior settings.
After that, you return back to the Sales Orders to Picking List Info-Window above.
Note the extra line appearing at the bottom from the new Sales Order you just created and com-
pleted.
Outbound Process
The Outbound process is to create the outbound records from the selected records from Sales
Orders for picking list. Go to the process in the Menu tree.
Set the input in the parameters, your Standing Locator ro Default of HQ Locator. This is for
those Customers in the Orders who are lo-
cated at this Locator. The Document Type is
set to the Warehouse Management type.
Outbound Records
Following the process to generate this, you can then view the outbound records in this window.
As mentioned also earlier, the workaround of deselecting active records can be done here to re-
move any records from subsequent processes as follow below.
Now there is a new Outbound record. At its second tab, Outbound Order Line you can see the
new Orderline dated 2014-01-07 (created today) showing a Movement Qty of three which was
what I just created a while ago. Notice the Active column of checkboxes which you can go and
deactivate the other lines so they will not be processed subsequently. Old SOlines contain no
movement Qty values (as their delivered quantity is same as movement quantity, been already
shipped). The trick to get the Active box into focus is to click on the Attribute Set Instance field
as to fake entry and you can then get the Active box into focus as show below:
Now we can proceed to the next Process - Release Print Outbound Order.
We can view what Outbound Orders we can release from this window. By pressing refresh icon
on the bottom left, we see the following record. If we wish to deselect any records at this window
we can go to the Outbound Order window and do so as explained earlier. Once we are ready, we
can proceed to its process.
There is a choice in the Process window to check for CreateSupply which will issue a MO (Manu-
facturing Order) during creation of the DO (Distribution Order).
This process or the Distribution Order and Manufacturing Order handling of the WMS has quite
some specific conditions in order for it
complete successfully. This may require
extra work on your part to set it up.
Thus you have to create your SO earlier using Store Central as the BPartner.
You also need to ensure there are AD_Users for your C_BPartners or it will stop during
DD_Order creation. ** There are no Users for this Business Partner
If the Warehouse’s InTransit box is not checked, you get ** This Warehouse is not Transit
If you have setup accordingly, or a dirty way by shutting up the errors, so we can see what is the
end result of the Outbound release process as below:
2. You can keep on repeating this process and it creates another DD_Order record again. This is
quite easy to solve by adding an IF NOT EXISTS statement in the SQL of the Release Out-
bound InfoWindow and its Process. Also multiple DD_Orders will frustrate the Shipment
process.
3. You cannot get an Outbound for Shipment query because the OutboundLine is not Proc-
essed. So the solution is to make the DD_Order processing to set this. This is also solved in
ReleaseOutBoundDirect,java which also solves bug 2 above. You can see the output screen
below when that occurs. It will not process any records and just return the message “No re-
cords”.
From here, the Outbound Order is released into the Distribution section of the ERP under Lib-
eroMFG.
Now you can call up this window from the Menu tree. Press refresh icon to extract records.
You can see the single record complete and ready for Distribution or Shipment. Note its other
details such as Movement Qty, Qty to deliver, On Hand Quantity and which OrderLine it is
from.
Note the Picket Quantity as empty. It is supposed to be filled during Distribution Order proc-
essing which is not covered in our testing scenario here (yet, until I make a study of the Distribu-
tion process under LiberoMFG).
In such cases, check your originating Sales Order as been made under the Default Store to avoid
this. The above can be fatalistic and require you to remove the Outbound records manually. This
can be solved later by code. A successful run will result in this:
DEVELOPER GUIDE
This section is perhaps much more important than the previous one which I regard as quite
straightforward in that it is heavily dependent on code such as the Rule Engine classes. This
means that the WMS is not recommended to be used out of the box. It is thus important that the
subject matter expert work closely with a good developer to translate what the engine and WMS
as a whole is setup to do and what the industry users really wanted. Once the needs are properly
mapped and reconfigured, this WMS can be very powerful and meet whatever is out there. This is
the great idea of Free as in Freedom in Open Source ERP.
2Pack PackOut
The original database dump of the instance that is used to create the 2pack is downloaded here:
http://sourceforge.net/projects/red1/files/p2/WMS/ExpDat20140109_080616.jar/download
It also contains the state of testing which you see illustrated under Operations above this. Thus
you can examine its database content to study what was the original settings that made the above
screen-shots and conclusions. However you can do the actual testing from a fresh install of the
plugin and 2packs. If you find anything broken just send the information to me. The 2pack layout
is as follows:
In the 2Pack for WMSdata is the setting for Document Type ‘WMO’ used by the OutBound
processing for Sales Orders to Picking List. It is set in the GardenWorld. If you are creating a
new Client, ensure that such a Document Type is present. If not, you have t0 create it manually
in your database. The setting for it is as follows:
https://bitbucket.org/red1/org.idempiere.wms
Info-Window
We have good use of Info-Window in the WMS and we can now look at how that is really done.
As we said that this is not using the Smart Browser method of selecting which record you want to
process, we have to go to the separate Process window for that. However I put an IsActive = ‘Y’
in all the processes so that you can manually deselect which records you do not want to be proc-
essed in this instance. We can also modify the code to be more exact by not processing records
that are already picked or delivered.
The SQL view and WHERE clause in this InfoWindow is the same as in the following process
below. (You can read more about how such clauses are set in the Developer Guide section later).
Below are the screenshots and dump of the content for the SQLs used.
Above is the Sales Order to Picking InfoWindow. The Sql FROM is:
C_Order o
INNER JOIN C_OrderLine ol ON (ol.C_Order_ID=o.C_Order_ID)
INNER JOIN C_BPartner bp ON (bp.C_BPartner_ID=o.C_BPartner_ID)
INNER JOIN C_BPartner_Location bpl ON (bpl.C_BPartner_Location_ID=o.C_BPartner_Location_ID)
INNER JOIN C_Location l ON (l.C_Location_ID=bpl.C_Location_ID)
INNER JOIN M_Product p ON (p.M_Product_ID=ol.M_Product_ID)
INNER JOIN M_Product_Category pc ON (pc.M_Product_Category_ID=p.M_Product_Category_ID)
They follow exactly the SmartBrowser setting in LiberoWMS (you can examine that in the Exp-
Dat or database dump given above).
Next is the Column Tab which is important with regard to which item act as Query Criteria that
appears in the upper panel of the Info-Window.
Again this is transferred over from the SmartBrowser but I regard this Info-Window done by Low
Heng Sin as more usable as there is no need for an extra layer of View table to refer to as it is
done right in the Sql FROM with the described JOIN statements.
Next is the
Outbound Or-
der to Release:
WM_InOutBoundLine iobl
INNER JOIN WM_InOutBound iob ON (iob.WM_InOutBound_ID=iobl.WM_InOutBound_ID)
INNER JOIN C_OrderLine ol ON (ol.C_OrderLine_ID= iobl.C_OrderLine_ID)
INNER JOIN C_Order o ON (o.C_Order_ID = ol.C_Order_ID)
INNER JOIN C_BPartner bp ON (bp.C_BPartner_ID=ol.C_BPartner_ID)
INNER JOIN M_Locator ml ON (ml.M_Warehouse_ID = iob.M_Warehouse_ID)
INNER JOIN M_StorageOnHand oh ON (oh.M_Product_ID = iobl.M_Product_ID AND oh.M_Locator_ID =
ml.M_Locator_ID)
Rule Engine
The Rule Engine implements a set of rules using Java classes so a to be more powerful in its
processing of such rules. Rules are listed in the WMRuleEngine.java:
/**
* getClassName for WM Rule
* @param rule
* @return String ClassName implementation
*/
protected String getClassName(MWMRule rule)
{
if(MWMRule.INOUTBOUNDRULE_ForTheMaterialOldestUsingFIFO.equals(rule.getInOutBoundRule()))
{
return WMRuleFIFO.class.getSimpleName();
}
else
if(MWMRule.INOUTBOUNDRULE_CustumInterface.equals(rule.getInOutBoundRule()))
{
return rule.getInOutboundClass();
}
else
{
throw new AdempiereException(rule.getInOutBoundRule() + "is not implement");
}
}
There is only one rule which is WMRuleFIFO thus the developer has to learn from to implement
a new class for any new rules. The class for the above is in the source:
ModelValidator
In the WMSValidator, there is only one routine and that is during Distribution Order processing
where a change in the DDOrderLine will fetch its QtyDelivered and copy to its corresponding
OutboundLine’s PicketQty.
if (po instanceof MDDOrderLine && IEventTopics.PO_AFTER_CHANGE == type)
{
MDDOrderLine oline = (MDDOrderLine)po;
Integer WM_InOutBoundLine_ID = (Integer)
oline.get_Value(MWMInOutBoundLine.COLUMNNAME_WM_InOutBoundLine_ID);
if(WM_InOutBoundLine_ID != null && WM_InOutBoundLine_ID.intValue() > 0 &&
oline.getQtyOrdered().compareTo(oline.getQtyDelivered()) >= 0)
{
MWMInOutBoundLine obline = new
MWMInOutBoundLine(oline.getCtx(),WM_InOutBoundLine_ID, trxName);
obline.setPickedQty(oline.getQtyDelivered());
obline.saveEx(trxName);
}
}
This routine is not tested at this stage as we have yet to study the Distribution Order processing
under LiberoMFG. I will appreciate if anyone can test it or send me a detail flow of such a proc-
ess.
Part II Roadmap
From here, I will finish the missing Inbound which should be easier as it is the PutAway of mate-
rials inbound into the ERP. That is items purchased from vendors and when the are received they
can be alternatively Inbound processed based on drafts from the Material Receipt window.
The Inbound process will take the confirmed POs that have MInOut records in progress and as-
sign the Locators according to the Inbound rules for products sorted by Area and Section de-
fined for them. Then the Material Receipts are set to the locators assigned and completed. Con-
sequently the StorageOnHand is normally updated.
FREE AS IN FREEDOM
Due to the constant and consistent confusion over how we should make money in Free and Open
Source softwares, I have to make a special post-guide writing here to attempt to explain in my
own words what the confusion is about:
1. That Free Software is sold as Free Lunch which means it has zero cost. This is often the case
during sales pitches by many of my associates from Venezuela to Japan, Russia to Australia.
Take for example some excerpts of a Sales presentation from Down Under:
Note the last item in its list of benefits for choosing ADempiere. It says ‘No “License Fees” or
‘, well, or it is free lunch. That is the first impression this software gives and it is in contraven-
tion with what the founding chapter of Free Software Foundation says. Let us look at a con-
spicuous text stating their most qualified opinion on the exact subject. This is taken from
http://www.gnu.org/philosophy/selling.html.
Many people believe that the spirit of the GNU Project is that you should not charge money for
distributing copies of software, or that you should charge as little as possible — just enough to
cover the cost. This is a misunderstanding.
Actually, we encourage people who redistribute free software to charge as much as they wish
or can. If this seems surprising to you, please read on.
Yes, please read further there. I like to quote from their closing words there too:
Sometimes companies whose activities cross the line stated in the GNU GPL plead for permis-
sion, saying that they “won't charge money for the GNU software” or such like. That won't get
them anywhere with us. Free software is about freedom, and enforcing the GPL is defending
freedom. When we defend users' freedom, we are not distracted by side issues such as how
much of a distribution fee is charged. Freedom is the issue, the whole issue, and the only issue.
I like to add my 2 freedom cents to this. Because I have a burning question. Why on earth do my
associates keep doing this same pitch? As I traveled around the world, I spent countless face to
face hours with them explaining this till my face turn blue. Even in Japan, with the Nomura
Foundation, a huge giant that has top Japanese firms under its belt, when I asked the Manager in
charge of FOSS business, he replied that his sales pitch to their prospects is ‘you need not pay
license fees’. That is not selling freedom. His opening line should be, “Let me tell about how you
can have the freedom from the service you purchase from us’. That puts to rest once and for all
the notion of ‘free as in free lunch’ and all negative aspects that comes from ‘been cheap’ and
other confusion that has nothing to do with what the users want from us.
Second cent: With such an expectation, we often undercut each other as ‘there is no license cost
to pay’ and eat into the actual margins of doing business. In the end we earn pittance for our very
qualified expertise and under pressure to over-promise and under-deliver leaving us vulnerable
to the forces of business and incompetent as we often finish off our projects with zero documen-
tation or contribution back to the FOSS community and project. We also lacked a marketing
budget in the end to dress up and prepare to go after the big business which this software really
meant to compete with.
2. That we are selling ADempiere or IDempiere as the brochure in the above example shows.
Notice how the word ‘solution’ is also misleading here. ADempiere or iDempiere is a commu-
nity project, it is not a product what more a solution. ADAXA is the party that offers the ‘prod-
uct’ and better still the ‘solution’! Thus the brochure opening image should be “Let us tell you
about a solution from ADAXA!”. You can add the words in small print below by first putting
asterisk on the word ‘solution*’ with ‘Our solution is based on ADempiere, a FOSS ERP
community project of which ADAXA is one of its exemplary contributors*’ and give another
reference to their many published works and community leaders’ support of them (which I am
very eager and have been doing selling their highly respected names off at each hand-shake I
made around the world). And I did all of that for ‘free’. :)
3. That this is a new way of selling software. In fact this is the old way of selling software. Back in
the old days of IBM software was open and learned among the universities’ faculties and stu-
dents doing software engineering. Big vendors (those days there were no small vendors) like
IBM, Data General (which i worked with in Malaysia in the 1980s) sold hardware and bundled .
software (at no cost) which is not free but as bundled in its service and support agreement.
Software was never closed until Microsoft and HP came along. They are the ones who did it in
a new way.
Let’s take the analogy of a doctor ‘selling medicine’. Firstly a doctor’s knowledge is free. You
can get access to or download whatever he knows. Up to the exact medicine’s chemical for-
mula and method of ingestion and treatment. The mistaken news is that a doctor does not sell
medicine even though you end up with medicine usually from him. What he does is not even
selling his time, even though you think you are paying for his time in minutes or hours. What
he is selling foremost is ‘his qualified opinion’ based on his learning of all those information
you thought you could download, such as whether you can live or die from whatever you got.
You cannot download that opinion as it has to be rendered by a qualified person.
Same with the ERP software we are dealing with. You cannot download and install it in General
Motors and expect them to meet their deadlines or lack of it (as GM was bankrupt, nothing to
do with whatever softwares they used but human-ware!). An ERP expert (not software person)
who may team up with a good software person (and where else to find the best other than from
the web information that points to the best contributors and committers in a Free ERP such as
iDempiere?), and offer qualified opinion, what phases of the ERP to start off and how, how,
how to do it in the most minimal risk ever based on his/her expert opinion.
Thus the way for such a team to sell, is to spell out exactly what they are good at, what they have
learned, solved, giving references of them in the market (and what better way than from Free
ERP practitioners such as me and Carlos and HengSin and many more others who has a global
reference background to boot?).
From there we could charge up to USD1,000 per day (in my case) and our value keep going up
as well as the future prospects (due to reference from present and past engagements that were
successful. The rate of success is higher because we have already built a reputation among the
top contributors of the project and thus by preference share among the top by way of making
them commercial partners too. What can I say? I work with the best people working on the
best proven software.