Vous êtes sur la page 1sur 52

ADempiere Technical Basics eco soft co., ltd.

Kitti U.

Installation Adempiere 354a WinXP

This is a brief guide to starting with ADempiere More detailed steps can be found at,

http://www.adempiere.com/index.php/ADempiere_Installing http://www.adempiere.com/index.php/Installation http://www.adempiere.com/index.php/InstallClient

Install main components

There are only 3 main components in AD 1. Install Database PostgreSQL 8.4 @ C:\PostgreSQL 2. Install Java Run Time 6 @ C:\Java

For Server use JDK For Client use JRE


Extract Adempiere354a.zip, then copy Adempiere main folder @ C:\Adempiere

Server Application & Libraries (host WebGUI, Auto Processes, etc.) will be running inside Jboss (also included here) Client Application - Adempiere.exe and necessary libraries will be downloaded to client Jasper Report Runtime

Setup Environment Variable

Setup Environment Variables

For system to know where they are so that each component can talk to each others


C:\Java\jdk1.6.0_07 (for server) C:\Java\jre1.6.0_07 (for client machine)

%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin\client ; C:\PostgreSQL\8.4\bin (for server) %JAVA_HOME%\bin;%JAVA_HOME%\bin\client (for client machine)

Path: add

Installation for 354a (Win XP)

Create a blank adempiere database in Postgresql

Open pgAdmin III, login with superuser Create new login adempiere with password adempiere and give Superuser privilege Disconnect and and reconnect again using this new login Right click on node, Databases and click New database..

Create new adempiere database and assign owner to adempiere Restore provided initial database Adempiere_pg

C:\xx\xx>psql -U adempiere -d adempiere -f C:\Adempiere\data\Adempiere_pg.dmp

Installation for 354a (Win XP)

Configure PostgreSQL to be accessible from client machines in the network

Open pg_hba.conf (under C:\PostgreSQL\8.4\data)

With current, the database connection is accepted from a local computer only. To allow any computer within our local LAN, which is pre-installed with the ADempiere clientand let us assume that our computer server has a IP addressthen we should add the following two lines of configuration

host adempiere adempiere md5 host template1 postgres md5

Install Patches (if any)

Install Patches (only if applicable)

Patches will comes in 2 files,

patches_xxxx_yyyymmdd.jar zkpatches_xxxx_yyyymmdd.jar

Rename to patches.jar and zkpatches.jar and simply copy them to C:\Adempiere\Lib

Install Migration Script (only if applicable)

Migration script comes in xxx.sql files. Run it against Adempiere database, using command,

psql -U adempiere -f xxx.sql -o xxx.txt

** Patches and Migration Script is not available for this release, so just skip **

Build Application for the first time

Build Adempiere and setup connection configuration

Execute Run_Setup.bat (under C:\Adempiere) to build Adempiere for the first time, and also setup the configuration of the system.

Click Test, if passed Click Save to build

Build Application for the first time

After successful build, the installation is considered COMPLETED!!! What has happened during build process?

The build process has expanded the C:\Adempiere from 200MB to 600+MB The connection data has been saved into AdempiereEnv.properties This data is compiled to Adempiere.properties with password encripted This Adempiere.properties will later be downloaded by client machine and use as connection to the server

Client Installation

Start Application Server & Web Start on the client

Execute RUN_Server2.bat (under C:\Adempiere\utils\) Wait until it is started completely From any client machine, go to URL http://<server>/admin Click on button Web Start to download and install client application

Client Installation




adempiereDirect.jnlp downloded from server Executed by javaws.exe to create client application Necessary components and Adempiere.properties downloaded and installed on client machine Application executed on client, note that the connection is passed here Shortcut created, point to the server to always snyc with latest version on server

How to access ADempiere?

2 ways accessing the application


Client Application
Internally, it use Java to execute main class org.compiere.Adempiere


Web Application (application server must be running)


Reporting with AD (4 parts)

ADempiere has many tools to do the report

