View source | View content page | Page history | Printable version   

Projects:Invoicing Process Base/Technical Specification



In this document are described all the developments needed to properly implement the Invoicing process base module.

The objective of the module is to create a framework to easily create massive invoicing processes.

The approach of this massive invoicing process is to do the invoicing in two steps:

Module Definition

Invoicing process Base Module

New window

Invoicing process configuration

In this window is configured the Invoicing process implemented by the user. Each module implementing a massive invoice process have to include a record in this window specifying the java class of the process to execute and the process definition. Single tab structure

Temporary Sales Invoice Proposal

Window to store temporary the invoices proposed by the invoicing process. This window is not accessible by the menu, it is only opened after the execution of the invoicing process.

Notice that there is no Process definition in this module. The process definition will be defined in the massive invoicing process developed on top of this module.

Javascript artifacts


Component to allow the execution of a process for several records in a window. This components has a method called execute() which is the responsible of the execution of the process to generate the final invoices. This method will be called by the handler defined on the 'Create Invoices' process implemented on top of this module.

Java artifacts


Component provider for ob-multirecordprocess.


Action handler that should be declared in all the processes that implements and extends this module. This handler supports two actions:


Java interface that has two methods defined (one for each action called by BaseProcessHandler):

public InvoiceTempInstance createTemporalInvoices(JSONObject params) throws Exception;
public OBError generateInvoices(JSONObject params) throws Exception;

Each invoicing massive processes developed on top of this module has to implement these methods.


Abstract class that implements the InvoiceProcess interface and some other generic methods ready to be overwritten by the any invoicing process that extends this module (i.e Re-invoicing process).

public void createTemporalInvoicesExtensionPoint(InvoiceTempInstance invoiceTempInstance)
public String getDescription(Invoice invoice) 
public String getInvoiceLineDescription(InvoiceLine invoiceLine)
public Date calculateInvoiceDate(Date currentDate, Order salesOrder, Date filterDateFrom,
     Date filterDateTo, String invoiceType)  

There is a method called getInvoiceProcessClass that should not be overwritten. This is the method responsible for getting an instance of the java class configured in the Invoicing process configuration window. The returned java class instance will be the invoicing process that implements the BaseInvoiceProcess.

protected static BaseInvoiceProcess getInvoiceProcessClass(Client client,
     Process processDefinition) throws Exception


Class to manage the instances of the processes and link them to the generated invoices.


Utility with some useful methods reusable by any invoicing process: getListBreakBy1000: Creates a list of sets containing at max of 1000 elements each. Useful to avoid problems with more than 1000 items in oracle IN clause.

generateDocumentNo: Returns a document number using Utility.getDocumentNo

fromJSONArrayToSet: Convert an JSON array of string to a set of strings.

convertOBErrorToJSON: Converts the OBError message to a JSONObject message.


Some constants defined. Some examples:

public final static String SALES_INVOICE_PROPOSAL_HEADER_TAB = "3A35F9481CD14EAC86ACF6C7E756A9A4";
public final static String DRAFT = "DR";

Retrieved from ""

This page has been accessed 1,335 times. This page was last modified on 22 March 2014, at 12:53. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.