ad basic tech_workshop

52
ADempiere Technical Basics eco soft co., ltd. Kitti U.

Upload: manisherp084

Post on 14-Apr-2017

189 views

Category:

Technology


0 download

TRANSCRIPT

ADempiere Technical Basicseco soft co., ltd.

Kitti U.

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

Installation Adempiere 354a WinXP

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

3. 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

ADEMPIERE_HOME: C:\Adempiere

JAVA_HOME:

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

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

Path: add

%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)

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 client—and let us assume that our computer

server has a 10.10.101.107 IP address—then we should add the

following two lines of configuration

host adempiere adempiere 10.10.101.107/0 md5

host template1 postgres 10.10.101.107/0 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

1) adempiereDirect.jnlpdownloded from server

2) Executed by javaws.exe to create client application

3) Necessary components and Adempiere.propertiesdownloaded and installed on client machine

4) Application executed on client, note that the connection is passed here

5) Shortcut created, point to the server to always snycwith latest version on server

How to access ADempiere?

2 ways accessing the application

1) Client Application

Internally, it use Java to execute main class

org.compiere.Adempiere

2) Web Application (application server must be running)

http://<server>/webui

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)

More information

Manual, Chapter 10 Reporting Management

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

asperReports_Integration_HowTo

Part 1 – Basic Reports

Simple Reports

Formatted Reports

What are available in Tool Bar?

Basic Reports are those icon on the Tool Bar

1) Reports (available on every window, simple columnar reports)

2) Archived Documents/Reports (Open / Save displayed reports)

3) Print Preview (available on selected window, i.e., PO, Invoice,

etc…)

4) 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

Note:

For me, the name in red not explain the meaning, it should be,

• Simple Report

• Formatted Report

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

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

Simple Reports and its simple features

Drill Down

click link to open

similar report for this Business Partner

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

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:

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

Note:

Other tabs is used

to configure how the

report will layout

Formatted Report (Print Preview)

For report with header-detail 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) Register DB’s Table / Views in Report Views window

2) 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) Register new Report in Report & Process window

4) Register this new Report in Menu window

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

On Search Screen (from menu

tree, click on report icon)

•Comment will show as instruction

•Parameter will show as search

criteria

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

1) Create Report Line Set and Report Column Set

Type:

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.

2) Create new Financial Report by using (Line X Column)

Note

•Creating new report will auto

create the Print Format.

•For all Financial Report, system

will use table T_Report as generic

report holder.

Clicking on Create Report

button to show report.

•Will generate data based on

calculation rules provided and put

data into t_report then display.

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. Use Tree window to create new grouping

2. Use Tree Maintenance window to mange the grouping

3. Register in Reporting Hierarchy window

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

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

1. Use iReport, create new report, i.e.,

OrderList.jrxml

2. Create report: Query Select FIELD

Select PARAM Layout PreviewNote:

•Input Parameter, use exact name as DB’s

column name. AD will use this to map

from AD’s search fields, to input parameter

in Jasper Report

•I.e., this case AD_CLIENT_ID

Register new report to AD

1. Copy report file (.jrxml) to C:\Adempiere\Reports

2. Login as System, register new report in Report & Process window

3. Register input parameter, i.e., AD_CLIENT_ID

4. 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_ADempiere_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/adempiere354a/

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 Eclipse’s menu / Run to see options to debug (i.e., step into, step over and etc)

Workflow

This section summarize Workflow mechanism in

ADempiere.

More information,

http://www.adempiere.com/index.php/ADempiere/Compiere_JasperReports_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.

Windows:

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

Options of Activity (define in nodes) could be1. Wait (sleep): Time before next activities

2. User Choice: Yes/No

3. User Action: Windows/Forms interactions

4. Auto Action: Apps Process, Apps Report, Document Action (Approve, Reject, Re-

Activate, etc), Set Variable and send an Email.

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

(Start)

(DocPrepare)

(DocComplete)

(DocAuto)

Document Process Workflow

By configuring Node (activity), Transition and

Condition we can create new / modify existing

workflow such as,

Start(Wait)

Node 1

Complete(Doc Action)

Node 4

Approve(User Choice)

Node 3

ConvertToPO(App Process)

Node 6

EmailToMgr(Email)

Node 5

Prepare(Doc Action)

Node 2

Set Condition

(and/or)

If xx > $$

goto node 3 else goto node 4

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. Zoom to see the Document

2. Answer Yes / No

3. Click OK

4. 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.

Note: 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.