Part 1 Basic ADempiere Reports Part 2 Customized Basic Reports (Report & Process Window) Part 3 Financial Reports Part 4 Customized Reports (Jasper) Manual, Chapter 10 Reporting Management http://www.adempiere.com/index.php/ADempiere/Compiere_J asperReports_Integration_HowTo

More information

Part 1 Basic Reports

Formatted Reports

Simple Reports

What are available in Tool Bar?

Basic Reports are those icon on the Tool Bar

1) 2) 3) 4)

Note: For me, the name in red not explain the meaning, it should be, Simple Report Formatted Report

Reports (available on every window, simple columnar reports) Archived Documents/Reports (Open / Save displayed reports) Print Preview (available on selected window, i.e., PO, Invoice, etc) Print (print what is on Print Preview)

Most of the window will attach to a Table record As such, each report on each window will also attach to a Table record as well AD has the default reports for all windows, yet we still be able to re-configure / re-design within AD

Simple Reports and its simple features

In every window, click on the Report button , i.e., in payment, and it will display something like this,

Drill Across Select related item, i.e., all PO related to this payment, then click on the record to see those

Print Format AD provides default format, we can edit or add more format, click on Customize Report to do so Drill Down click link to open similar report for this Business Partner

Very simple, it shows the current payment record! If want to see more records, use search button, it will list more records according to criteria

Create new Print Format for this record

In the previous slide, the default format is Payment, simply click on Print Format, and click New Report

System will copy current format and create new format as Payment 2 Now, click on Customize Report button to go to edit the new format

Print Format Window

Print Format window is the central place to maintain layout of all basic reports, both simple report and formatted reports
Note: Other tabs is used to configure how the report will layout

Note: As expected, print format is linked to a table For simple reports, Form checkbox will be unchecked, this force report to be simple / columnar report

Formatted Report (Print Preview)

For report with headerdetail style, i.e., PO, Shipment, Invoice, etc Also configure the layout using Print Format Window in the previous slide (uncheck Form chkbox) Available Format items, i.e., field, images, line, rectangle, positions, colors, etc. Also for header-detail form, link to other print format, i.e., Invoice Header + Invoice Link Tax

How AD window find Print Format?

Different document type, use different approach. Yet mainly from (1) Document Type (field - print format) or (2) Print Form (field - default print formats) For example (more on page 343 345)

Invoice: (Business Partner) then (1) then (2) PO/SO: (1) then (2) Shipment: (1) then (2) *more on page 343-345

Note: Print Format allow us to create Form report with out leaving from AD Yet it is not the most flexible ways to design. Jasper report can fill the gap.

Part 2 Customized Basic Reports

Most reports that we see on menu

Why need Customized Basic Reports?

This is just another Basic Reports

Normally each Basic Report attach to a DB Table with a Print Format to tell how to displayed Normal Basic Reports is executed via Window (for current record being displayed)

What if we want Basic Reports that do not have window to host?

The answer is, we need to create Customized Basic Reports! AD already provide many reports as you can see from Menu These report can refer to,

Views (most cases) Tables Custom java class (very few cases, when views is not enough)

How these reports are registered?

1) 2)

Register DBs Table / Views in Report Views window As normal Basic Reports, create a Print Format for those Report Views to tell how it will layout

Both Tables and Views in DB is registered as Report View (RV) More SQL can be added

How these reports are registered?

3) 4)

Register new Report in Report & Process window Register this new Report in Menu window

On Search Screen (from menu tree, click on report icon) Comment will show as instruction Parameter will show as search criteria

Note: Report & Process window is used for Report, Workflow, Form, Report View and Jasper Report. We only talk about Report View here.

Part 3 Financial Reports

What are financial reports in AD?

Balance Sheets, Profit and Loss Statements, Statements of Account, and other types of financial reports Financial Report are very specific to COA and the client, AD provide flexible tool to create it. Reports that come with format, Summary (Line X Column)

AD use following windows to create reports,

Report Line Set Report Column Set Reporting Hierarchy grouping, i.e., BP, Vendor, Acct Codes, etc Financial Report

