Table of Contents |
---|
...
When the above ‘core’ resources have been processed for a given account period the platform process the custom resources. The accounting process looks for the custom stored procedure and runs it with details of the account period.
The CUSTOM_GENERATE_ACCOUNTING_DATA_V1 stored procedure
The CUSTOM_GENERATE_ACCOUNTING_DATA_V1 stored procedure is the entry point for generating custom accounting data.
The procedure should be defined as follows:
...
To define a custom stored procedure, start with the template version of the CUSTOM_GENERATE_ACCOUNTING_DATA_TEMPLATE_V1 defined within the kinton_accounting schema.
When you run the custom stored procedure, it has access to the temporary accounting_event_... tables, and also to the (empty) tmp_accounting_event_detail table which holds unconsolidated temporary data. The custom stored procedure may access any Abiquo database data (because it is running in the context of the Abiquo system) and use it populate the unconsolidated temporary table. Depending on availability and configuration, the custom stored procedure can access non-Abiquo DBMS data too. Finally, as the last thing it does, the custom procedure should call the accounting procedure used to flush the data from the temporary table into the main accounting table, which will automatically consolidate data in the process.
...
Identify custom resource types for Abiquo
Abiquo needs to uniquely identify custom accounting resources by their resource name and resource ID. And it will need to avoid clashes with any further extensions to the core Abiquo accounting resources. Abiquo stores resource names in the accounting_event_detail table (and its temporary equivalent table) using a name ID rather than the resource name itself.
...