Openbravo POS Direct Integration
Important: This integration architecture is not maintained in Openbravo POS 2.30 and Openbravo ERP 2.50 . This integration architecture needs Openbravo POS 2.20 and Openbravo ERP 2.40
In an organization, more than one software application often exists to support a particular aspect of operational requirements. The result is an heterogeneous set of software applications requiring data sharing and integration. An ERP system like Openbravo ERP tries to solve this problem by offering one solution for every operational requirement. Openbravo ERP maintains one shared database for all data, integrated processes among different departments, a consistent interface for every user, and homogeneous reports/score cards that display operational data of the whole organization.
However there are specific corners of an organization that an ERP system cannot solve. For example, POS systems like Openbravo POS where special user types and hardware devices support are required. The POS system user is a salesman who uses an ERP in a different manner. The interface has to be very easy to use and provide only the specific information the salesman needs. This salesman needs to operate the POS as fast as possible as his job is to sell, not to operate the POS. For example he does not want to deal with a mouse and a keyboard, rather he prefers a touch screen. In addition, the POS system needs to support a lot of POS hardware available for the real solution: receipt printers, barcode scanners, customer displays, cash drawers, scales, etc.
Openbravo POS is a point of sales application designed for touch screens. And can be downloaded from Openbravo POS Downloads.
This document describes the integration effort done between Openbravo ERP and Openbravo POS to integrate and work with the same set of data. This integration is based on web services and using the integration released in the Melinux Linux distribution and developed by Opentrends.
The focus of this integration is to create a system where Openbravo ERP is the central repository of data. Products, categories and orders are maintained and Openbravo POS has the ability to operate with the products catalog downloaded from Openbravo ERP and to upload orders created by the sales activity of Openbravo POS.
This integration has been developed with webservices. Openbravo ERP has two webservice endpoints called ExternalSales and WebService. The methods of these endpoints are called on by Openbravo POS whenever the integration is required.
The Synchronize POS process
In an integrated environment all the products information, warehouse information, product categories, taxes and customers information is maintained in Openbravo ERP. This process is executed when is required to synchronize Openbravo POS with the information that has changed in Openbravo ERP.
In the Synchronize POS process the following methods are invoked.
- getProductsPlusCatalog from ExternalSales, when invoked, downloads the product catalog from Openbravo ERP to Openbravo POS as well as the product categories taxes records and warehouse information for these products. The set of products downloaded is defined in the External Point of Sales window of Openbravo ERP. After downloading the products list, Openbravo POS checks all the products downloaded as available in the sales panel catalog.
- getCustomers from WebService, downloads all the customers from Openbravo ERP.
The Synchronize Orders process
Every Openbravo POS receipt created has to be uploaded to Openbravo ERP to allow this information be processed by the Openbravo ERP system.
The method invoked is the following:
- uploadOrders from ExternalSales when invoked uploads to Openbravo ERP all the sales closed in Openbravo POS that has not been previously updated. After uploaded an user of Openbravo ERP must process the imported orders in the Import Orders window of Openbravo ERP. The options of the External Point of Sales window are used when processing the orders uploaded.
Openbravo ERP configuration
Install Openbravo webservices
You need to install the Openbravo webservices that enable the integration functionality in Openbravo ERP. To do this open a terminal window, navigate to the directory AppsOpenbravo inside the Openbravo ERP base directory and execute the next command.
# ant installWebService
After installing the webservices you can see if it is properly installed opening in your web browser the page http://localhost:8000/openbravo/services/ExternalSales?wsdl and http://localhost:8000/openbravo/services/WebService?wsdl where localhost:8000 is the host you installed Openbravo ERP. You should see an XML file that describes the services Openbravo POS uses.
Edit the external point of sales
In Openbravo ERP edit the external point of sales to define the products that will be available for every point-of-sale. This way, when a point of sale tries to get the product catalog from Openbravo ERP, the products defined in this window for this point of sale are sent. And the options defined are used in the process of orders imported.
To edit the external point of sale you have to change the role to the Openbravo ERP entity administrator of the entity you are working with, and open the menu option Sales management / Setup / External Point of Sales.
In this window you define your point of sales and include/exclude products and product categories associated with your point of sale.
You can select the products set to synchronize by category or by product. To select the product by category choose All Selected in the Included Product Categories selector and add the category records wanted. To select the products list by product, choose All Selected in the the Included Products selector and add the product records wanted.
To achieve a successful synchronization is necessary to check:
- Organization: selected organization in External Point of Sale window must have a location/address set.
- BusinessPartner: selected BusinessPartner in External Point of Sale window must have a location/address set. This Business Partner is a customer of the Openbravo ERP entity you are working with. This Business Partner will be used as the default Business partners for the orders created in Openbravo POS and for example it cannot be the Openbravo ERP entity you are working with.
- Products: the included products must have a price set in the selected Price List in External Point of Sale window.
Use Organization, Business Partner and Price List links in External Point of Sale window to check easier this points.
Add permissions to invoke the external point of sale web service
To invoke the external point of sale you need an Openbravo ERP user with authorization to invoke it.
To have authorization to invoke the external point of sale web service you need access to a task with class name org.openbravo.erpCommon.ws.externalSales.ExternalSales. Tasks are defined in the menu option General Setup > Application > Task. In the database provided with the default installation there is already a task External Point of Sales with class name org.openbravo.erpCommon.ws.externalSales.ExternalSales.
Once this task is created you need a user with a role that have access to this task. To edit users and roles associated go to the menu option General Setup > Security > User. And to edit roles and the task access go to the menu option General Setup > Security > Role.
Openbravo POS configuration
Configure the Openbravo webservices
Login as administrator and open the panel Maintenance > Resources. Create a new resource record called openbravo.properties of type Text and copy the following example configuration text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> <comment>Openbravo Websevice configuration</comment> <entry key="url"> http://localhost:8000/openbravo/services </entry> <entry key="id">1000000</entry> <entry key="org">1000000</entry> <entry key="pos">1234</entry> <entry key="user">Openbravo</entry> <entry key="password">openbravo</entry> </properties>
The configuration values are as follows:
- url: The base URL location where the Openbravo webservice endpoints are installed.
- user: The Openbravo ERP user used to invoke the integration functionality. This user must have access permissions to the class name org.openbravo.erpCommon.ws.externalSales.ExternalSales.
- password: The password of the Openbravo ERP user.
- id: The Openbravo ERP internal client identifier of the external point of sale.
- org: The Openbravo ERP internal organization identifier of the external point of sale.
- pos: The search key of the external point of sale defined in Openbravo ERP used to identify the Openbravo POS system inside Openbravo ERP.
Find out the correct values of id and org in Openbravo.properties:
Login to Openbravo ERP as System Administrator and go to Application Dictionary > Maintenance > SQL Query and execute (button with search icon):
SELECT AD_CLIENT_ID, VALUE, NAME FROM AD_CLIENT SELECT AD_ORG_ID, VALUE, NAME FROM AD_ORG
Check in the query result the value of AD_CLIENT_ID and AD_ORG_ID for selected Client and Organization in External Point of Sale window and use them to configure Openbravo.properties.
Execute the integration actions
Products synchronization and Orders synchronization in Openbravo POS
Login as administrator an go to the menu panel Maintenance. Here you have the two available options: Synchronize POS to download from Openbravo ERP the products list defined for this Point of Sale and the customers list, and Synchronize Orders to upload to Openbravo ERP the pending orders generated in this Point of Sale.
Import orders in Openbravo
Once orders are imported from Openbravo POS, these orders must be processed in Openbravo ERP to complete the importation.
To process the orders imported you have to change the role to the Openbravo ERP entity administrator of the entity you are working with, go to the menu option Master Data Management > Import Data > Import Orders and execute the process Import Orders. When the process ends a dialog with the result of the process is shown to the user.