Creating Financial Report


Create Report Line Set and Report Column Set

Value of interested entity, i.e., Acct, BP, Sales Region, etc Calculation, i.e., Add, Substract, %, Range, etc Relative Period, i.e., Report compare to last ending period.


Create new Financial Report by using (Line X Column)

Clicking on Create Report button to show report. Will generate data based on calculation rules provided and put data into t_report then display.

Note Creating new report will auto create the Print Format. For all Financial Report, system will use table T_Report as generic report holder.

More on Financial Report setup

Report Hierarchy Not always that we want view report for all data To produce this financial report for a specific business partner and/or product only
1. 2. 3.

Use Tree window to create new grouping Use Tree Maintenance window to mange the grouping Register in Reporting Hierarchy window

This new hierarchy will be available as part of Financial Report Search criteria!

Part 4 Jasper Report Integration

This part will touch on how to setup and deploy Jasper Report in AD Will not go into deep detail on how to write Jasper report More information can be found at

http://www.adempiere.com/index.php/ADempiere/Compiere_JasperReports_Integration_ HowTo
http://www.adempiere.com/index.php/HOWTO_Create_Jasper_C_Order_Register http://www.adempiere.com/index.php/HOWTO_Use_Jasper_On_Financial_Reports http://www.adempiere.com/images/3/3b/T_ReportTemplate.zip http://www.adempiere.com/images/9/9c/Z_JR_with_subreports.zip

Jasper Report Setup

Setup Jasper Report is very simple

Install iReport 3.7.2 on development machine The jasper runtime is already available AD server

Set database connection

Creating a report


Use iReport, create new report, i.e., OrderList.jrxml Create report: Query Select FIELD
Select PARAM Layout Preview
Note: Input Parameter, use exact name as DBs column name. AD will use this to map from ADs search fields, to input parameter in Jasper Report I.e., this case AD_CLIENT_ID

Register new report to AD

1. 2. 3. 4.

Copy report file (.jrxml) to C:\Adempiere\Reports Login as System, register new report in Report & Process window

Register input parameter, i.e., AD_CLIENT_ID

Register new report in Menu

Running the report

Click on the newly created report Select predefined search parameter(s) View the report

Using Jasper for Financial Report

Remember the previous Financial Report (FN)?

We can use Jasper as the Layout to make it looks nicer. As FN report use table t_report as the data holder, the query from Jasper will query against this table We have a sample template from Carlos Ruiz

Register Jasper Template for FN report

Steps to setup Jasper Template for Financial Report

Copy T_ReportTemplate.jrxml to C:\Adempiere\Reports Register this jasper template in Report & Process as normal Open Financial Report window, select the Jasper Template for an FN report New Create Report (Jasper) button will be available

Debugging in AD

This section highlight what necessary steps for beginners to start debugging AD. More detailed information can be read at,

http://www.adempiere.com/index.php/Create_your_ADempier e_development_environment

Download source

Install Tortoise SVN, http://tortoisesvn.net/downloads Check the source that you want to download, https://adempiere.svn.sourceforge.net/svnroot/adempiere/

You will find many sub folders, the important one now are,

Trunk contain the lively updated / may not compliable) Tags compliable versions of AD, beginner might want to start from here

For example, if choose version 354a, copy this URL https://adempiere.svn.sourceforge.net/svnroot/adempiere/tags/adem piere354a/ Create new folder on your local drive, right click and use Tortoise SVN to import this source

Import source as new project in Eclipse

Open Eclipse and create a workspace, i.e., MyWorkspace Create new Java Project Choose to create new project from existing source Leave other option as default and click Finish Now, this workspace should have the new project, test build the project as you want

Setup Debug Configuration

Click on Debug Configurations Create new Configuration for Java Application Specify the entry point to the program, setting Main class: org.compiere.Adempiere

Note: To debug service on the server such as Account Fact, normally we have to create another Remote Java Application debugging which involve many steps. To make it easy, simply add VM Arguments on Arguments tab. And we can debug as normal. -Dorg.adempiere.server.embedded=True

