Projects:Booking Control/Technical Specification Booking Control for Accounting Unit
TECHNICAL SPECIFICATION OF BOOKING CONTROL FOR ACCOUNTING UNIT
PURPOSE OF THE PROJECT
The purpose of this document is to describe the technical Specifications for an extension module to be developed in OB ERP version 2.50 called Booking Control for Accounting Units.
INTRODUCTION
This technical specifications document outlines the implementation of Booking Control for Accounting Units features.
TECHNICAL IMPLEMENTATION :
This module will provide a new window for configuring accounting units, and a modification to the org schema tab of the organization window in order to link organizations to accounting units, and therefore to link booking control sequences to accounting units.
REQUIRED FILES
A new .obx file will be provided containing the new window and the modification to a window.
JAVA PACKAGE AND DB PREFIX
Java Package: org.openbravo.obbo_acctunit DB Prefix: BCAU
New database objects
- New table: BCAU_ACCOUNTING_UNIT
- BCAU_Accounting_Unit_ID VARCHAR2(32) NOT NULL,
- AD_Client_ID VARCHAR2(32) NOT NULL,
- AD_Org_ID VARCHAR2(32) NOT NULL, DEFAULT '0',
- IsActive CHAR(1 BYTE) DEFAULT 'Y' NOT NULL,
- Created DATE DEFAULT SYSDATE NOT NULL,
- CreatedBy VARCHAR2(32) NOT NULL,
- Updated DATE DEFAULT SYSDATE NOT NULL,
- UpdatedBy VARCHAR2(32) NOT NULL,
- Value VARCHAR2(30) NOT NULL,
- Description VARCHAR2(255),
- AD_Sequence_ID VARCHAR2(30) NOT NULL
- New column on table: AD_ORG_ACCTSCHEMA
- EM_BCAU_Accounting_Unit_ID VARCHAR2(32),
- New database trigger on table: BCAU_ACCOUNTING_UNIT
- bcau_accounting_unit_trg
TABLE SCRIPT FOR POSTGRES
- New table: BCAU_ACCOUNTING_UNIT
CREATE TABLE BCAU_ACCOUNTING_UNIT(
bcau_accounting_unit_id character varying(32) NOT NULL, ad_client_id character varying(32) NOT NULL, ad_org_id character varying(32) NOT NULL DEFAULT '0'::bpchar, isactive character(1) NOT NULL DEFAULT 'Y'::bpchar, created timestamp without time zone NOT NULL DEFAULT now(), createdby character varying(32) NOT NULL, updated timestamp without time zone NOT NULL DEFAULT now(), updatedby character varying(32) NOT NULL, "value" character varying(30) NOT NULL, description character varying(255), ad_sequence_id character varying(32) NOT NULL, CONSTRAINT bcau_accounting_unit_key PRIMARY KEY (bcau_accounting_unit_id), CONSTRAINT bcau_accounting_unit_isac_chk CHECK (isactive = ANY (ARRAY['Y'::bpchar, 'N'::bpchar])), CONSTRAINT bcau_acc_ad_sequence FOREIGN KEY (ad_sequence_id) REFERENCES ad_sequence (ad_sequence_id), CONSTRAINT bcau_acc_ad_client FOREIGN KEY (ad_client_id) REFERENCES ad_client (ad_client_id), CONSTRAINT bcau_acc_ad_org FOREIGN KEY (ad_org_id) REFERENCES ad_org (ad_org_id), CONSTRAINT bcau_accounting_unit_value UNIQUE(ad_client_id, "value")
);
- New column and foreign key on table: AD_ORG_ACCTSCHEMA
ALTER TABLE ad_org_acctschema ADD COLUMN em_bcau_accounting_unit_id varchar(32);
ALTER TABLE ad_org_acctschema ADD CONSTRAINT em_bcau_au_ad_org_as FOREIGN KEY (em_bcau_accounting_unit_id) REFERENCES bcau_accounting_unit (bcau_accounting_unit_id);
- New database trigger on table: BCAU_ACCOUNTING_UNIT
CREATE OR REPLACE FUNCTION bcau_accounting_unit_trg() RETURNS trigger AS $BODY$ DECLARE BEGIN IF AD_isTriggerEnabled()='N' THEN IF TG_OP = 'DELETE' THEN RETURN OLD; ELSE RETURN NEW; END IF; END IF; IF TG_OP = 'UPDATE'THEN IF (OLD.ad_sequence_id <> NEW.ad_sequence_id) THEN UPDATE ad_org_acctschema SET em_obbo_sequence_id = NEW.ad_sequence_id WHERE em_bcau_accounting_unit_id = OLD.bcau_accounting_unit_id; END IF; END IF; IF TG_OP = 'DELETE' THEN RETURN OLD; ELSE RETURN NEW; END IF; END; $BODY$ LANGUAGE 'plpgsql' VOLATILE COST 100;
CREATE TRIGGER bcau_accounting_unit_trg AFTER UPDATE ON bcau_accounting_unit FOR EACH ROW EXECUTE PROCEDURE bcau_accounting_unit_trg();
Application Dictionary
New objects should be registered in Application Dictionary as follows:
- New window:
Accounting Units: General Setup || Enterprise || Accounting Units Header: based on the table BCAU_ACCOUNTING_UNIT
- New field:
Accounting unit: On existing tab Org. schema of the Organization window: General Setup || Enterprise || Organization
DB Column Name: AD_ORG_ACCTSCHEMA.EM_BCAU_ACCOUNTING_UNIT_ID
- New reference:
BCAU_List_account_units: On field Accounting unit of existing tab Org. schema of the Organization window: General Setup || Enterprise || Organization
Source DB Column Name : BCAU_ACCOUNTING_UNIT.BCAU_ACCOUNTING_UNIT_ID, BCAU_ACCOUNTING_UNIT.VALUE, BCAU_ACCOUNTING_UNIT.DESCRIPTION
Target DB Column Name: AD_ORG_ACCTSCHEMA.EM_BCAU_ACCOUNTING_UNIT_ID
- New callout:
OrganizationSchemaLoadSequenceNumber: On field Accounting unit of existing tab Org. schema of the Organization window: General Setup || Enterprise || Organization
Source DB Column Name : BCAU_ACCOUNTING_UNIT.AD_SEQUENCE_ID
Target DB Column Name: AD_ORG_ACCTSCHEMA.EM_OBBO_SEQUENCE_ID
Reference data
The module does not contain any reference data.
Processes
The module does not include any process.
Menu Creation in Application Dictionary
- Login Openbravo ERP as System Administrator.
- Goto General Setup || Application || Menu || Menu
- Create a New Record "Menu"
- Name = Accounting Units
- Description = Accounting Units
- Active = Yes
- Action = "Window"
- Window = Accounting Units
- Save
- Click "Tree" icon in the tool bar (Pop up window will open).
- Drag & Drop newly created menu (Accounting Units) on the appropriated place [General Setup >> Enterprise].
Dependencies
The module Booking Control for Accounting Unit depends on Booking Control (version 1.0.13) and Core (version 2.50.19232 label MP27-EU1).