субота, 12. новембар 2011.

Adempiere 3.1.6 Add Serbian in Login select list

Version ADempiere 3.1.6 (and older and some higher version of ADempiere ) dont have Serbian Language into Login form in select language. This is very simple to add new Language or change existing, or set default one of the prefer language. Theres path where is located java files which should be changed or added -- ../looks/src/org/compiere /plaf/PlafRes_sr.java ../looks/src/org/compiere/util/IniRes_sr.java ../looks/src/org/compiere/util/Language.java.
And for full transformation, should be add translation from : http://sourceforge.net/projects/lsr/ -- with adding Serbia_RS and set as main language.




New java file should be add :PlafRes_sr.java




private static final String AD_Language_sr_RS = "sr_RS" -- should be add into Language.java




AD_Language should be add into Language.java




compile all java files




понедељак, 3. јануар 2011.

Adding new table in Adempiere 3.1.0

Customisation of Adempiere 3.1.0 is very easy, I was creating new table
CREATE TABLE "XX_MATERIAL"
( "AD_CLIENT_ID" NUMBER(10,0),
"AD_ORG_ID" NUMBER(10,0),
"ISACTIVE" CHAR(1),
"CREATED" DATE,
"CREATEDBY" NUMBER(10,0),
"UPDATED" DATE,
"UPDATEDBY" NUMBER(10,0),
"XX_MATERIAL_ID" NUMBER(10,0),
"MATNR" NUMBER(10,2),
"COLORNR" NUMBER(10,2),
"NAME" VARCHAR2(100),
"NAMESHORT" VARCHAR2(100),
CONSTRAINT "XX_MATERIAL_PK" PRIMARY KEY ("XX_MATERIAL_ID") ENABLE
)
/


CREATE OR REPLACE TRIGGER "BI_XX_MATERIAL"
before insert on "XX_MATERIAL"
for each row
begin
if :NEW."XX_MATERIAL_ID" is null then
select "XX_MATERIAL_SEQ".nextval into :NEW."XX_MATERIAL_ID" from dual;
end if;
end;

/
ALTER TRIGGER "BI_XX_MATERIAL" ENABLE
/
from examples on:
http://www.adempiere.com/index.php/NewWindow
and try to integrated this new table into Adempiere. This is one way, when Adempiere is install on computer, so can be customised by Administrator, other way is descibe on link above, change from trunk, from source code, include
1)Creating new table(s)
2)Dump new Adempiere.dmp database file with new creating tables
3)Creating Persistence objects with all new tables with GenerateModel.java code
4)building all code with new classes
This is 1 way, manualy customisation
Fig 1: Creating new window



Fig 1.1 Acces level and role, users who can modify data from new created table XX_MATERIAL


Fig 1.2 Fields from table XX_MATERIAL


Fig 2: MENU need call New Window created from XX_MATERIAL, I was placed into assets, could be in other hierarchy, assets can be extend and need change, in Republic of Serbia theres taxes and rates localy created, called STOPA AMORTIZACIJE, purchasing date of assets (DATUM NABAVKE OSNOVNOG SREDSTVA), other attribut rate2 called REVALORIZACIJA, account relation is good have 0230 values from accounts and 0239 as changed values, asset groups is determined by low as sub accounts, and other parameters can be changed or added. Fixed Asset Management can extend assets with this customised functionality, adding new tables and creating references (forein keys). This firs method discibe simlple modification of Adempiere 3.1.0 most complicated way is change into TRUNK of Adempiere 3.1.0 with GeneratedModel.java and practicaly reinstalation of all code.


Fig 3 : Table XX_MATERIAL have automaticaly created Persistence Objects (PO) and work fine

Fig 4: Invoices from Republic of Serbia have field called PIB, theres need add new field PIB varchar2(255) and again complete call NEW c_invoice table created New Window and New Form, on easy way with default lengh of db colum look like above picture