Setup Break Point and start debugging

Setup break point in the main function of org.compiere.Adempiere class

Run Debug and system will launch AD. Use AD as normal, and system will break at specified Breakpoint Click on Eclipses menu / Run to see options to debug (i.e., step into, step over and etc)


This section summarize Workflow mechanism in ADempiere. More information,

http://www.adempiere.com/index.php/ADempiere/Compiere_J asperReports_Integration_HowTo

Workflow Window
Note of the Tab members, that is used to configure a complex workflow, Access, Node, Parameter, Transition, Condition And the available workflow type, which are, Document Process, Document Value, General, Manufacturing and Quality

General Workflow

Simplest form of workflow

Just the instruction on how to do things. Nothing more. Use window Workflow to add nodes and transition (define next node) Use window Menu to register


Document Process Workflow

Most import type of workflow,

Used to process documents, i.e., invoice, payment, receipt, etc

(Start) (DocPrepare) (DocComplete) (DocAuto)

Options of Activity (define in nodes) could be

1. 2. 3. 4.

Wait (sleep): Time before next activities User Choice: Yes/No User Action: Windows/Forms interactions Auto Action: Apps Process, Apps Report, Document Action (Approve, Reject, ReActivate, etc), Set Variable and send an Email.

Like reports, a Process will tie with a Table.You will see more!

Document Process Workflow

By configuring Node (activity), Transition and Condition we can create new / modify existing workflow such as,
Node 2 Node 1

(Doc Action) Set Condition (and/or) If xx > $$ goto node 3 else goto node 4

Node 4

Node 6


(Doc Action)

(App Process)

Node 3
(User Choice)

Node 5



Document Process Workflow

Workflow can be quite flexible like BPM, but without GUI

Can define Join & Split Element using AND / XOR Can have multiple Conditions to determine the next node Can execute something behind the scene as Auto Process Can pass Parameter to be used in the next Node (activity) execution, i.e., to pass requisition data Auto-Create PO process Can trigger Sub-Workflow Can ask for approval as Approval Workflow

IF User Choice action and using IsApproved as column value AD will send this task to responsible person, who is
The Supervisor of the current user Have right to approve (own document & enough approval budget) ** Detail from page 314 in the book

Document Process (Approval) Workflow

When use Approval Workflow, the activity of the underlining person is notified at Workflow Activities Tab next to Menu Tab To make approval,
1. 2. 3. 4.

Zoom to see the Document Answer Yes / No Click OK To make approval,

Follow up / make cancellation of the process from, Workflow Process window

How the Doc Process is registered?

Create new process in window Workflow

As stated, the Doc Process workflow tied to a table, i.e., for Process_Payment in Workflow Tab it set to C_Payment table

Register new process, i.e., Process_Payment in window Report & Process

Search Key = C_Payment_Process, Name = Process Payment

The process registered in DocAction column (a button) in window Table and Column and is fired when this button is clicked!

Document Value Workflow

Document Value is used to answer the question

If some value updated with the processing document, do something

For example,

Send the Manager a notification e-mail if there are any purchase order cancellations for a certain business partner. When a new Business Partner is created, it is forwarded for review and credit check. Send confirm e-mail to customer, when the order has been processed.


Similarly to Document Process Workflow, this workflow tied to a Table, Document Process workflow is triggered by DocAction button Document Value workflow is triggered by an updated value logic (system catch the event, no need to register with a button)

Setup Document Value Workflow

Workflow Tab: Set document (table) and trigger logic

Node Tab: Setup nodes in the similar way as Document Process workflow, i.e.,

Setup Document Value Workflow

In previous example,

When Business Partner is created, it is forwarded for review and credit check by open up Business Partner for review Login as supervisor of the user who create new BP You will see new activity arrived

Weakness of AD Workflow

No GUI drag / drop to create workflow process User Assignment

There is no way to be more flexible to identify the approving user yet when create a workflow. It is now determined automatically by the system logic.