Projects:Organization Valid From/Technical Document
This project will be released as a new module available at http://forge.openbravo.com/projects/orgvalidfrom
Contents |
- Java Package Name : org.openbravo.module.organization.validfrom
- DB Prexix : ORGVF
Application Dictionary Changes
A new column called "EM_ORGVF_VALIDFROM" will be created in the Organization table. This column is mandatory, having 01/01/1900 as the default value.
Datasets
No dataset is needed
Java Code
org.openbravo.module.validfrom.process.OrgValidFromProcess
Java class in charge of the background process that activates/deactivates the organization based on the valid from field.
- It extends the DalBaseProcess class
- In case the client is = 0, it runs for all the organizations of all the clients (as the accounting background process)
- It uses the OBContext.setAdminMode(); to ensure we can access to the deactivate organizations
org.openbravo.module.validfrom.process.OrgValidFromProcessDao
Data Access Object used by the OrgValidFromProcess class to access the database using DAL (Hibernate)
P/L Code
ORGVF_CHECKVALIDFROM
Extension point to the end of the C_INVOICE_POST procedure that checks the invoice's acct date <= organization's valid from date. In case this check is not true, and exception is raised rolling back the C_INVOICE_POST and avoiding to complete the invoice
ORGVF_AD_ORG_TRG
Trigger before insert and update on the AD_ORG table. It ensures the organization's active flag is set automatically based on the valid from date and the current system date.