Modules:Invoicing Process Base
Contents |
Introduction
This guide describes how to create a massive invoicing process in top of the Invoicing process base. To be more illustrative, this article will explain how Re-invoicing process is defined.
Configuration
Each module that implements invoice base process needs to have a record in the Invoicing configuration window.
The Java class is the one that implements the BaseInvoiceProcess.
As explained in the technical specifications, this process consists on two sub-processes:
- Generate Invoice proposal: Generate the temporary invoices as a proposal.
- Create Invoices: Convert these temporary invoices into valid invoices.
To see the details of the implementation of the re-invoice process, you can check the technical specs of that project.
Generate Invoice proposal
In order to generate the proposal a new Process definition is needed. See how is defined Re-Invoicing process:
Notice that the handler is the BaseProcessHandler that belongs the Invoicing base process. BaseProcessHandler will get the java class to execute (the one configured in the window Invoicing process configuration).
Create Invoices
This process is the responsible for converting temporary invoices proposed into actual invoices in the system.
In order to implement this process some configuration is needed. Let's explain how Re-invoicing process implements this sub-process.
Process Definition
Create the process. See the re-invoicing example:
Pay attention to handler definition: OB.OBREINV.Process.createInvoices. Which calls the following javascript defined in the re-invoicing process module:
OB.OBREINV = OB.OBREINV || {}; OB.OBREINV.Process = { createInvoices: function (params, view) { params.action = 'PROCESS'; params.actionHandler = 'com.openbravo.gps.invoicingprocessbase.process.BaseProcessHandler'; params.adTabId = '3A35F9481CD14EAC86ACF6C7E756A9A4'; params.processId = '12FFAFDAF219415B8BD2303C337483D0'; params.vadidate = function (row) { // Blocked invoices cannot be selected //if (row.oBSCNTRInvoiceType === 'B') { //return OB.I18N.getLabel('OBINBS_BlockedNoPossibleInvoice'); //} return false; }; OB.OBINBS.Process.execute(params, view); } };
As you can see in this little piece of code some parameters are defined and will be sent to the BaseProcessHandler.
Button In Temporary Invoice Proposal window
After define the process a column (Button) is needed in Temporary invoice proposal window -C_Invoice table-. This button will be linked to the process defined above.